Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.9% → 78.9%
Time: 37.8s
Alternatives: 24
Speedup: 1.4×

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

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

Initial Program: 65.9% 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: 78.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -2.3999999999999998e245

    1. Initial program 28.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified28.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt28.2%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity28.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999998e245 < l < -3.999999999999988e-310

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg65.0%

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

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

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

    if -3.999999999999988e-310 < l

    1. Initial program 63.9%

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

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

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

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

Alternative 2: 77.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.44999999999999999e240

    1. Initial program 28.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified28.2%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*14.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/28.2%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*15.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*75.6%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-175.6%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*86.6%

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

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

    if -1.44999999999999999e240 < l < -4.2e-305

    1. Initial program 63.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg64.7%

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

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

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

    if -4.2e-305 < l

    1. Initial program 64.2%

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

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

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

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

Alternative 3: 76.5% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.125, t\_0, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -7.59999999999999978e253

    1. Initial program 34.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. Simplified45.1%

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac23.6%

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*23.6%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative24.3%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*34.7%

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

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

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

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

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

    if -7.59999999999999978e253 < h < -4.5e-300

    1. Initial program 64.2%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt64.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \frac{0.5 \cdot M}{d}\right)}\right)}^{2}\right) \]
    11. Step-by-step derivation
      1. pow163.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times43.6%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt15.1%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg26.3%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt21.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt21.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/221.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod21.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/221.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod21.5%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times20.9%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr76.6%

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

    if -4.5e-300 < h

    1. Initial program 63.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. Applied egg-rr78.1%

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

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

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

Alternative 4: 76.2% accurate, 0.8× speedup?

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

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


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

    1. Initial program 62.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. Simplified62.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow153.4%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times41.6%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt15.4%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg25.7%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/222.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/222.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod22.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr73.4%

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

    if -3.999999999999988e-310 < l

    1. Initial program 63.9%

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

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

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

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

Alternative 5: 75.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -5.20000000000000042e180

    1. Initial program 48.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. Simplified52.2%

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac18.7%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative18.7%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*18.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative23.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*27.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified44.8%

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

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

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down57.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative57.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified57.9%

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

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot \color{blue}{\left(\sqrt{\sqrt{h \cdot {\ell}^{-3}}} \cdot \sqrt{\sqrt{h \cdot {\ell}^{-3}}}\right)}\right) \]
      2. pow257.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot \color{blue}{{\left(\sqrt{\sqrt{h \cdot {\ell}^{-3}}}\right)}^{2}}\right) \]
      3. pow1/257.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot {\left(\sqrt{\color{blue}{{\left(h \cdot {\ell}^{-3}\right)}^{0.5}}}\right)}^{2}\right) \]
      4. sqrt-pow157.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot {\color{blue}{\left({\left(h \cdot {\ell}^{-3}\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}\right) \]
      5. metadata-eval57.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot {\left({\left(h \cdot {\ell}^{-3}\right)}^{\color{blue}{0.25}}\right)}^{2}\right) \]
    17. Applied egg-rr57.9%

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

    if -5.20000000000000042e180 < h < -4.999999999999985e-310

    1. Initial program 64.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt65.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow155.3%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times45.6%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt13.8%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg26.3%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/221.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/221.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times21.2%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr81.2%

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

    if -4.999999999999985e-310 < h

    1. Initial program 63.9%

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

      \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\right)}^{1}} \]
    4. Step-by-step derivation
      1. unpow179.3%

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

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

        \[\leadsto \frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \color{blue}{-0.5} \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right) \]
      4. associate-*r*79.3%

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

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

        \[\leadsto \frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\left(\frac{h}{\ell} \cdot 0.25\right) \cdot {\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2}\right)\right) \]
      7. associate-/l*81.8%

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

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

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

Alternative 6: 75.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.20000000000000006e179

    1. Initial program 48.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. Simplified52.2%

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac18.7%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative18.7%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*18.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative23.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*27.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified44.8%

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

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

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down57.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative57.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified57.9%

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

    if -1.20000000000000006e179 < h < -4.999999999999985e-310

    1. Initial program 64.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt65.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow155.3%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times45.6%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt13.8%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg26.3%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/221.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/221.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod21.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times21.2%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr81.2%

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

    if -4.999999999999985e-310 < h

    1. Initial program 63.9%

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

      \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\right)}^{1}} \]
    4. Step-by-step derivation
      1. unpow179.3%

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

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

        \[\leadsto \frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + \color{blue}{-0.5} \cdot \left(\frac{h}{\ell} \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\right)\right) \]
      4. associate-*r*79.3%

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

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

        \[\leadsto \frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + -0.5 \cdot \left(\left(\frac{h}{\ell} \cdot 0.25\right) \cdot {\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2}\right)\right) \]
      7. associate-/l*81.8%

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

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

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

Alternative 7: 69.9% accurate, 1.0× speedup?

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

\mathbf{elif}\;d \leq 2.4 \cdot 10^{-152}:\\
\;\;\;\;{\left(D\_m \cdot M\_m\right)}^{2} \cdot \frac{-0.125 \cdot \left(\sqrt{h} \cdot {\ell}^{-1.5}\right)}{d}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0\right) \cdot t\_1\\


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

    1. Initial program 62.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. Simplified63.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \frac{0.5 \cdot M}{d}\right)}\right)}^{2}\right) \]
    11. Step-by-step derivation
      1. pow162.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times42.0%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt15.5%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg25.9%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt23.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt23.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/223.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod23.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/223.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod23.1%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times24.0%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr73.9%

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

    if -1.74999999999999996e-301 < d < 2.4e-152

    1. Initial program 35.9%

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac16.6%

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*16.7%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative33.7%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*33.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified8.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    16. Step-by-step derivation
      1. associate-*l/10.8%

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

        \[\leadsto \color{blue}{\frac{-{\left(D \cdot M\right)}^{2} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)}{-d}} \]
      3. *-commutative10.8%

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

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

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

        \[\leadsto \frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{\color{blue}{-1.5}}\right) \cdot 0.125\right)}{-d} \]
      7. add-sqr-sqrt0.0%

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

        \[\leadsto \frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}{\color{blue}{\sqrt{\left(-d\right) \cdot \left(-d\right)}}} \]
      9. sqr-neg51.9%

        \[\leadsto \frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}{\sqrt{\color{blue}{d \cdot d}}} \]
      10. sqrt-unprod73.2%

        \[\leadsto \frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}{\color{blue}{\sqrt{d} \cdot \sqrt{d}}} \]
      11. add-sqr-sqrt73.2%

        \[\leadsto \frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}{\color{blue}{d}} \]
    17. Applied egg-rr73.2%

      \[\leadsto \color{blue}{\frac{-{\left(D \cdot M\right)}^{2} \cdot \left(\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}{d}} \]
    18. Step-by-step derivation
      1. distribute-rgt-neg-in73.2%

        \[\leadsto \frac{\color{blue}{{\left(D \cdot M\right)}^{2} \cdot \left(-\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125\right)}}{d} \]
      2. associate-/l*74.7%

        \[\leadsto \color{blue}{{\left(D \cdot M\right)}^{2} \cdot \frac{-\left(\sqrt{h} \cdot {\ell}^{-1.5}\right) \cdot 0.125}{d}} \]
      3. *-commutative74.7%

        \[\leadsto {\left(D \cdot M\right)}^{2} \cdot \frac{-\color{blue}{0.125 \cdot \left(\sqrt{h} \cdot {\ell}^{-1.5}\right)}}{d} \]
      4. distribute-lft-neg-in74.7%

        \[\leadsto {\left(D \cdot M\right)}^{2} \cdot \frac{\color{blue}{\left(-0.125\right) \cdot \left(\sqrt{h} \cdot {\ell}^{-1.5}\right)}}{d} \]
      5. metadata-eval74.7%

        \[\leadsto {\left(D \cdot M\right)}^{2} \cdot \frac{\color{blue}{-0.125} \cdot \left(\sqrt{h} \cdot {\ell}^{-1.5}\right)}{d} \]
    19. Simplified74.7%

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

    if 2.4e-152 < d

    1. Initial program 77.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. Simplified75.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow166.4%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times58.2%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt20.8%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg35.3%

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

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt30.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt30.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/230.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod30.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/230.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod30.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times28.4%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr78.1%

      \[\leadsto \color{blue}{\left(\frac{{\left(\sqrt[3]{d}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{d}}{\sqrt{h \cdot \ell}}\right)} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    17. Step-by-step derivation
      1. times-frac78.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(-1 - \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{-152}:\\ \;\;\;\;{\left(D \cdot M\right)}^{2} \cdot \frac{-0.125 \cdot \left(\sqrt{h} \cdot {\ell}^{-1.5}\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 54.6% accurate, 1.3× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\ t_1 := \sqrt{\ell \cdot h}\\ t_2 := \frac{d}{-t\_1}\\ t_3 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;d \leq -1.8 \cdot 10^{+16}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-37}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -5.4 \cdot 10^{-68}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;d \leq -1.7 \cdot 10^{-193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -9.2 \cdot 10^{-208}:\\ \;\;\;\;d \cdot \left(-t\_3\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-148}:\\ \;\;\;\;\frac{h}{\ell} \cdot \frac{\left(d \cdot -0.125\right) \cdot {\left(M\_m \cdot \frac{D\_m}{d}\right)}^{2}}{t\_1}\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-87}:\\ \;\;\;\;d \cdot t\_3\\ \mathbf{elif}\;d \leq 1:\\ \;\;\;\;\left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D\_m \cdot \frac{M\_m}{d}\right)}^{2}\right)\right) \cdot \frac{d}{t\_1}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+244}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;d \leq 1.65 \cdot 10^{+244}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (*
          (* 0.125 (sqrt (* h (pow l -3.0))))
          (* (* D_m M_m) (/ (* D_m M_m) d))))
        (t_1 (sqrt (* l h)))
        (t_2 (/ d (- t_1)))
        (t_3 (pow (* l h) -0.5)))
   (if (<= d -1.8e+16)
     (* d (- (sqrt (/ (/ 1.0 h) l))))
     (if (<= d -5e-37)
       t_0
       (if (<= d -5.4e-68)
         t_2
         (if (<= d -1.7e-193)
           t_0
           (if (<= d -9.2e-208)
             (* d (- t_3))
             (if (<= d -1.75e-301)
               t_0
               (if (<= d 8e-148)
                 (*
                  (/ h l)
                  (/ (* (* d -0.125) (pow (* M_m (/ D_m d)) 2.0)) t_1))
                 (if (<= d 1.5e-87)
                   (* d t_3)
                   (if (<= d 1.0)
                     (*
                      (* -0.125 (* (/ h l) (pow (* D_m (/ M_m d)) 2.0)))
                      (/ d t_1))
                     (if (<= d 1.6e+244)
                       (/ d (* (sqrt h) (sqrt l)))
                       (if (<= d 1.65e+244)
                         t_2
                         (* d (* (pow h -0.5) (sqrt (/ 1.0 l)))))))))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * sqrt((h * pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double t_1 = sqrt((l * h));
	double t_2 = d / -t_1;
	double t_3 = pow((l * h), -0.5);
	double tmp;
	if (d <= -1.8e+16) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else if (d <= -5e-37) {
		tmp = t_0;
	} else if (d <= -5.4e-68) {
		tmp = t_2;
	} else if (d <= -1.7e-193) {
		tmp = t_0;
	} else if (d <= -9.2e-208) {
		tmp = d * -t_3;
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else if (d <= 8e-148) {
		tmp = (h / l) * (((d * -0.125) * pow((M_m * (D_m / d)), 2.0)) / t_1);
	} else if (d <= 1.5e-87) {
		tmp = d * t_3;
	} else if (d <= 1.0) {
		tmp = (-0.125 * ((h / l) * pow((D_m * (M_m / d)), 2.0))) * (d / t_1);
	} else if (d <= 1.6e+244) {
		tmp = d / (sqrt(h) * sqrt(l));
	} else if (d <= 1.65e+244) {
		tmp = t_2;
	} else {
		tmp = d * (pow(h, -0.5) * sqrt((1.0 / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (0.125d0 * sqrt((h * (l ** (-3.0d0))))) * ((d_m * m_m) * ((d_m * m_m) / d))
    t_1 = sqrt((l * h))
    t_2 = d / -t_1
    t_3 = (l * h) ** (-0.5d0)
    if (d <= (-1.8d+16)) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else if (d <= (-5d-37)) then
        tmp = t_0
    else if (d <= (-5.4d-68)) then
        tmp = t_2
    else if (d <= (-1.7d-193)) then
        tmp = t_0
    else if (d <= (-9.2d-208)) then
        tmp = d * -t_3
    else if (d <= (-1.75d-301)) then
        tmp = t_0
    else if (d <= 8d-148) then
        tmp = (h / l) * (((d * (-0.125d0)) * ((m_m * (d_m / d)) ** 2.0d0)) / t_1)
    else if (d <= 1.5d-87) then
        tmp = d * t_3
    else if (d <= 1.0d0) then
        tmp = ((-0.125d0) * ((h / l) * ((d_m * (m_m / d)) ** 2.0d0))) * (d / t_1)
    else if (d <= 1.6d+244) then
        tmp = d / (sqrt(h) * sqrt(l))
    else if (d <= 1.65d+244) then
        tmp = t_2
    else
        tmp = d * ((h ** (-0.5d0)) * sqrt((1.0d0 / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * Math.sqrt((h * Math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double t_1 = Math.sqrt((l * h));
	double t_2 = d / -t_1;
	double t_3 = Math.pow((l * h), -0.5);
	double tmp;
	if (d <= -1.8e+16) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else if (d <= -5e-37) {
		tmp = t_0;
	} else if (d <= -5.4e-68) {
		tmp = t_2;
	} else if (d <= -1.7e-193) {
		tmp = t_0;
	} else if (d <= -9.2e-208) {
		tmp = d * -t_3;
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else if (d <= 8e-148) {
		tmp = (h / l) * (((d * -0.125) * Math.pow((M_m * (D_m / d)), 2.0)) / t_1);
	} else if (d <= 1.5e-87) {
		tmp = d * t_3;
	} else if (d <= 1.0) {
		tmp = (-0.125 * ((h / l) * Math.pow((D_m * (M_m / d)), 2.0))) * (d / t_1);
	} else if (d <= 1.6e+244) {
		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
	} else if (d <= 1.65e+244) {
		tmp = t_2;
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.sqrt((1.0 / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = (0.125 * math.sqrt((h * math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d))
	t_1 = math.sqrt((l * h))
	t_2 = d / -t_1
	t_3 = math.pow((l * h), -0.5)
	tmp = 0
	if d <= -1.8e+16:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	elif d <= -5e-37:
		tmp = t_0
	elif d <= -5.4e-68:
		tmp = t_2
	elif d <= -1.7e-193:
		tmp = t_0
	elif d <= -9.2e-208:
		tmp = d * -t_3
	elif d <= -1.75e-301:
		tmp = t_0
	elif d <= 8e-148:
		tmp = (h / l) * (((d * -0.125) * math.pow((M_m * (D_m / d)), 2.0)) / t_1)
	elif d <= 1.5e-87:
		tmp = d * t_3
	elif d <= 1.0:
		tmp = (-0.125 * ((h / l) * math.pow((D_m * (M_m / d)), 2.0))) * (d / t_1)
	elif d <= 1.6e+244:
		tmp = d / (math.sqrt(h) * math.sqrt(l))
	elif d <= 1.65e+244:
		tmp = t_2
	else:
		tmp = d * (math.pow(h, -0.5) * math.sqrt((1.0 / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64(0.125 * sqrt(Float64(h * (l ^ -3.0)))) * Float64(Float64(D_m * M_m) * Float64(Float64(D_m * M_m) / d)))
	t_1 = sqrt(Float64(l * h))
	t_2 = Float64(d / Float64(-t_1))
	t_3 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (d <= -1.8e+16)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	elseif (d <= -5e-37)
		tmp = t_0;
	elseif (d <= -5.4e-68)
		tmp = t_2;
	elseif (d <= -1.7e-193)
		tmp = t_0;
	elseif (d <= -9.2e-208)
		tmp = Float64(d * Float64(-t_3));
	elseif (d <= -1.75e-301)
		tmp = t_0;
	elseif (d <= 8e-148)
		tmp = Float64(Float64(h / l) * Float64(Float64(Float64(d * -0.125) * (Float64(M_m * Float64(D_m / d)) ^ 2.0)) / t_1));
	elseif (d <= 1.5e-87)
		tmp = Float64(d * t_3);
	elseif (d <= 1.0)
		tmp = Float64(Float64(-0.125 * Float64(Float64(h / l) * (Float64(D_m * Float64(M_m / d)) ^ 2.0))) * Float64(d / t_1));
	elseif (d <= 1.6e+244)
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	elseif (d <= 1.65e+244)
		tmp = t_2;
	else
		tmp = Float64(d * Float64((h ^ -0.5) * sqrt(Float64(1.0 / l))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (0.125 * sqrt((h * (l ^ -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	t_1 = sqrt((l * h));
	t_2 = d / -t_1;
	t_3 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (d <= -1.8e+16)
		tmp = d * -sqrt(((1.0 / h) / l));
	elseif (d <= -5e-37)
		tmp = t_0;
	elseif (d <= -5.4e-68)
		tmp = t_2;
	elseif (d <= -1.7e-193)
		tmp = t_0;
	elseif (d <= -9.2e-208)
		tmp = d * -t_3;
	elseif (d <= -1.75e-301)
		tmp = t_0;
	elseif (d <= 8e-148)
		tmp = (h / l) * (((d * -0.125) * ((M_m * (D_m / d)) ^ 2.0)) / t_1);
	elseif (d <= 1.5e-87)
		tmp = d * t_3;
	elseif (d <= 1.0)
		tmp = (-0.125 * ((h / l) * ((D_m * (M_m / d)) ^ 2.0))) * (d / t_1);
	elseif (d <= 1.6e+244)
		tmp = d / (sqrt(h) * sqrt(l));
	elseif (d <= 1.65e+244)
		tmp = t_2;
	else
		tmp = d * ((h ^ -0.5) * sqrt((1.0 / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(0.125 * N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(d / (-t$95$1)), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[d, -1.8e+16], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -5e-37], t$95$0, If[LessEqual[d, -5.4e-68], t$95$2, If[LessEqual[d, -1.7e-193], t$95$0, If[LessEqual[d, -9.2e-208], N[(d * (-t$95$3)), $MachinePrecision], If[LessEqual[d, -1.75e-301], t$95$0, If[LessEqual[d, 8e-148], N[(N[(h / l), $MachinePrecision] * N[(N[(N[(d * -0.125), $MachinePrecision] * N[Power[N[(M$95$m * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e-87], N[(d * t$95$3), $MachinePrecision], If[LessEqual[d, 1.0], N[(N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.6e+244], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.65e+244], t$95$2, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\
t_1 := \sqrt{\ell \cdot h}\\
t_2 := \frac{d}{-t\_1}\\
t_3 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;d \leq -1.8 \cdot 10^{+16}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -5.4 \cdot 10^{-68}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;d \leq -1.7 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -9.2 \cdot 10^{-208}:\\
\;\;\;\;d \cdot \left(-t\_3\right)\\

\mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq 8 \cdot 10^{-148}:\\
\;\;\;\;\frac{h}{\ell} \cdot \frac{\left(d \cdot -0.125\right) \cdot {\left(M\_m \cdot \frac{D\_m}{d}\right)}^{2}}{t\_1}\\

\mathbf{elif}\;d \leq 1.5 \cdot 10^{-87}:\\
\;\;\;\;d \cdot t\_3\\

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

\mathbf{elif}\;d \leq 1.6 \cdot 10^{+244}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\

\mathbf{elif}\;d \leq 1.65 \cdot 10^{+244}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 9 regimes
  2. if d < -1.8e16

    1. Initial program 69.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. Simplified71.3%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*47.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/69.3%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*71.3%

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

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num69.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*66.2%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-166.2%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*66.6%

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

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

    if -1.8e16 < d < -4.9999999999999997e-37 or -5.4000000000000003e-68 < d < -1.7000000000000001e-193 or -9.19999999999999986e-208 < d < -1.74999999999999996e-301

    1. Initial program 57.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. Simplified57.4%

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative36.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*35.0%

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. unpow235.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. unpow235.0%

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*44.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified47.2%

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

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

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down54.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative54.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified54.9%

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

        \[\leadsto \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      2. *-un-lft-identity54.9%

        \[\leadsto \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\color{blue}{1 \cdot d}} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      3. times-frac54.9%

        \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
    17. Applied egg-rr54.9%

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

    if -4.9999999999999997e-37 < d < -5.4000000000000003e-68 or 1.6000000000000001e244 < d < 1.6499999999999999e244

    1. Initial program 77.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified77.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt77.5%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr2.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square2.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt2.3%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr2.3%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt2.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified2.3%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

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

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

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

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

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr78.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr78.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval78.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*78.4%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg78.4%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval78.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr78.3%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr78.4%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval78.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow73.4%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval73.4%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in73.4%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified78.6%

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

    if -1.7000000000000001e-193 < d < -9.19999999999999986e-208

    1. Initial program 0.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity0.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

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

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

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-150.2%

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

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval50.2%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr51.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square51.0%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt50.2%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr50.2%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt51.0%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified51.0%

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

    if -1.74999999999999996e-301 < d < 7.99999999999999949e-148

    1. Initial program 35.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. Simplified31.0%

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative17.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*17.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative33.2%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*33.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(-0.125 \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      2. associate-*r*54.6%

        \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h \cdot \ell}} \cdot -0.125\right) \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)} \]
      3. associate-*r*54.6%

        \[\leadsto \color{blue}{\left(\left(\frac{d}{\sqrt{h \cdot \ell}} \cdot -0.125\right) \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right) \cdot \frac{h}{\ell}} \]
      4. associate-*l/54.6%

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

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

        \[\leadsto \frac{\left(d \cdot -0.125\right) \cdot {\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2}}{\sqrt{h \cdot \ell}} \cdot \frac{h}{\ell} \]
      7. *-commutative65.3%

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

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

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

    if 7.99999999999999949e-148 < d < 1.50000000000000008e-87

    1. Initial program 53.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified46.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt46.3%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity46.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square62.1%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt61.9%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr61.9%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt62.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified62.1%

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

    if 1.50000000000000008e-87 < d < 1

    1. Initial program 100.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. Simplified99.9%

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac83.2%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative83.2%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*83.2%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative91.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*91.6%

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

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

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

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

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

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

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

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

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

    if 1 < d < 1.6000000000000001e244

    1. Initial program 83.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. Simplified83.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr57.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square57.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt56.6%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr56.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt57.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified57.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 57.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. unpow-157.0%

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr57.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square57.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. metadata-eval57.0%

        \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      6. pow-sqr56.8%

        \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      7. fabs-sqr56.8%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      8. pow-sqr57.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      9. metadata-eval57.0%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      10. exp-to-pow54.0%

        \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      11. metadata-eval54.0%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      12. distribute-rgt-neg-in54.0%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      13. exp-neg54.0%

        \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      14. associate-*r/54.0%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      15. *-rgt-identity54.0%

        \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      16. exp-to-pow57.1%

        \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      17. unpow1/257.1%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    13. Simplified57.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    14. Step-by-step derivation
      1. *-commutative57.1%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prod67.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    15. Applied egg-rr67.3%

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

    if 1.6499999999999999e244 < d

    1. Initial program 76.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. Simplified70.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval69.4%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr69.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square69.4%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt69.1%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr69.1%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt69.4%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified69.4%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt69.1%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod69.4%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up69.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval69.4%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow69.4%

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

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/69.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. pow1/269.3%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}} \]
      9. div-inv69.2%

        \[\leadsto d \cdot {\color{blue}{\left(\frac{1}{h} \cdot \frac{1}{\ell}\right)}}^{0.5} \]
      10. unpow-prod-down87.4%

        \[\leadsto d \cdot \color{blue}{\left({\left(\frac{1}{h}\right)}^{0.5} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right)} \]
      11. pow1/287.4%

        \[\leadsto d \cdot \left(\color{blue}{\sqrt{\frac{1}{h}}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      12. inv-pow87.4%

        \[\leadsto d \cdot \left(\sqrt{\color{blue}{{h}^{-1}}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      13. sqrt-pow187.4%

        \[\leadsto d \cdot \left(\color{blue}{{h}^{\left(\frac{-1}{2}\right)}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      14. metadata-eval87.4%

        \[\leadsto d \cdot \left({h}^{\color{blue}{-0.5}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
    12. Applied egg-rr87.4%

      \[\leadsto d \cdot \color{blue}{\left({h}^{-0.5} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right)} \]
    13. Step-by-step derivation
      1. unpow1/287.4%

        \[\leadsto d \cdot \left({h}^{-0.5} \cdot \color{blue}{\sqrt{\frac{1}{\ell}}}\right) \]
    14. Simplified87.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.8 \cdot 10^{+16}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-37}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -5.4 \cdot 10^{-68}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq -1.7 \cdot 10^{-193}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -9.2 \cdot 10^{-208}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-148}:\\ \;\;\;\;\frac{h}{\ell} \cdot \frac{\left(d \cdot -0.125\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-87}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;d \leq 1:\\ \;\;\;\;\left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+244}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;d \leq 1.65 \cdot 10^{+244}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.3% accurate, 1.3× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\ t_1 := \sqrt{\ell \cdot h}\\ t_2 := \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D\_m \cdot \frac{M\_m}{d}\right)}^{2}\right)\right) \cdot \frac{d}{t\_1}\\ t_3 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;d \leq -530000000:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -6.7 \cdot 10^{-37}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{d}{-t\_1}\\ \mathbf{elif}\;d \leq -1.65 \cdot 10^{-193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -3.8 \cdot 10^{-208}:\\ \;\;\;\;d \cdot \left(-t\_3\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 4.8 \cdot 10^{-141}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-87}:\\ \;\;\;\;d \cdot t\_3\\ \mathbf{elif}\;d \leq 1.82 \cdot 10^{-31}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (*
          (* 0.125 (sqrt (* h (pow l -3.0))))
          (* (* D_m M_m) (/ (* D_m M_m) d))))
        (t_1 (sqrt (* l h)))
        (t_2 (* (* -0.125 (* (/ h l) (pow (* D_m (/ M_m d)) 2.0))) (/ d t_1)))
        (t_3 (pow (* l h) -0.5)))
   (if (<= d -530000000.0)
     (* d (- (sqrt (/ (/ 1.0 h) l))))
     (if (<= d -6.7e-37)
       t_0
       (if (<= d -1.5e-65)
         (/ d (- t_1))
         (if (<= d -1.65e-193)
           t_0
           (if (<= d -3.8e-208)
             (* d (- t_3))
             (if (<= d -1.75e-301)
               t_0
               (if (<= d 4.8e-141)
                 t_2
                 (if (<= d 9e-87)
                   (* d t_3)
                   (if (<= d 1.82e-31)
                     t_2
                     (* d (/ (pow h -0.5) (sqrt l))))))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * sqrt((h * pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double t_1 = sqrt((l * h));
	double t_2 = (-0.125 * ((h / l) * pow((D_m * (M_m / d)), 2.0))) * (d / t_1);
	double t_3 = pow((l * h), -0.5);
	double tmp;
	if (d <= -530000000.0) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else if (d <= -6.7e-37) {
		tmp = t_0;
	} else if (d <= -1.5e-65) {
		tmp = d / -t_1;
	} else if (d <= -1.65e-193) {
		tmp = t_0;
	} else if (d <= -3.8e-208) {
		tmp = d * -t_3;
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else if (d <= 4.8e-141) {
		tmp = t_2;
	} else if (d <= 9e-87) {
		tmp = d * t_3;
	} else if (d <= 1.82e-31) {
		tmp = t_2;
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (0.125d0 * sqrt((h * (l ** (-3.0d0))))) * ((d_m * m_m) * ((d_m * m_m) / d))
    t_1 = sqrt((l * h))
    t_2 = ((-0.125d0) * ((h / l) * ((d_m * (m_m / d)) ** 2.0d0))) * (d / t_1)
    t_3 = (l * h) ** (-0.5d0)
    if (d <= (-530000000.0d0)) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else if (d <= (-6.7d-37)) then
        tmp = t_0
    else if (d <= (-1.5d-65)) then
        tmp = d / -t_1
    else if (d <= (-1.65d-193)) then
        tmp = t_0
    else if (d <= (-3.8d-208)) then
        tmp = d * -t_3
    else if (d <= (-1.75d-301)) then
        tmp = t_0
    else if (d <= 4.8d-141) then
        tmp = t_2
    else if (d <= 9d-87) then
        tmp = d * t_3
    else if (d <= 1.82d-31) then
        tmp = t_2
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * Math.sqrt((h * Math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double t_1 = Math.sqrt((l * h));
	double t_2 = (-0.125 * ((h / l) * Math.pow((D_m * (M_m / d)), 2.0))) * (d / t_1);
	double t_3 = Math.pow((l * h), -0.5);
	double tmp;
	if (d <= -530000000.0) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else if (d <= -6.7e-37) {
		tmp = t_0;
	} else if (d <= -1.5e-65) {
		tmp = d / -t_1;
	} else if (d <= -1.65e-193) {
		tmp = t_0;
	} else if (d <= -3.8e-208) {
		tmp = d * -t_3;
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else if (d <= 4.8e-141) {
		tmp = t_2;
	} else if (d <= 9e-87) {
		tmp = d * t_3;
	} else if (d <= 1.82e-31) {
		tmp = t_2;
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = (0.125 * math.sqrt((h * math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d))
	t_1 = math.sqrt((l * h))
	t_2 = (-0.125 * ((h / l) * math.pow((D_m * (M_m / d)), 2.0))) * (d / t_1)
	t_3 = math.pow((l * h), -0.5)
	tmp = 0
	if d <= -530000000.0:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	elif d <= -6.7e-37:
		tmp = t_0
	elif d <= -1.5e-65:
		tmp = d / -t_1
	elif d <= -1.65e-193:
		tmp = t_0
	elif d <= -3.8e-208:
		tmp = d * -t_3
	elif d <= -1.75e-301:
		tmp = t_0
	elif d <= 4.8e-141:
		tmp = t_2
	elif d <= 9e-87:
		tmp = d * t_3
	elif d <= 1.82e-31:
		tmp = t_2
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64(0.125 * sqrt(Float64(h * (l ^ -3.0)))) * Float64(Float64(D_m * M_m) * Float64(Float64(D_m * M_m) / d)))
	t_1 = sqrt(Float64(l * h))
	t_2 = Float64(Float64(-0.125 * Float64(Float64(h / l) * (Float64(D_m * Float64(M_m / d)) ^ 2.0))) * Float64(d / t_1))
	t_3 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (d <= -530000000.0)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	elseif (d <= -6.7e-37)
		tmp = t_0;
	elseif (d <= -1.5e-65)
		tmp = Float64(d / Float64(-t_1));
	elseif (d <= -1.65e-193)
		tmp = t_0;
	elseif (d <= -3.8e-208)
		tmp = Float64(d * Float64(-t_3));
	elseif (d <= -1.75e-301)
		tmp = t_0;
	elseif (d <= 4.8e-141)
		tmp = t_2;
	elseif (d <= 9e-87)
		tmp = Float64(d * t_3);
	elseif (d <= 1.82e-31)
		tmp = t_2;
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (0.125 * sqrt((h * (l ^ -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	t_1 = sqrt((l * h));
	t_2 = (-0.125 * ((h / l) * ((D_m * (M_m / d)) ^ 2.0))) * (d / t_1);
	t_3 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (d <= -530000000.0)
		tmp = d * -sqrt(((1.0 / h) / l));
	elseif (d <= -6.7e-37)
		tmp = t_0;
	elseif (d <= -1.5e-65)
		tmp = d / -t_1;
	elseif (d <= -1.65e-193)
		tmp = t_0;
	elseif (d <= -3.8e-208)
		tmp = d * -t_3;
	elseif (d <= -1.75e-301)
		tmp = t_0;
	elseif (d <= 4.8e-141)
		tmp = t_2;
	elseif (d <= 9e-87)
		tmp = d * t_3;
	elseif (d <= 1.82e-31)
		tmp = t_2;
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(0.125 * N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[d, -530000000.0], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -6.7e-37], t$95$0, If[LessEqual[d, -1.5e-65], N[(d / (-t$95$1)), $MachinePrecision], If[LessEqual[d, -1.65e-193], t$95$0, If[LessEqual[d, -3.8e-208], N[(d * (-t$95$3)), $MachinePrecision], If[LessEqual[d, -1.75e-301], t$95$0, If[LessEqual[d, 4.8e-141], t$95$2, If[LessEqual[d, 9e-87], N[(d * t$95$3), $MachinePrecision], If[LessEqual[d, 1.82e-31], t$95$2, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\
t_1 := \sqrt{\ell \cdot h}\\
t_2 := \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D\_m \cdot \frac{M\_m}{d}\right)}^{2}\right)\right) \cdot \frac{d}{t\_1}\\
t_3 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;d \leq -530000000:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{elif}\;d \leq -6.7 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -1.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{d}{-t\_1}\\

\mathbf{elif}\;d \leq -1.65 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -3.8 \cdot 10^{-208}:\\
\;\;\;\;d \cdot \left(-t\_3\right)\\

\mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq 4.8 \cdot 10^{-141}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;d \leq 9 \cdot 10^{-87}:\\
\;\;\;\;d \cdot t\_3\\

\mathbf{elif}\;d \leq 1.82 \cdot 10^{-31}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if d < -5.3e8

    1. Initial program 69.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. Simplified71.3%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*47.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/69.3%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*71.3%

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

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num69.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*66.2%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-166.2%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*66.6%

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

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

    if -5.3e8 < d < -6.70000000000000001e-37 or -1.49999999999999999e-65 < d < -1.6499999999999999e-193 or -3.80000000000000011e-208 < d < -1.74999999999999996e-301

    1. Initial program 57.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. Simplified57.4%

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative36.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*35.0%

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. unpow235.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. unpow235.0%

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*44.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified47.2%

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

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

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down54.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative54.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified54.9%

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

        \[\leadsto \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      2. *-un-lft-identity54.9%

        \[\leadsto \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\color{blue}{1 \cdot d}} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      3. times-frac54.9%

        \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
    17. Applied egg-rr54.9%

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

    if -6.70000000000000001e-37 < d < -1.49999999999999999e-65

    1. Initial program 74.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. Simplified74.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval2.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr2.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square2.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt2.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr2.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt2.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified2.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

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

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

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

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

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr75.6%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr75.6%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*75.7%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg75.7%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval75.7%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr75.6%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr75.7%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval75.7%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow70.0%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval70.0%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in70.0%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified75.9%

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

    if -1.6499999999999999e-193 < d < -3.80000000000000011e-208

    1. Initial program 0.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity0.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

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

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

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-150.2%

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

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval50.2%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr51.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square51.0%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt50.2%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr50.2%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt51.0%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified51.0%

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

    if -1.74999999999999996e-301 < d < 4.8000000000000002e-141 or 8.99999999999999915e-87 < d < 1.8199999999999999e-31

    1. Initial program 46.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified43.1%

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*28.3%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative44.9%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*43.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(-0.125 \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    12. Simplified61.0%

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

    if 4.8000000000000002e-141 < d < 8.99999999999999915e-87

    1. Initial program 50.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. Simplified41.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr67.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square67.1%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt66.9%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr66.9%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt67.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified67.1%

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

    if 1.8199999999999999e-31 < d

    1. Initial program 83.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. Simplified81.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval56.6%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr56.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square57.7%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt57.4%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr57.4%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt57.7%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified57.7%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt57.4%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod56.6%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up56.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval56.6%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow56.6%

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

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/56.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. sqrt-div69.4%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      9. inv-pow69.4%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      10. sqrt-pow169.5%

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

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    12. Applied egg-rr69.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -530000000:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -6.7 \cdot 10^{-37}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq -1.65 \cdot 10^{-193}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -3.8 \cdot 10^{-208}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq 4.8 \cdot 10^{-141}:\\ \;\;\;\;\left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-87}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;d \leq 1.82 \cdot 10^{-31}:\\ \;\;\;\;\left(-0.125 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.0% accurate, 1.3× speedup?

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

\mathbf{elif}\;h \leq -1.15 \cdot 10^{+33}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;h \leq -8 \cdot 10^{+20}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;h \leq -2.4 \cdot 10^{-56}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{elif}\;h \leq -3.3 \cdot 10^{-57}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-3}\right)}^{0.16666666666666666}\\

\mathbf{elif}\;h \leq -5.4 \cdot 10^{-301}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if h < -1.14999999999999997e63 or -1.15000000000000005e33 < h < -8e20

    1. Initial program 51.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. Simplified53.3%

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac22.6%

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*22.6%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative36.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*38.4%

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

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

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

        \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Applied egg-rr62.1%

      \[\leadsto \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
    9. Taylor expanded in d around -inf 49.7%

      \[\leadsto \color{blue}{0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    10. Step-by-step derivation
      1. *-commutative49.7%

        \[\leadsto \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot 0.125} \]
      2. associate-*l*49.7%

        \[\leadsto \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)} \]
      3. associate-/l*49.6%

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified49.6%

      \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)} \]
    12. Step-by-step derivation
      1. pow149.6%

        \[\leadsto \color{blue}{{\left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1}} \]
      2. associate-*r/49.7%

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down59.5%

        \[\leadsto {\left(\frac{\color{blue}{{\left(D \cdot M\right)}^{2}}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      4. div-inv59.5%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\color{blue}{h \cdot \frac{1}{{\ell}^{3}}}} \cdot 0.125\right)\right)}^{1} \]
      5. pow-flip59.6%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot \color{blue}{{\ell}^{\left(-3\right)}}} \cdot 0.125\right)\right)}^{1} \]
      6. metadata-eval59.6%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{\color{blue}{-3}}} \cdot 0.125\right)\right)}^{1} \]
    13. Applied egg-rr59.6%

      \[\leadsto \color{blue}{{\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow159.6%

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative59.6%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified59.6%

      \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    16. Step-by-step derivation
      1. unpow259.6%

        \[\leadsto \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      2. *-un-lft-identity59.6%

        \[\leadsto \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\color{blue}{1 \cdot d}} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      3. times-frac59.7%

        \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
    17. Applied egg-rr59.7%

      \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]

    if -1.14999999999999997e63 < h < -1.15000000000000005e33

    1. Initial program 64.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 l around -inf 0.0%

      \[\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. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutative0.0%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. associate-/r*0.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. *-commutative0.0%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      5. unpow20.0%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt62.2%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-162.2%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left(-d\right)} \]
    5. Simplified62.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(-d\right)} \]

    if -8e20 < h < -2.40000000000000001e-56

    1. Initial program 79.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified79.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 49.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative49.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*49.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell} \cdot 0.25\right)\right) \]
      3. times-frac56.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)} \cdot 0.25\right)\right) \]
      4. *-commutative56.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      5. associate-/l*49.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      6. unpow249.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      7. unpow249.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      8. unpow249.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      9. times-frac58.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      10. swap-sqr79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      11. unpow279.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      13. *-commutative79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    6. Simplified72.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)}\right) \]
    7. Taylor expanded in D around 0 79.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num79.6%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      2. sqrt-div79.4%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      3. metadata-eval79.4%

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    9. Applied egg-rr79.4%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    10. Taylor expanded in d around -inf 78.2%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*78.2%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-178.2%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*78.5%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    12. Simplified78.5%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]

    if -2.40000000000000001e-56 < h < -3.2999999999999998e-57

    1. Initial program 100.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf 2.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. log1p-expm1-u100.0%

        \[\leadsto d \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \]
      2. pow1/2100.0%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}}\right)\right) \]
      3. inv-pow100.0%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\color{blue}{\left({\left(h \cdot \ell\right)}^{-1}\right)}}^{0.5}\right)\right) \]
      4. pow-pow100.0%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(-1 \cdot 0.5\right)}}\right)\right) \]
      5. metadata-eval100.0%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}}\right)\right) \]
    5. Applied egg-rr100.0%

      \[\leadsto d \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)} \]
    6. Step-by-step derivation
      1. log1p-expm1-u2.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
      2. metadata-eval2.1%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      3. pow-pow2.1%

        \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      4. sqr-pow2.1%

        \[\leadsto d \cdot \color{blue}{\left({\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \cdot {\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}\right)} \]
      5. pow-prod-down100.0%

        \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-1.5} \cdot {\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      6. pow-prod-up100.0%

        \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{\left(-1.5 + -1.5\right)}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      7. metadata-eval100.0%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{\color{blue}{-3}}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      8. metadata-eval100.0%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{-3}\right)}^{\color{blue}{0.16666666666666666}} \]
    7. Applied egg-rr100.0%

      \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-3}\right)}^{0.16666666666666666}} \]

    if -3.2999999999999998e-57 < h < -5.3999999999999999e-301

    1. Initial program 65.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. Simplified65.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt65.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow265.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod65.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow165.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times65.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow165.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr65.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*65.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative65.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*65.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified65.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt57.4%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-157.4%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-157.4%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval57.4%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr57.4%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square58.3%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt58.1%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr58.1%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt58.3%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified58.3%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if -5.3999999999999999e-301 < h

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt61.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow261.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod61.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow161.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times65.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow161.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr61.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)\right)}}^{2}\right) \]
      2. associate-*r/61.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \color{blue}{\frac{0.5 \cdot D}{d}}\right)\right)}^{2}\right) \]
      3. associate-*r/65.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\frac{M \cdot \left(0.5 \cdot D\right)}{d}}\right)}^{2}\right) \]
    7. Simplified65.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}} \cdot \frac{M \cdot \left(0.5 \cdot D\right)}{d}\right)}^{2}}\right) \]
    8. Taylor expanded in M around 0 65.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0.5 \cdot \frac{D \cdot M}{d}\right)}\right)}^{2}\right) \]
    9. Step-by-step derivation
      1. associate-*r/65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(0.5 \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right)\right)}^{2}\right) \]
      2. *-commutative65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(\left(D \cdot \frac{M}{d}\right) \cdot 0.5\right)}\right)}^{2}\right) \]
      3. associate-*l*65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}\right)}^{2}\right) \]
      4. associate-*l/65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \color{blue}{\frac{M \cdot 0.5}{d}}\right)\right)}^{2}\right) \]
      5. *-commutative65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{\color{blue}{0.5 \cdot M}}{d}\right)\right)}^{2}\right) \]
    10. Simplified65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \frac{0.5 \cdot M}{d}\right)}\right)}^{2}\right) \]
    11. Step-by-step derivation
      1. pow165.0%

        \[\leadsto \color{blue}{{\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1}} \]
      2. sqrt-unprod56.8%

        \[\leadsto {\left(\color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      3. cancel-sign-sub-inv56.8%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-0.5\right) \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)}\right)}^{1} \]
      4. metadata-eval56.8%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{-0.5} \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      5. unpow-prod-down55.2%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left({\left(\sqrt{\frac{h}{\ell}}\right)}^{2} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)}\right)\right)}^{1} \]
      6. pow255.2%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{h}{\ell}}\right)} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      7. add-sqr-sqrt55.2%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\frac{h}{\ell}} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      8. associate-/l*55.2%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \color{blue}{\left(0.5 \cdot \frac{M}{d}\right)}\right)}^{2}\right)\right)\right)}^{1} \]
    12. Applied egg-rr55.2%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow155.2%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)} \]
      2. associate-*r*55.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}\right) \]
      3. associate-*r/55.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \color{blue}{\frac{0.5 \cdot M}{d}}\right)}^{2}\right) \]
    14. Simplified55.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times41.8%

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      2. add-exp-log40.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt16.2%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right)} \cdot \sqrt{\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      4. sqrt-unprod25.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg25.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\sqrt{\color{blue}{\left(-\log \left(h \cdot \ell\right)\right) \cdot \left(-\log \left(h \cdot \ell\right)\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      6. sqrt-unprod9.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt23.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt23.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/223.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod23.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/223.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod23.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times26.3%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\left(\frac{{\left(\sqrt[3]{d}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{d}}{\sqrt{h \cdot \ell}}\right)} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    17. Step-by-step derivation
      1. times-frac73.0%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{d}\right)}^{2} \cdot \sqrt[3]{d}}{1 \cdot \sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      2. unpow273.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{d} \cdot \sqrt[3]{d}\right)} \cdot \sqrt[3]{d}}{1 \cdot \sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. rem-3cbrt-lft73.5%

        \[\leadsto \frac{\color{blue}{d}}{1 \cdot \sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      4. *-lft-identity73.5%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    18. Simplified73.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
  3. Recombined 6 regimes into one program.
  4. Final simplification67.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.15 \cdot 10^{+63}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;h \leq -1.15 \cdot 10^{+33}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;h \leq -8 \cdot 10^{+20}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;h \leq -2.4 \cdot 10^{-56}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;h \leq -3.3 \cdot 10^{-57}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-3}\right)}^{0.16666666666666666}\\ \mathbf{elif}\;h \leq -5.4 \cdot 10^{-301}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.2% accurate, 1.3× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\ \mathbf{if}\;d \leq -2050000000000:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -1.02 \cdot 10^{-38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -1.12 \cdot 10^{-72}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -2.15 \cdot 10^{-207}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (*
          (* 0.125 (sqrt (* h (pow l -3.0))))
          (* (* D_m M_m) (/ (* D_m M_m) d)))))
   (if (<= d -2050000000000.0)
     (* d (- (sqrt (/ (/ 1.0 h) l))))
     (if (<= d -1.02e-38)
       t_0
       (if (<= d -1.12e-72)
         (/ d (- (sqrt (* l h))))
         (if (<= d -2.1e-193)
           t_0
           (if (<= d -2.15e-207)
             (* d (- (pow (* l h) -0.5)))
             (if (<= d -1.75e-301) t_0 (* d (/ (pow h -0.5) (sqrt l)))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * sqrt((h * pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double tmp;
	if (d <= -2050000000000.0) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else if (d <= -1.02e-38) {
		tmp = t_0;
	} else if (d <= -1.12e-72) {
		tmp = d / -sqrt((l * h));
	} else if (d <= -2.1e-193) {
		tmp = t_0;
	} else if (d <= -2.15e-207) {
		tmp = d * -pow((l * h), -0.5);
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (0.125d0 * sqrt((h * (l ** (-3.0d0))))) * ((d_m * m_m) * ((d_m * m_m) / d))
    if (d <= (-2050000000000.0d0)) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else if (d <= (-1.02d-38)) then
        tmp = t_0
    else if (d <= (-1.12d-72)) then
        tmp = d / -sqrt((l * h))
    else if (d <= (-2.1d-193)) then
        tmp = t_0
    else if (d <= (-2.15d-207)) then
        tmp = d * -((l * h) ** (-0.5d0))
    else if (d <= (-1.75d-301)) then
        tmp = t_0
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (0.125 * Math.sqrt((h * Math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	double tmp;
	if (d <= -2050000000000.0) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else if (d <= -1.02e-38) {
		tmp = t_0;
	} else if (d <= -1.12e-72) {
		tmp = d / -Math.sqrt((l * h));
	} else if (d <= -2.1e-193) {
		tmp = t_0;
	} else if (d <= -2.15e-207) {
		tmp = d * -Math.pow((l * h), -0.5);
	} else if (d <= -1.75e-301) {
		tmp = t_0;
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = (0.125 * math.sqrt((h * math.pow(l, -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d))
	tmp = 0
	if d <= -2050000000000.0:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	elif d <= -1.02e-38:
		tmp = t_0
	elif d <= -1.12e-72:
		tmp = d / -math.sqrt((l * h))
	elif d <= -2.1e-193:
		tmp = t_0
	elif d <= -2.15e-207:
		tmp = d * -math.pow((l * h), -0.5)
	elif d <= -1.75e-301:
		tmp = t_0
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64(0.125 * sqrt(Float64(h * (l ^ -3.0)))) * Float64(Float64(D_m * M_m) * Float64(Float64(D_m * M_m) / d)))
	tmp = 0.0
	if (d <= -2050000000000.0)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	elseif (d <= -1.02e-38)
		tmp = t_0;
	elseif (d <= -1.12e-72)
		tmp = Float64(d / Float64(-sqrt(Float64(l * h))));
	elseif (d <= -2.1e-193)
		tmp = t_0;
	elseif (d <= -2.15e-207)
		tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5)));
	elseif (d <= -1.75e-301)
		tmp = t_0;
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (0.125 * sqrt((h * (l ^ -3.0)))) * ((D_m * M_m) * ((D_m * M_m) / d));
	tmp = 0.0;
	if (d <= -2050000000000.0)
		tmp = d * -sqrt(((1.0 / h) / l));
	elseif (d <= -1.02e-38)
		tmp = t_0;
	elseif (d <= -1.12e-72)
		tmp = d / -sqrt((l * h));
	elseif (d <= -2.1e-193)
		tmp = t_0;
	elseif (d <= -2.15e-207)
		tmp = d * -((l * h) ^ -0.5);
	elseif (d <= -1.75e-301)
		tmp = t_0;
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(0.125 * N[Sqrt[N[(h * N[Power[l, -3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2050000000000.0], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.02e-38], t$95$0, If[LessEqual[d, -1.12e-72], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -2.1e-193], t$95$0, If[LessEqual[d, -2.15e-207], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[d, -1.75e-301], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{d}\right)\\
\mathbf{if}\;d \leq -2050000000000:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{elif}\;d \leq -1.02 \cdot 10^{-38}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -1.12 \cdot 10^{-72}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\

\mathbf{elif}\;d \leq -2.1 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq -2.15 \cdot 10^{-207}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\

\mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -2.05e12

    1. Initial program 69.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. Simplified71.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 47.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell} \cdot 0.25\right)\right) \]
      3. times-frac47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)} \cdot 0.25\right)\right) \]
      4. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      5. associate-/l*48.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      6. unpow248.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      7. unpow248.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      8. unpow248.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      9. times-frac61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      10. swap-sqr71.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      11. unpow271.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/69.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      13. *-commutative69.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*71.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    6. Simplified71.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)}\right) \]
    7. Taylor expanded in D around 0 69.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num69.3%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      2. sqrt-div69.7%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      3. metadata-eval69.7%

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    9. Applied egg-rr69.7%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    10. Taylor expanded in d around -inf 66.2%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*66.2%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-166.2%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*66.6%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    12. Simplified66.6%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]

    if -2.05e12 < d < -1.01999999999999998e-38 or -1.12000000000000005e-72 < d < -2.0999999999999999e-193 or -2.1500000000000001e-207 < d < -1.74999999999999996e-301

    1. Initial program 57.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. Simplified57.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around inf 36.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(-0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. associate-*r*36.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right) \]
      2. times-frac36.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)}\right)\right) \]
      3. *-commutative36.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      4. associate-/l*35.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow235.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. unpow235.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. unpow235.0%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. times-frac38.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      9. swap-sqr44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow244.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. associate-*r/44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. *-commutative44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. associate-/l*44.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
    6. Simplified44.6%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(-0.125 \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}\right) \]
    7. Step-by-step derivation
      1. frac-2neg57.4%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div73.8%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Applied egg-rr62.6%

      \[\leadsto \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
    9. Taylor expanded in d around -inf 48.8%

      \[\leadsto \color{blue}{0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    10. Step-by-step derivation
      1. *-commutative48.8%

        \[\leadsto \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot 0.125} \]
      2. associate-*l*48.8%

        \[\leadsto \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)} \]
      3. associate-/l*47.2%

        \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right) \]
    11. Simplified47.2%

      \[\leadsto \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)} \]
    12. Step-by-step derivation
      1. pow147.2%

        \[\leadsto \color{blue}{{\left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1}} \]
      2. associate-*r/48.8%

        \[\leadsto {\left(\color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      3. pow-prod-down54.9%

        \[\leadsto {\left(\frac{\color{blue}{{\left(D \cdot M\right)}^{2}}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125\right)\right)}^{1} \]
      4. div-inv54.9%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\color{blue}{h \cdot \frac{1}{{\ell}^{3}}}} \cdot 0.125\right)\right)}^{1} \]
      5. pow-flip54.9%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot \color{blue}{{\ell}^{\left(-3\right)}}} \cdot 0.125\right)\right)}^{1} \]
      6. metadata-eval54.9%

        \[\leadsto {\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{\color{blue}{-3}}} \cdot 0.125\right)\right)}^{1} \]
    13. Applied egg-rr54.9%

      \[\leadsto \color{blue}{{\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow154.9%

        \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{h \cdot {\ell}^{-3}} \cdot 0.125\right)} \]
      2. *-commutative54.9%

        \[\leadsto \frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \color{blue}{\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    15. Simplified54.9%

      \[\leadsto \color{blue}{\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right)} \]
    16. Step-by-step derivation
      1. unpow254.9%

        \[\leadsto \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      2. *-un-lft-identity54.9%

        \[\leadsto \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\color{blue}{1 \cdot d}} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
      3. times-frac54.9%

        \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]
    17. Applied egg-rr54.9%

      \[\leadsto \color{blue}{\left(\frac{D \cdot M}{1} \cdot \frac{D \cdot M}{d}\right)} \cdot \left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \]

    if -1.01999999999999998e-38 < d < -1.12000000000000005e-72

    1. Initial program 74.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. Simplified74.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt74.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow274.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod74.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow175.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow175.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr75.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified75.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 2.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-12.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval2.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr2.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square2.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt2.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr2.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt2.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified2.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt75.7%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-175.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr75.6%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr75.6%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval75.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*75.7%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg75.7%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval75.7%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr75.6%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr75.7%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval75.7%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow70.0%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval70.0%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in70.0%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified75.9%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if -2.0999999999999999e-193 < d < -2.1500000000000001e-207

    1. Initial program 0.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow20.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow10.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow10.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*0.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt50.2%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-150.2%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-150.2%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval50.2%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr51.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square51.0%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt50.2%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr50.2%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt51.0%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified51.0%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if -1.74999999999999996e-301 < d

    1. Initial program 63.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. Simplified60.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow161.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow161.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr61.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*61.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified64.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 39.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-139.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval39.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr39.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square40.1%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt39.9%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr39.9%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt40.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified40.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt39.9%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod39.5%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up39.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval39.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow39.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative39.5%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/39.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. sqrt-div45.3%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      9. inv-pow45.3%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      10. sqrt-pow145.4%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      11. metadata-eval45.4%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    12. Applied egg-rr45.4%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification53.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2050000000000:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;d \leq -1.02 \cdot 10^{-38}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -1.12 \cdot 10^{-72}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-193}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;d \leq -2.15 \cdot 10^{-207}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-301}:\\ \;\;\;\;\left(0.125 \cdot \sqrt{h \cdot {\ell}^{-3}}\right) \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 71.5% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D\_m \cdot \frac{0.5 \cdot M\_m}{d}\right)}^{2}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;t\_1 \cdot \left(-1 - t\_0\right)\\ \mathbf{elif}\;\ell \leq 9.2 \cdot 10^{-295}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+128}:\\ \;\;\;\;\left(1 + t\_0\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* (* (/ h l) -0.5) (pow (* D_m (/ (* 0.5 M_m) d)) 2.0)))
        (t_1 (/ d (sqrt (* l h)))))
   (if (<= l -4e-310)
     (* t_1 (- -1.0 t_0))
     (if (<= l 9.2e-295)
       (* d (- (pow (* l h) -0.5)))
       (if (<= l 3.4e+128)
         (* (+ 1.0 t_0) t_1)
         (* d (* (pow h -0.5) (sqrt (/ 1.0 l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = ((h / l) * -0.5) * pow((D_m * ((0.5 * M_m) / d)), 2.0);
	double t_1 = d / sqrt((l * h));
	double tmp;
	if (l <= -4e-310) {
		tmp = t_1 * (-1.0 - t_0);
	} else if (l <= 9.2e-295) {
		tmp = d * -pow((l * h), -0.5);
	} else if (l <= 3.4e+128) {
		tmp = (1.0 + t_0) * t_1;
	} else {
		tmp = d * (pow(h, -0.5) * sqrt((1.0 / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((h / l) * (-0.5d0)) * ((d_m * ((0.5d0 * m_m) / d)) ** 2.0d0)
    t_1 = d / sqrt((l * h))
    if (l <= (-4d-310)) then
        tmp = t_1 * ((-1.0d0) - t_0)
    else if (l <= 9.2d-295) then
        tmp = d * -((l * h) ** (-0.5d0))
    else if (l <= 3.4d+128) then
        tmp = (1.0d0 + t_0) * t_1
    else
        tmp = d * ((h ** (-0.5d0)) * sqrt((1.0d0 / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = ((h / l) * -0.5) * Math.pow((D_m * ((0.5 * M_m) / d)), 2.0);
	double t_1 = d / Math.sqrt((l * h));
	double tmp;
	if (l <= -4e-310) {
		tmp = t_1 * (-1.0 - t_0);
	} else if (l <= 9.2e-295) {
		tmp = d * -Math.pow((l * h), -0.5);
	} else if (l <= 3.4e+128) {
		tmp = (1.0 + t_0) * t_1;
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.sqrt((1.0 / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = ((h / l) * -0.5) * math.pow((D_m * ((0.5 * M_m) / d)), 2.0)
	t_1 = d / math.sqrt((l * h))
	tmp = 0
	if l <= -4e-310:
		tmp = t_1 * (-1.0 - t_0)
	elif l <= 9.2e-295:
		tmp = d * -math.pow((l * h), -0.5)
	elif l <= 3.4e+128:
		tmp = (1.0 + t_0) * t_1
	else:
		tmp = d * (math.pow(h, -0.5) * math.sqrt((1.0 / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64(Float64(h / l) * -0.5) * (Float64(D_m * Float64(Float64(0.5 * M_m) / d)) ^ 2.0))
	t_1 = Float64(d / sqrt(Float64(l * h)))
	tmp = 0.0
	if (l <= -4e-310)
		tmp = Float64(t_1 * Float64(-1.0 - t_0));
	elseif (l <= 9.2e-295)
		tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5)));
	elseif (l <= 3.4e+128)
		tmp = Float64(Float64(1.0 + t_0) * t_1);
	else
		tmp = Float64(d * Float64((h ^ -0.5) * sqrt(Float64(1.0 / l))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = ((h / l) * -0.5) * ((D_m * ((0.5 * M_m) / d)) ^ 2.0);
	t_1 = d / sqrt((l * h));
	tmp = 0.0;
	if (l <= -4e-310)
		tmp = t_1 * (-1.0 - t_0);
	elseif (l <= 9.2e-295)
		tmp = d * -((l * h) ^ -0.5);
	elseif (l <= 3.4e+128)
		tmp = (1.0 + t_0) * t_1;
	else
		tmp = d * ((h ^ -0.5) * sqrt((1.0 / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(D$95$m * N[(N[(0.5 * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e-310], N[(t$95$1 * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.2e-295], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 3.4e+128], N[(N[(1.0 + t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D\_m \cdot \frac{0.5 \cdot M\_m}{d}\right)}^{2}\\
t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(-1 - t\_0\right)\\

\mathbf{elif}\;\ell \leq 9.2 \cdot 10^{-295}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\

\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+128}:\\
\;\;\;\;\left(1 + t\_0\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -3.999999999999988e-310

    1. Initial program 62.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. Simplified62.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow262.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow162.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)\right)}}^{2}\right) \]
      2. associate-*r/62.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \color{blue}{\frac{0.5 \cdot D}{d}}\right)\right)}^{2}\right) \]
      3. associate-*r/62.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\frac{M \cdot \left(0.5 \cdot D\right)}{d}}\right)}^{2}\right) \]
    7. Simplified62.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}} \cdot \frac{M \cdot \left(0.5 \cdot D\right)}{d}\right)}^{2}}\right) \]
    8. Taylor expanded in M around 0 62.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0.5 \cdot \frac{D \cdot M}{d}\right)}\right)}^{2}\right) \]
    9. Step-by-step derivation
      1. associate-*r/62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(0.5 \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right)\right)}^{2}\right) \]
      2. *-commutative62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(\left(D \cdot \frac{M}{d}\right) \cdot 0.5\right)}\right)}^{2}\right) \]
      3. associate-*l*62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}\right)}^{2}\right) \]
      4. associate-*l/62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \color{blue}{\frac{M \cdot 0.5}{d}}\right)\right)}^{2}\right) \]
      5. *-commutative62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{\color{blue}{0.5 \cdot M}}{d}\right)\right)}^{2}\right) \]
    10. Simplified62.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \frac{0.5 \cdot M}{d}\right)}\right)}^{2}\right) \]
    11. Step-by-step derivation
      1. pow162.1%

        \[\leadsto \color{blue}{{\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1}} \]
      2. sqrt-unprod53.4%

        \[\leadsto {\left(\color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      3. cancel-sign-sub-inv53.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-0.5\right) \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)}\right)}^{1} \]
      4. metadata-eval53.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{-0.5} \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      5. unpow-prod-down53.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left({\left(\sqrt{\frac{h}{\ell}}\right)}^{2} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)}\right)\right)}^{1} \]
      6. pow253.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{h}{\ell}}\right)} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      7. add-sqr-sqrt53.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\frac{h}{\ell}} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      8. associate-/l*53.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \color{blue}{\left(0.5 \cdot \frac{M}{d}\right)}\right)}^{2}\right)\right)\right)}^{1} \]
    12. Applied egg-rr53.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow153.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)} \]
      2. associate-*r*53.4%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}\right) \]
      3. associate-*r/53.4%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \color{blue}{\frac{0.5 \cdot M}{d}}\right)}^{2}\right) \]
    14. Simplified53.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times41.6%

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      2. add-exp-log40.6%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt15.4%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right)} \cdot \sqrt{\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      4. sqrt-unprod25.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg25.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\sqrt{\color{blue}{\left(-\log \left(h \cdot \ell\right)\right) \cdot \left(-\log \left(h \cdot \ell\right)\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      6. sqrt-unprod10.3%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/222.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/222.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod22.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times23.8%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr73.4%

      \[\leadsto \color{blue}{\frac{d}{-\sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]

    if -3.999999999999988e-310 < l < 9.1999999999999999e-295

    1. Initial program 80.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. Simplified80.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt80.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow280.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod80.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow180.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow180.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr80.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*80.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified80.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt81.5%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-181.5%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-181.5%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval81.5%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr81.5%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square81.5%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt81.5%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr81.5%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt81.5%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified81.5%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if 9.1999999999999999e-295 < l < 3.3999999999999999e128

    1. Initial program 68.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. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow265.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow165.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow165.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr65.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)\right)}}^{2}\right) \]
      2. associate-*r/65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(M \cdot \color{blue}{\frac{0.5 \cdot D}{d}}\right)\right)}^{2}\right) \]
      3. associate-*r/69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\frac{M \cdot \left(0.5 \cdot D\right)}{d}}\right)}^{2}\right) \]
    7. Simplified69.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}} \cdot \frac{M \cdot \left(0.5 \cdot D\right)}{d}\right)}^{2}}\right) \]
    8. Taylor expanded in M around 0 69.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0.5 \cdot \frac{D \cdot M}{d}\right)}\right)}^{2}\right) \]
    9. Step-by-step derivation
      1. associate-*r/68.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(0.5 \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right)\right)}^{2}\right) \]
      2. *-commutative68.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(\left(D \cdot \frac{M}{d}\right) \cdot 0.5\right)}\right)}^{2}\right) \]
      3. associate-*l*68.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}\right)}^{2}\right) \]
      4. associate-*l/68.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \color{blue}{\frac{M \cdot 0.5}{d}}\right)\right)}^{2}\right) \]
      5. *-commutative68.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{\color{blue}{0.5 \cdot M}}{d}\right)\right)}^{2}\right) \]
    10. Simplified68.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(D \cdot \frac{0.5 \cdot M}{d}\right)}\right)}^{2}\right) \]
    11. Step-by-step derivation
      1. pow168.5%

        \[\leadsto \color{blue}{{\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1}} \]
      2. sqrt-unprod58.8%

        \[\leadsto {\left(\color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      3. cancel-sign-sub-inv58.8%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-0.5\right) \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)}\right)}^{1} \]
      4. metadata-eval58.8%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{-0.5} \cdot {\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot \frac{0.5 \cdot M}{d}\right)\right)}^{2}\right)\right)}^{1} \]
      5. unpow-prod-down57.6%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left({\left(\sqrt{\frac{h}{\ell}}\right)}^{2} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)}\right)\right)}^{1} \]
      6. pow257.6%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{h}{\ell}}\right)} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      7. add-sqr-sqrt57.6%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\color{blue}{\frac{h}{\ell}} \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\right)\right)}^{1} \]
      8. associate-/l*57.6%

        \[\leadsto {\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \color{blue}{\left(0.5 \cdot \frac{M}{d}\right)}\right)}^{2}\right)\right)\right)}^{1} \]
    12. Applied egg-rr57.6%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)\right)}^{1}} \]
    13. Step-by-step derivation
      1. unpow157.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}\right)\right)} \]
      2. associate-*r*57.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \color{blue}{\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}\right) \]
      3. associate-*r/57.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \color{blue}{\frac{0.5 \cdot M}{d}}\right)}^{2}\right) \]
    14. Simplified57.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)} \]
    15. Step-by-step derivation
      1. frac-times49.5%

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      2. add-exp-log48.3%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. add-sqr-sqrt14.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right)} \cdot \sqrt{\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      4. sqrt-unprod28.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{\log \left(h \cdot \ell\right) \cdot \log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      5. sqr-neg28.9%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\sqrt{\color{blue}{\left(-\log \left(h \cdot \ell\right)\right) \cdot \left(-\log \left(h \cdot \ell\right)\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      6. sqrt-unprod14.0%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{\sqrt{-\log \left(h \cdot \ell\right)} \cdot \sqrt{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      7. add-sqr-sqrt28.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      8. add-sqr-sqrt28.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{e^{-\log \left(h \cdot \ell\right)}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      9. unpow1/228.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      10. exp-prod28.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \sqrt{e^{-\log \left(h \cdot \ell\right)}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      11. unpow1/228.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{{\left(e^{-\log \left(h \cdot \ell\right)}\right)}^{0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      12. exp-prod28.7%

        \[\leadsto \sqrt{\frac{d \cdot d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5} \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      13. frac-times31.2%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \frac{d}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    16. Applied egg-rr84.7%

      \[\leadsto \color{blue}{\left(\frac{{\left(\sqrt[3]{d}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{d}}{\sqrt{h \cdot \ell}}\right)} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    17. Step-by-step derivation
      1. times-frac84.8%

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{d}\right)}^{2} \cdot \sqrt[3]{d}}{1 \cdot \sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      2. unpow284.8%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{d} \cdot \sqrt[3]{d}\right)} \cdot \sqrt[3]{d}}{1 \cdot \sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      3. rem-3cbrt-lft85.2%

        \[\leadsto \frac{\color{blue}{d}}{1 \cdot \sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
      4. *-lft-identity85.2%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]
    18. Simplified85.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \]

    if 3.3999999999999999e128 < l

    1. Initial program 49.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. Simplified46.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt46.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow246.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod46.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow149.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow149.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr49.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*49.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*52.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*52.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*52.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified52.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 38.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-138.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval38.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr38.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square38.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt38.1%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr38.1%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt38.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified38.2%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt38.1%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod38.2%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up38.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval38.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow38.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/38.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. pow1/238.7%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}} \]
      9. div-inv38.7%

        \[\leadsto d \cdot {\color{blue}{\left(\frac{1}{h} \cdot \frac{1}{\ell}\right)}}^{0.5} \]
      10. unpow-prod-down58.5%

        \[\leadsto d \cdot \color{blue}{\left({\left(\frac{1}{h}\right)}^{0.5} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right)} \]
      11. pow1/258.5%

        \[\leadsto d \cdot \left(\color{blue}{\sqrt{\frac{1}{h}}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      12. inv-pow58.5%

        \[\leadsto d \cdot \left(\sqrt{\color{blue}{{h}^{-1}}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      13. sqrt-pow158.6%

        \[\leadsto d \cdot \left(\color{blue}{{h}^{\left(\frac{-1}{2}\right)}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
      14. metadata-eval58.6%

        \[\leadsto d \cdot \left({h}^{\color{blue}{-0.5}} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right) \]
    12. Applied egg-rr58.6%

      \[\leadsto d \cdot \color{blue}{\left({h}^{-0.5} \cdot {\left(\frac{1}{\ell}\right)}^{0.5}\right)} \]
    13. Step-by-step derivation
      1. unpow1/258.6%

        \[\leadsto d \cdot \left({h}^{-0.5} \cdot \color{blue}{\sqrt{\frac{1}{\ell}}}\right) \]
    14. Simplified58.6%

      \[\leadsto d \cdot \color{blue}{\left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(-1 - \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 9.2 \cdot 10^{-295}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+128}:\\ \;\;\;\;\left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(D \cdot \frac{0.5 \cdot M}{d}\right)}^{2}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot \sqrt{\frac{1}{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 47.8% accurate, 1.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -1.95 \cdot 10^{-208}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -1.3 \cdot 10^{-300}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-3}\right)}^{0.16666666666666666}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= d -1.95e-208)
   (* (- d) (sqrt (/ (/ 1.0 l) h)))
   (if (<= d -1.3e-300)
     (* d (pow (pow (* l h) -3.0) 0.16666666666666666))
     (* d (/ (pow h -0.5) (sqrt l))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= -1.95e-208) {
		tmp = -d * sqrt(((1.0 / l) / h));
	} else if (d <= -1.3e-300) {
		tmp = d * pow(pow((l * h), -3.0), 0.16666666666666666);
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (d <= (-1.95d-208)) then
        tmp = -d * sqrt(((1.0d0 / l) / h))
    else if (d <= (-1.3d-300)) then
        tmp = d * (((l * h) ** (-3.0d0)) ** 0.16666666666666666d0)
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= -1.95e-208) {
		tmp = -d * Math.sqrt(((1.0 / l) / h));
	} else if (d <= -1.3e-300) {
		tmp = d * Math.pow(Math.pow((l * h), -3.0), 0.16666666666666666);
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if d <= -1.95e-208:
		tmp = -d * math.sqrt(((1.0 / l) / h))
	elif d <= -1.3e-300:
		tmp = d * math.pow(math.pow((l * h), -3.0), 0.16666666666666666)
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (d <= -1.95e-208)
		tmp = Float64(Float64(-d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (d <= -1.3e-300)
		tmp = Float64(d * ((Float64(l * h) ^ -3.0) ^ 0.16666666666666666));
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (d <= -1.95e-208)
		tmp = -d * sqrt(((1.0 / l) / h));
	elseif (d <= -1.3e-300)
		tmp = d * (((l * h) ^ -3.0) ^ 0.16666666666666666);
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -1.95e-208], N[((-d) * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.3e-300], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], -3.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.95 \cdot 10^{-208}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;d \leq -1.3 \cdot 10^{-300}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-3}\right)}^{0.16666666666666666}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -1.95000000000000002e-208

    1. Initial program 67.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 0.0%

      \[\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. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutative0.0%

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. associate-/r*0.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. *-commutative0.0%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      5. unpow20.0%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt49.8%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-149.8%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left(-d\right)} \]
    5. Simplified49.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(-d\right)} \]

    if -1.95000000000000002e-208 < d < -1.29999999999999998e-300

    1. Initial program 45.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf 13.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. log1p-expm1-u38.7%

        \[\leadsto d \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \]
      2. pow1/238.7%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}}\right)\right) \]
      3. inv-pow38.7%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\color{blue}{\left({\left(h \cdot \ell\right)}^{-1}\right)}}^{0.5}\right)\right) \]
      4. pow-pow38.7%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(-1 \cdot 0.5\right)}}\right)\right) \]
      5. metadata-eval38.7%

        \[\leadsto d \cdot \mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}}\right)\right) \]
    5. Applied egg-rr38.7%

      \[\leadsto d \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(h \cdot \ell\right)}^{-0.5}\right)\right)} \]
    6. Step-by-step derivation
      1. log1p-expm1-u13.4%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
      2. metadata-eval13.4%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      3. pow-pow27.8%

        \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{0.3333333333333333}} \]
      4. sqr-pow27.8%

        \[\leadsto d \cdot \color{blue}{\left({\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \cdot {\left({\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}\right)} \]
      5. pow-prod-down35.1%

        \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-1.5} \cdot {\left(h \cdot \ell\right)}^{-1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      6. pow-prod-up35.1%

        \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{\left(-1.5 + -1.5\right)}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      7. metadata-eval35.1%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{\color{blue}{-3}}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      8. metadata-eval35.1%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{-3}\right)}^{\color{blue}{0.16666666666666666}} \]
    7. Applied egg-rr35.1%

      \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-3}\right)}^{0.16666666666666666}} \]

    if -1.29999999999999998e-300 < d

    1. Initial program 62.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified59.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt59.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow259.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod59.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow160.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow160.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr60.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*60.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified63.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 39.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-139.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval39.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr39.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square39.8%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt39.6%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr39.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt39.8%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified39.8%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt39.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod39.2%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up39.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval39.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow39.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative39.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/39.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. sqrt-div45.0%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      9. inv-pow45.0%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      10. sqrt-pow145.0%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      11. metadata-eval45.0%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    12. Applied egg-rr45.0%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.95 \cdot 10^{-208}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -1.3 \cdot 10^{-300}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{-3}\right)}^{0.16666666666666666}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 47.1% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 8.7 \cdot 10^{-297}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= d 8.7e-297)
   (* d (- (sqrt (/ (/ 1.0 h) l))))
   (* d (/ (pow h -0.5) (sqrt l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= 8.7e-297) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (d <= 8.7d-297) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= 8.7e-297) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if d <= 8.7e-297:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (d <= 8.7e-297)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (d <= 8.7e-297)
		tmp = d * -sqrt(((1.0 / h) / l));
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, 8.7e-297], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8.7 \cdot 10^{-297}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 8.7e-297

    1. Initial program 61.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. Simplified62.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 43.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell} \cdot 0.25\right)\right) \]
      3. times-frac45.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)} \cdot 0.25\right)\right) \]
      4. *-commutative45.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      5. associate-/l*43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      6. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      7. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      8. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      9. times-frac52.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      10. swap-sqr62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      11. unpow262.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/61.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      13. *-commutative61.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    6. Simplified61.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)}\right) \]
    7. Taylor expanded in D around 0 61.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num60.6%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      2. sqrt-div60.8%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      3. metadata-eval60.8%

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    9. Applied egg-rr60.8%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    10. Taylor expanded in d around -inf 41.8%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*41.8%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-141.8%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*42.6%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    12. Simplified42.6%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]

    if 8.7e-297 < d

    1. Initial program 64.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. Simplified61.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow261.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified65.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 40.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-140.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval40.8%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr40.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square41.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt41.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr41.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt41.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified41.3%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt41.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      2. sqrt-unprod40.8%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up40.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval40.8%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow40.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative40.8%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      7. associate-/l/40.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
      8. sqrt-div46.8%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      9. inv-pow46.8%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      10. sqrt-pow146.9%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      11. metadata-eval46.9%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    12. Applied egg-rr46.9%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 8.7 \cdot 10^{-297}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 47.1% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 3.8 \cdot 10^{-297}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= d 3.8e-297)
   (* d (- (sqrt (/ (/ 1.0 h) l))))
   (/ d (* (sqrt h) (sqrt l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= 3.8e-297) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (d <= 3.8d-297) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else
        tmp = d / (sqrt(h) * sqrt(l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= 3.8e-297) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else {
		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if d <= 3.8e-297:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	else:
		tmp = d / (math.sqrt(h) * math.sqrt(l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (d <= 3.8e-297)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (d <= 3.8e-297)
		tmp = d * -sqrt(((1.0 / h) / l));
	else
		tmp = d / (sqrt(h) * sqrt(l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, 3.8e-297], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 3.8 \cdot 10^{-297}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 3.80000000000000005e-297

    1. Initial program 61.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. Simplified62.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 43.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell} \cdot 0.25\right)\right) \]
      3. times-frac45.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)} \cdot 0.25\right)\right) \]
      4. *-commutative45.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      5. associate-/l*43.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      6. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      7. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      8. unpow243.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      9. times-frac52.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      10. swap-sqr62.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      11. unpow262.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/61.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      13. *-commutative61.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    6. Simplified61.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)}\right) \]
    7. Taylor expanded in D around 0 61.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num60.6%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      2. sqrt-div60.8%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      3. metadata-eval60.8%

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    9. Applied egg-rr60.8%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    10. Taylor expanded in d around -inf 41.8%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*41.8%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-141.8%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*42.6%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    12. Simplified42.6%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]

    if 3.80000000000000005e-297 < d

    1. Initial program 64.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. Simplified61.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow261.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod61.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified65.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 40.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-140.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval40.8%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr40.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square41.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt41.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr41.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt41.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified41.3%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 40.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. unpow-140.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval40.8%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr40.8%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square41.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. metadata-eval41.3%

        \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      6. pow-sqr41.2%

        \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      7. fabs-sqr41.2%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      8. pow-sqr41.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      9. metadata-eval41.3%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      10. exp-to-pow39.5%

        \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      11. metadata-eval39.5%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      12. distribute-rgt-neg-in39.5%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      13. exp-neg39.5%

        \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      14. associate-*r/39.5%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      15. *-rgt-identity39.5%

        \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      16. exp-to-pow41.3%

        \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      17. unpow1/241.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    13. Simplified41.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    14. Step-by-step derivation
      1. *-commutative41.3%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prod46.8%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    15. Applied egg-rr46.8%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 3.8 \cdot 10^{-297}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.8% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;\ell \leq 9 \cdot 10^{-268}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{1}{\frac{t\_0}{d}}\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-t\_0}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+286}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (* l h))))
   (if (<= l 9e-268)
     (* d (- (pow (* l h) -0.5)))
     (if (<= l 1.1e-43)
       (/ 1.0 (/ t_0 d))
       (if (<= l 1.12e-43)
         (/ d (- t_0))
         (if (<= l 1.32e+286)
           (* d (sqrt (/ 1.0 (* l h))))
           (sqrt (* (/ d h) (/ d l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((l * h));
	double tmp;
	if (l <= 9e-268) {
		tmp = d * -pow((l * h), -0.5);
	} else if (l <= 1.1e-43) {
		tmp = 1.0 / (t_0 / d);
	} else if (l <= 1.12e-43) {
		tmp = d / -t_0;
	} else if (l <= 1.32e+286) {
		tmp = d * sqrt((1.0 / (l * h)));
	} else {
		tmp = sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((l * h))
    if (l <= 9d-268) then
        tmp = d * -((l * h) ** (-0.5d0))
    else if (l <= 1.1d-43) then
        tmp = 1.0d0 / (t_0 / d)
    else if (l <= 1.12d-43) then
        tmp = d / -t_0
    else if (l <= 1.32d+286) then
        tmp = d * sqrt((1.0d0 / (l * h)))
    else
        tmp = sqrt(((d / h) * (d / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((l * h));
	double tmp;
	if (l <= 9e-268) {
		tmp = d * -Math.pow((l * h), -0.5);
	} else if (l <= 1.1e-43) {
		tmp = 1.0 / (t_0 / d);
	} else if (l <= 1.12e-43) {
		tmp = d / -t_0;
	} else if (l <= 1.32e+286) {
		tmp = d * Math.sqrt((1.0 / (l * h)));
	} else {
		tmp = Math.sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((l * h))
	tmp = 0
	if l <= 9e-268:
		tmp = d * -math.pow((l * h), -0.5)
	elif l <= 1.1e-43:
		tmp = 1.0 / (t_0 / d)
	elif l <= 1.12e-43:
		tmp = d / -t_0
	elif l <= 1.32e+286:
		tmp = d * math.sqrt((1.0 / (l * h)))
	else:
		tmp = math.sqrt(((d / h) * (d / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(l * h))
	tmp = 0.0
	if (l <= 9e-268)
		tmp = Float64(d * Float64(-(Float64(l * h) ^ -0.5)));
	elseif (l <= 1.1e-43)
		tmp = Float64(1.0 / Float64(t_0 / d));
	elseif (l <= 1.12e-43)
		tmp = Float64(d / Float64(-t_0));
	elseif (l <= 1.32e+286)
		tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h))));
	else
		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((l * h));
	tmp = 0.0;
	if (l <= 9e-268)
		tmp = d * -((l * h) ^ -0.5);
	elseif (l <= 1.1e-43)
		tmp = 1.0 / (t_0 / d);
	elseif (l <= 1.12e-43)
		tmp = d / -t_0;
	elseif (l <= 1.32e+286)
		tmp = d * sqrt((1.0 / (l * h)));
	else
		tmp = sqrt(((d / h) * (d / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 9e-268], N[(d * (-N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 1.1e-43], N[(1.0 / N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.12e-43], N[(d / (-t$95$0)), $MachinePrecision], If[LessEqual[l, 1.32e+286], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq 9 \cdot 10^{-268}:\\
\;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\

\mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{1}{\frac{t\_0}{d}}\\

\mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\
\;\;\;\;\frac{d}{-t\_0}\\

\mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+286}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if l < 9.0000000000000003e-268

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified61.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt43.0%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-143.0%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-143.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval43.0%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr43.1%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square43.4%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt43.3%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr43.3%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt43.4%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified43.4%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if 9.0000000000000003e-268 < l < 1.09999999999999999e-43

    1. Initial program 64.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf 32.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. add-cbrt-cube30.3%

        \[\leadsto d \cdot \color{blue}{\sqrt[3]{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}}} \]
      2. pow1/329.1%

        \[\leadsto d \cdot \color{blue}{{\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}^{0.3333333333333333}} \]
      3. add-sqr-sqrt29.1%

        \[\leadsto d \cdot {\left(\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}^{0.3333333333333333} \]
      4. pow129.1%

        \[\leadsto d \cdot {\left(\color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{1}} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}^{0.3333333333333333} \]
      5. pow1/229.1%

        \[\leadsto d \cdot {\left({\left(\frac{1}{h \cdot \ell}\right)}^{1} \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}}\right)}^{0.3333333333333333} \]
      6. pow-prod-up29.1%

        \[\leadsto d \cdot {\color{blue}{\left({\left(\frac{1}{h \cdot \ell}\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \]
      7. associate-/r*29.1%

        \[\leadsto d \cdot {\left({\color{blue}{\left(\frac{\frac{1}{h}}{\ell}\right)}}^{\left(1 + 0.5\right)}\right)}^{0.3333333333333333} \]
      8. metadata-eval29.1%

        \[\leadsto d \cdot {\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} \]
    5. Applied egg-rr29.1%

      \[\leadsto d \cdot \color{blue}{{\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity29.1%

        \[\leadsto d \cdot {\color{blue}{\left(1 \cdot {\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}\right)}}^{0.3333333333333333} \]
    7. Applied egg-rr29.1%

      \[\leadsto d \cdot {\color{blue}{\left(1 \cdot {\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}\right)}}^{0.3333333333333333} \]
    8. Step-by-step derivation
      1. *-lft-identity29.1%

        \[\leadsto d \cdot {\color{blue}{\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}\right)}}^{0.3333333333333333} \]
      2. associate-/r*29.1%

        \[\leadsto d \cdot {\left({\color{blue}{\left(\frac{1}{h \cdot \ell}\right)}}^{1.5}\right)}^{0.3333333333333333} \]
      3. rem-exp-log29.3%

        \[\leadsto d \cdot {\left({\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{1.5}\right)}^{0.3333333333333333} \]
      4. exp-neg29.3%

        \[\leadsto d \cdot {\left({\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{1.5}\right)}^{0.3333333333333333} \]
      5. exp-prod29.2%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 1.5}\right)}}^{0.3333333333333333} \]
      6. distribute-lft-neg-out29.2%

        \[\leadsto d \cdot {\left(e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 1.5}}\right)}^{0.3333333333333333} \]
      7. distribute-rgt-neg-in29.2%

        \[\leadsto d \cdot {\left(e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-1.5\right)}}\right)}^{0.3333333333333333} \]
      8. exp-to-pow29.1%

        \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{\left(-1.5\right)}\right)}}^{0.3333333333333333} \]
      9. metadata-eval29.1%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{\color{blue}{-1.5}}\right)}^{0.3333333333333333} \]
    9. Simplified29.1%

      \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{-1.5}\right)}}^{0.3333333333333333} \]
    10. Step-by-step derivation
      1. pow-pow33.9%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(-1.5 \cdot 0.3333333333333333\right)}} \]
      2. metadata-eval33.9%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      3. metadata-eval33.9%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(-0.5\right)}} \]
      4. pow-flip33.8%

        \[\leadsto d \cdot \color{blue}{\frac{1}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      5. pow1/233.8%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. div-inv33.9%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      7. clear-num33.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}} \]
    11. Applied egg-rr33.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}} \]

    if 1.09999999999999999e-43 < l < 1.12e-43

    1. Initial program 100.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. Simplified100.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow2100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 0.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-10.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval0.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr0.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square0.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt0.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr0.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt0.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified0.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt100.0%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-1100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*100.0%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg100.0%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow100.0%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval100.0%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in100.0%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified100.0%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 1.12e-43 < l < 1.3199999999999999e286

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf 53.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]

    if 1.3199999999999999e286 < l

    1. Initial program 82.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. Simplified82.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 83.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow183.4%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)}^{1}} \]
      2. *-rgt-identity83.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right)}^{1} \]
      3. *-commutative83.4%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)}}^{1} \]
      4. pow1/283.4%

        \[\leadsto {\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{0.5}} \cdot \sqrt{\frac{d}{h}}\right)}^{1} \]
      5. pow1/283.4%

        \[\leadsto {\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)}^{1} \]
      6. pow-prod-down83.9%

        \[\leadsto {\color{blue}{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}}^{1} \]
    6. Applied egg-rr83.9%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow183.9%

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      2. unpow1/283.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      3. *-commutative83.9%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
    8. Simplified83.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification45.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 9 \cdot 10^{-268}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+286}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 42.8% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;\ell \leq 4.8 \cdot 10^{-265}:\\ \;\;\;\;d \cdot \left(-t\_0\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;d \cdot t\_0\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+281}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)))
   (if (<= l 4.8e-265)
     (* d (- t_0))
     (if (<= l 1.1e-43)
       (* d t_0)
       (if (<= l 1.12e-43)
         (/ d (- (sqrt (* l h))))
         (if (<= l 2.4e+281)
           (* d (sqrt (/ 1.0 (* l h))))
           (sqrt (* (/ d h) (/ d l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = pow((l * h), -0.5);
	double tmp;
	if (l <= 4.8e-265) {
		tmp = d * -t_0;
	} else if (l <= 1.1e-43) {
		tmp = d * t_0;
	} else if (l <= 1.12e-43) {
		tmp = d / -sqrt((l * h));
	} else if (l <= 2.4e+281) {
		tmp = d * sqrt((1.0 / (l * h)));
	} else {
		tmp = sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    if (l <= 4.8d-265) then
        tmp = d * -t_0
    else if (l <= 1.1d-43) then
        tmp = d * t_0
    else if (l <= 1.12d-43) then
        tmp = d / -sqrt((l * h))
    else if (l <= 2.4d+281) then
        tmp = d * sqrt((1.0d0 / (l * h)))
    else
        tmp = sqrt(((d / h) * (d / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.pow((l * h), -0.5);
	double tmp;
	if (l <= 4.8e-265) {
		tmp = d * -t_0;
	} else if (l <= 1.1e-43) {
		tmp = d * t_0;
	} else if (l <= 1.12e-43) {
		tmp = d / -Math.sqrt((l * h));
	} else if (l <= 2.4e+281) {
		tmp = d * Math.sqrt((1.0 / (l * h)));
	} else {
		tmp = Math.sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.pow((l * h), -0.5)
	tmp = 0
	if l <= 4.8e-265:
		tmp = d * -t_0
	elif l <= 1.1e-43:
		tmp = d * t_0
	elif l <= 1.12e-43:
		tmp = d / -math.sqrt((l * h))
	elif l <= 2.4e+281:
		tmp = d * math.sqrt((1.0 / (l * h)))
	else:
		tmp = math.sqrt(((d / h) * (d / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (l <= 4.8e-265)
		tmp = Float64(d * Float64(-t_0));
	elseif (l <= 1.1e-43)
		tmp = Float64(d * t_0);
	elseif (l <= 1.12e-43)
		tmp = Float64(d / Float64(-sqrt(Float64(l * h))));
	elseif (l <= 2.4e+281)
		tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h))));
	else
		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (l <= 4.8e-265)
		tmp = d * -t_0;
	elseif (l <= 1.1e-43)
		tmp = d * t_0;
	elseif (l <= 1.12e-43)
		tmp = d / -sqrt((l * h));
	elseif (l <= 2.4e+281)
		tmp = d * sqrt((1.0 / (l * h)));
	else
		tmp = sqrt(((d / h) * (d / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, 4.8e-265], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[l, 1.1e-43], N[(d * t$95$0), $MachinePrecision], If[LessEqual[l, 1.12e-43], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.4e+281], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq 4.8 \cdot 10^{-265}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\

\mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\
\;\;\;\;d \cdot t\_0\\

\mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\

\mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+281}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if l < 4.7999999999999999e-265

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified61.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt43.0%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-143.0%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-143.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval43.0%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr43.1%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square43.4%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt43.3%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr43.3%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt43.4%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified43.4%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if 4.7999999999999999e-265 < l < 1.09999999999999999e-43

    1. Initial program 64.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified62.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt62.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow262.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod62.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times66.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*66.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative66.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified64.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 32.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-132.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval32.4%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr32.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square33.9%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt33.8%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr33.8%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt33.9%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified33.9%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]

    if 1.09999999999999999e-43 < l < 1.12e-43

    1. Initial program 100.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. Simplified100.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow2100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 0.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-10.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval0.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr0.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square0.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt0.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr0.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt0.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified0.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt100.0%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-1100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*100.0%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg100.0%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow100.0%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval100.0%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in100.0%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified100.0%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 1.12e-43 < l < 2.4000000000000001e281

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf 53.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]

    if 2.4000000000000001e281 < l

    1. Initial program 82.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. Simplified82.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 83.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow183.4%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)}^{1}} \]
      2. *-rgt-identity83.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right)}^{1} \]
      3. *-commutative83.4%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)}}^{1} \]
      4. pow1/283.4%

        \[\leadsto {\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{0.5}} \cdot \sqrt{\frac{d}{h}}\right)}^{1} \]
      5. pow1/283.4%

        \[\leadsto {\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)}^{1} \]
      6. pow-prod-down83.9%

        \[\leadsto {\color{blue}{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}}^{1} \]
    6. Applied egg-rr83.9%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow183.9%

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      2. unpow1/283.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      3. *-commutative83.9%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
    8. Simplified83.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification45.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 4.8 \cdot 10^{-265}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+281}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 42.8% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ t_1 := d \cdot t\_0\\ \mathbf{if}\;\ell \leq 3 \cdot 10^{-268}:\\ \;\;\;\;d \cdot \left(-t\_0\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 1.82 \cdot 10^{+282}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)) (t_1 (* d t_0)))
   (if (<= l 3e-268)
     (* d (- t_0))
     (if (<= l 1.1e-43)
       t_1
       (if (<= l 1.12e-43)
         (/ d (- (sqrt (* l h))))
         (if (<= l 1.82e+282) t_1 (sqrt (* (/ d h) (/ d l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = pow((l * h), -0.5);
	double t_1 = d * t_0;
	double tmp;
	if (l <= 3e-268) {
		tmp = d * -t_0;
	} else if (l <= 1.1e-43) {
		tmp = t_1;
	} else if (l <= 1.12e-43) {
		tmp = d / -sqrt((l * h));
	} else if (l <= 1.82e+282) {
		tmp = t_1;
	} else {
		tmp = sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    t_1 = d * t_0
    if (l <= 3d-268) then
        tmp = d * -t_0
    else if (l <= 1.1d-43) then
        tmp = t_1
    else if (l <= 1.12d-43) then
        tmp = d / -sqrt((l * h))
    else if (l <= 1.82d+282) then
        tmp = t_1
    else
        tmp = sqrt(((d / h) * (d / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.pow((l * h), -0.5);
	double t_1 = d * t_0;
	double tmp;
	if (l <= 3e-268) {
		tmp = d * -t_0;
	} else if (l <= 1.1e-43) {
		tmp = t_1;
	} else if (l <= 1.12e-43) {
		tmp = d / -Math.sqrt((l * h));
	} else if (l <= 1.82e+282) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.pow((l * h), -0.5)
	t_1 = d * t_0
	tmp = 0
	if l <= 3e-268:
		tmp = d * -t_0
	elif l <= 1.1e-43:
		tmp = t_1
	elif l <= 1.12e-43:
		tmp = d / -math.sqrt((l * h))
	elif l <= 1.82e+282:
		tmp = t_1
	else:
		tmp = math.sqrt(((d / h) * (d / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(l * h) ^ -0.5
	t_1 = Float64(d * t_0)
	tmp = 0.0
	if (l <= 3e-268)
		tmp = Float64(d * Float64(-t_0));
	elseif (l <= 1.1e-43)
		tmp = t_1;
	elseif (l <= 1.12e-43)
		tmp = Float64(d / Float64(-sqrt(Float64(l * h))));
	elseif (l <= 1.82e+282)
		tmp = t_1;
	else
		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (l * h) ^ -0.5;
	t_1 = d * t_0;
	tmp = 0.0;
	if (l <= 3e-268)
		tmp = d * -t_0;
	elseif (l <= 1.1e-43)
		tmp = t_1;
	elseif (l <= 1.12e-43)
		tmp = d / -sqrt((l * h));
	elseif (l <= 1.82e+282)
		tmp = t_1;
	else
		tmp = sqrt(((d / h) * (d / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(d * t$95$0), $MachinePrecision]}, If[LessEqual[l, 3e-268], N[(d * (-t$95$0)), $MachinePrecision], If[LessEqual[l, 1.1e-43], t$95$1, If[LessEqual[l, 1.12e-43], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 1.82e+282], t$95$1, N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
t_1 := d \cdot t\_0\\
\mathbf{if}\;\ell \leq 3 \cdot 10^{-268}:\\
\;\;\;\;d \cdot \left(-t\_0\right)\\

\mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\

\mathbf{elif}\;\ell \leq 1.82 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 2.9999999999999997e-268

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified61.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt43.0%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. neg-mul-143.0%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow-143.0%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}\right) \]
      6. metadata-eval43.0%

        \[\leadsto d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}\right) \]
      7. pow-sqr43.1%

        \[\leadsto d \cdot \left(-\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      8. rem-sqrt-square43.4%

        \[\leadsto d \cdot \left(-\color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      9. rem-square-sqrt43.3%

        \[\leadsto d \cdot \left(-\left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      10. fabs-sqr43.3%

        \[\leadsto d \cdot \left(-\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      11. rem-square-sqrt43.4%

        \[\leadsto d \cdot \left(-\color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
    10. Simplified43.4%

      \[\leadsto \color{blue}{d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if 2.9999999999999997e-268 < l < 1.09999999999999999e-43 or 1.12e-43 < l < 1.82e282

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified58.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt58.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow258.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod58.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow159.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow159.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr59.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*63.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*63.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified63.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 44.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-144.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval44.6%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr44.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square45.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt45.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr45.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt45.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified45.2%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]

    if 1.09999999999999999e-43 < l < 1.12e-43

    1. Initial program 100.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. Simplified100.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow2100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow1100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*100.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified100.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 0.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-10.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval0.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr0.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square0.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt0.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr0.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt0.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified0.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt100.0%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-1100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval100.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*100.0%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg100.0%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr100.0%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval100.0%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow100.0%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval100.0%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in100.0%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified100.0%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 1.82e282 < l

    1. Initial program 82.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. Simplified82.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 83.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow183.4%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)}^{1}} \]
      2. *-rgt-identity83.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right)}^{1} \]
      3. *-commutative83.4%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)}}^{1} \]
      4. pow1/283.4%

        \[\leadsto {\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{0.5}} \cdot \sqrt{\frac{d}{h}}\right)}^{1} \]
      5. pow1/283.4%

        \[\leadsto {\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)}^{1} \]
      6. pow-prod-down83.9%

        \[\leadsto {\color{blue}{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}}^{1} \]
    6. Applied egg-rr83.9%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow183.9%

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      2. unpow1/283.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      3. *-commutative83.9%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
    8. Simplified83.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3 \cdot 10^{-268}:\\ \;\;\;\;d \cdot \left(-{\left(\ell \cdot h\right)}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 1.12 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 1.82 \cdot 10^{+282}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 42.6% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ t_1 := \frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{if}\;\ell \leq 8.5 \cdot 10^{-263}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\ell \leq 3.35 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\ell \leq 3.9 \cdot 10^{+284}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* d (pow (* l h) -0.5))) (t_1 (/ d (- (sqrt (* l h))))))
   (if (<= l 8.5e-263)
     t_1
     (if (<= l 3.35e-49)
       t_0
       (if (<= l 2.3e-43)
         t_1
         (if (<= l 3.9e+284) t_0 (sqrt (* (/ d h) (/ d l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = d * pow((l * h), -0.5);
	double t_1 = d / -sqrt((l * h));
	double tmp;
	if (l <= 8.5e-263) {
		tmp = t_1;
	} else if (l <= 3.35e-49) {
		tmp = t_0;
	} else if (l <= 2.3e-43) {
		tmp = t_1;
	} else if (l <= 3.9e+284) {
		tmp = t_0;
	} else {
		tmp = sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = d * ((l * h) ** (-0.5d0))
    t_1 = d / -sqrt((l * h))
    if (l <= 8.5d-263) then
        tmp = t_1
    else if (l <= 3.35d-49) then
        tmp = t_0
    else if (l <= 2.3d-43) then
        tmp = t_1
    else if (l <= 3.9d+284) then
        tmp = t_0
    else
        tmp = sqrt(((d / h) * (d / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = d * Math.pow((l * h), -0.5);
	double t_1 = d / -Math.sqrt((l * h));
	double tmp;
	if (l <= 8.5e-263) {
		tmp = t_1;
	} else if (l <= 3.35e-49) {
		tmp = t_0;
	} else if (l <= 2.3e-43) {
		tmp = t_1;
	} else if (l <= 3.9e+284) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = d * math.pow((l * h), -0.5)
	t_1 = d / -math.sqrt((l * h))
	tmp = 0
	if l <= 8.5e-263:
		tmp = t_1
	elif l <= 3.35e-49:
		tmp = t_0
	elif l <= 2.3e-43:
		tmp = t_1
	elif l <= 3.9e+284:
		tmp = t_0
	else:
		tmp = math.sqrt(((d / h) * (d / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(d * (Float64(l * h) ^ -0.5))
	t_1 = Float64(d / Float64(-sqrt(Float64(l * h))))
	tmp = 0.0
	if (l <= 8.5e-263)
		tmp = t_1;
	elseif (l <= 3.35e-49)
		tmp = t_0;
	elseif (l <= 2.3e-43)
		tmp = t_1;
	elseif (l <= 3.9e+284)
		tmp = t_0;
	else
		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = d * ((l * h) ^ -0.5);
	t_1 = d / -sqrt((l * h));
	tmp = 0.0;
	if (l <= 8.5e-263)
		tmp = t_1;
	elseif (l <= 3.35e-49)
		tmp = t_0;
	elseif (l <= 2.3e-43)
		tmp = t_1;
	elseif (l <= 3.9e+284)
		tmp = t_0;
	else
		tmp = sqrt(((d / h) * (d / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[l, 8.5e-263], t$95$1, If[LessEqual[l, 3.35e-49], t$95$0, If[LessEqual[l, 2.3e-43], t$95$1, If[LessEqual[l, 3.9e+284], t$95$0, N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\
t_1 := \frac{d}{-\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq 8.5 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\ell \leq 3.35 \cdot 10^{-49}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\ell \leq 3.9 \cdot 10^{+284}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 8.49999999999999975e-263 or 3.35e-49 < l < 2.2999999999999999e-43

    1. Initial program 62.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. Simplified63.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*62.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*62.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified62.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 8.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-18.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval8.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr8.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square8.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt8.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr8.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt8.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified8.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt43.4%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-143.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr43.5%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square43.8%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval43.8%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr43.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr43.7%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr43.8%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval43.8%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*43.8%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg43.8%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval43.8%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr43.7%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr43.8%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval43.8%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow41.8%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval41.8%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in41.8%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified43.7%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 8.49999999999999975e-263 < l < 3.35e-49 or 2.2999999999999999e-43 < l < 3.89999999999999976e284

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified58.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt58.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow258.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod58.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow159.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow159.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr59.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*59.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*63.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*63.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*63.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified63.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 44.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-144.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval44.6%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr44.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square45.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt45.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr45.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt45.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified45.2%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]

    if 3.89999999999999976e284 < l

    1. Initial program 82.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. Simplified82.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 83.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow183.4%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)}^{1}} \]
      2. *-rgt-identity83.4%

        \[\leadsto {\left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right)}^{1} \]
      3. *-commutative83.4%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)}}^{1} \]
      4. pow1/283.4%

        \[\leadsto {\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{0.5}} \cdot \sqrt{\frac{d}{h}}\right)}^{1} \]
      5. pow1/283.4%

        \[\leadsto {\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)}^{1} \]
      6. pow-prod-down83.9%

        \[\leadsto {\color{blue}{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}}^{1} \]
    6. Applied egg-rr83.9%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow183.9%

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      2. unpow1/283.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      3. *-commutative83.9%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
    8. Simplified83.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 8.5 \cdot 10^{-263}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 3.35 \cdot 10^{-49}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-43}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq 3.9 \cdot 10^{+284}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 43.0% accurate, 2.8× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.8 \cdot 10^{-264}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+266}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l 4.8e-264)
   (* d (- (sqrt (/ (/ 1.0 h) l))))
   (if (<= l 2.4e+266) (* d (pow (* l h) -0.5)) (sqrt (* (/ d h) (/ d l))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= 4.8e-264) {
		tmp = d * -sqrt(((1.0 / h) / l));
	} else if (l <= 2.4e+266) {
		tmp = d * pow((l * h), -0.5);
	} else {
		tmp = sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= 4.8d-264) then
        tmp = d * -sqrt(((1.0d0 / h) / l))
    else if (l <= 2.4d+266) then
        tmp = d * ((l * h) ** (-0.5d0))
    else
        tmp = sqrt(((d / h) * (d / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= 4.8e-264) {
		tmp = d * -Math.sqrt(((1.0 / h) / l));
	} else if (l <= 2.4e+266) {
		tmp = d * Math.pow((l * h), -0.5);
	} else {
		tmp = Math.sqrt(((d / h) * (d / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= 4.8e-264:
		tmp = d * -math.sqrt(((1.0 / h) / l))
	elif l <= 2.4e+266:
		tmp = d * math.pow((l * h), -0.5)
	else:
		tmp = math.sqrt(((d / h) * (d / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= 4.8e-264)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l))));
	elseif (l <= 2.4e+266)
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	else
		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= 4.8e-264)
		tmp = d * -sqrt(((1.0 / h) / l));
	elseif (l <= 2.4e+266)
		tmp = d * ((l * h) ^ -0.5);
	else
		tmp = sqrt(((d / h) * (d / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 4.8e-264], N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[l, 2.4e+266], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.8 \cdot 10^{-264}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\

\mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+266}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 4.7999999999999997e-264

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 42.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative42.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot 0.25\right)}\right) \]
      2. associate-*r*44.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell} \cdot 0.25\right)\right) \]
      3. times-frac45.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{h}{\ell}\right)} \cdot 0.25\right)\right) \]
      4. *-commutative45.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{{d}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      5. associate-/l*44.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left({M}^{2} \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      6. unpow244.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{{D}^{2}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      7. unpow244.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      8. unpow244.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      9. times-frac53.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      10. swap-sqr63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \frac{D}{d}\right)\right)} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      11. unpow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left(\color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      12. associate-*r/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{M \cdot D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      13. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{\color{blue}{D \cdot M}}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      14. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(D \cdot \frac{M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    6. Simplified62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)}\right) \]
    7. Taylor expanded in D around 0 62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\color{blue}{\left(\frac{D \cdot M}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    8. Step-by-step derivation
      1. clear-num61.6%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      2. sqrt-div61.7%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
      3. metadata-eval61.7%

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    9. Applied egg-rr61.7%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(\left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot 0.25\right)\right) \]
    10. Taylor expanded in d around -inf 43.0%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*43.0%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. neg-mul-143.0%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. associate-/r*43.8%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    12. Simplified43.8%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]

    if 4.7999999999999997e-264 < l < 2.40000000000000002e266

    1. Initial program 64.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified60.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow161.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times66.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow161.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr61.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*61.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*66.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative66.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*65.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*65.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*65.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified65.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 44.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-144.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval44.7%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr44.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square45.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt45.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr45.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt45.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified45.3%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]

    if 2.40000000000000002e266 < l

    1. Initial program 58.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. Simplified58.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in M around 0 59.2%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow159.2%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)}^{1}} \]
      2. *-rgt-identity59.2%

        \[\leadsto {\left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right)}^{1} \]
      3. *-commutative59.2%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)}}^{1} \]
      4. pow1/259.2%

        \[\leadsto {\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{0.5}} \cdot \sqrt{\frac{d}{h}}\right)}^{1} \]
      5. pow1/259.2%

        \[\leadsto {\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)}^{1} \]
      6. pow-prod-down59.6%

        \[\leadsto {\color{blue}{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}}^{1} \]
    6. Applied egg-rr59.6%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)}^{1}} \]
    7. Step-by-step derivation
      1. unpow159.6%

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      2. unpow1/259.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      3. *-commutative59.6%

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
    8. Simplified59.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 4.8 \cdot 10^{-264}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+266}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 43.1% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3.4 \cdot 10^{-264}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l 3.4e-264) (/ d (- (sqrt (* l h)))) (* d (pow (* l h) -0.5))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= 3.4e-264) {
		tmp = d / -sqrt((l * h));
	} else {
		tmp = d * pow((l * h), -0.5);
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= 3.4d-264) then
        tmp = d / -sqrt((l * h))
    else
        tmp = d * ((l * h) ** (-0.5d0))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= 3.4e-264) {
		tmp = d / -Math.sqrt((l * h));
	} else {
		tmp = d * Math.pow((l * h), -0.5);
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= 3.4e-264:
		tmp = d / -math.sqrt((l * h))
	else:
		tmp = d * math.pow((l * h), -0.5)
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= 3.4e-264)
		tmp = Float64(d / Float64(-sqrt(Float64(l * h))));
	else
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= 3.4e-264)
		tmp = d / -sqrt((l * h));
	else
		tmp = d * ((l * h) ^ -0.5);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 3.4e-264], N[(d / (-N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.4 \cdot 10^{-264}:\\
\;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 3.3999999999999999e-264

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified61.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 8.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-18.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval8.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr8.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square8.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt8.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr8.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt8.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified8.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt43.0%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-143.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval43.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr43.1%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr43.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr43.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*43.4%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg43.4%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval43.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr43.3%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr43.4%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval43.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow41.4%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval41.4%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in41.4%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified43.3%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 3.3999999999999999e-264 < l

    1. Initial program 63.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. Simplified60.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow161.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow161.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr61.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified64.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 42.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-142.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval42.9%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr42.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt43.3%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr43.3%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt43.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified43.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.4 \cdot 10^{-264}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 43.1% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;\ell \leq 3.15 \cdot 10^{-264}:\\ \;\;\;\;\frac{d}{-t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{t\_0}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (* l h)))) (if (<= l 3.15e-264) (/ d (- t_0)) (/ d t_0))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((l * h));
	double tmp;
	if (l <= 3.15e-264) {
		tmp = d / -t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((l * h))
    if (l <= 3.15d-264) then
        tmp = d / -t_0
    else
        tmp = d / t_0
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((l * h));
	double tmp;
	if (l <= 3.15e-264) {
		tmp = d / -t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((l * h))
	tmp = 0
	if l <= 3.15e-264:
		tmp = d / -t_0
	else:
		tmp = d / t_0
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(l * h))
	tmp = 0.0
	if (l <= 3.15e-264)
		tmp = Float64(d / Float64(-t_0));
	else
		tmp = Float64(d / t_0);
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((l * h));
	tmp = 0.0;
	if (l <= 3.15e-264)
		tmp = d / -t_0;
	else
		tmp = d / t_0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3.15e-264], N[(d / (-t$95$0)), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq 3.15 \cdot 10^{-264}:\\
\;\;\;\;\frac{d}{-t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 3.1499999999999999e-264

    1. Initial program 62.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow163.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*63.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*62.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*61.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified61.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 8.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-18.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval8.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr8.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square8.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt8.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr8.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt8.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified8.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow20.0%

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrt43.0%

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. unpow-143.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      5. metadata-eval43.0%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      6. pow-sqr43.1%

        \[\leadsto \left(-1 \cdot d\right) \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      7. rem-sqrt-square43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      8. metadata-eval43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      9. pow-sqr43.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      10. fabs-sqr43.3%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      11. pow-sqr43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      12. metadata-eval43.4%

        \[\leadsto \left(-1 \cdot d\right) \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      13. associate-*l*43.4%

        \[\leadsto \color{blue}{-1 \cdot \left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right)} \]
      14. mul-1-neg43.4%

        \[\leadsto \color{blue}{-d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
      15. metadata-eval43.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}} \]
      16. pow-sqr43.3%

        \[\leadsto -d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      17. pow-sqr43.4%

        \[\leadsto -d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      18. metadata-eval43.4%

        \[\leadsto -d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      19. exp-to-pow41.4%

        \[\leadsto -d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      20. metadata-eval41.4%

        \[\leadsto -d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      21. distribute-rgt-neg-in41.4%

        \[\leadsto -d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. Simplified43.3%

      \[\leadsto \color{blue}{-\frac{d}{\sqrt{h \cdot \ell}}} \]

    if 3.1499999999999999e-264 < l

    1. Initial program 63.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. Simplified60.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow161.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow161.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr61.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*61.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative65.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified64.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 42.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-142.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval42.9%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr42.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt43.3%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr43.3%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt43.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified43.5%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 42.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. unpow-142.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval42.9%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr42.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.5%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. metadata-eval43.5%

        \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      6. pow-sqr43.3%

        \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      7. fabs-sqr43.3%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      8. pow-sqr43.5%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      9. metadata-eval43.5%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      10. exp-to-pow41.6%

        \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      11. metadata-eval41.6%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      12. distribute-rgt-neg-in41.6%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      13. exp-neg41.6%

        \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      14. associate-*r/41.6%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      15. *-rgt-identity41.6%

        \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      16. exp-to-pow43.5%

        \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      17. unpow1/243.5%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    13. Simplified43.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.15 \cdot 10^{-264}:\\ \;\;\;\;\frac{d}{-\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 26.8% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;h \leq -1.85 \cdot 10^{+82}:\\ \;\;\;\;d \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{t\_0}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (* l h)))) (if (<= h -1.85e+82) (* d t_0) (/ d t_0))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((l * h));
	double tmp;
	if (h <= -1.85e+82) {
		tmp = d * t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((l * h))
    if (h <= (-1.85d+82)) then
        tmp = d * t_0
    else
        tmp = d / t_0
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((l * h));
	double tmp;
	if (h <= -1.85e+82) {
		tmp = d * t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((l * h))
	tmp = 0
	if h <= -1.85e+82:
		tmp = d * t_0
	else:
		tmp = d / t_0
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(l * h))
	tmp = 0.0
	if (h <= -1.85e+82)
		tmp = Float64(d * t_0);
	else
		tmp = Float64(d / t_0);
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((l * h));
	tmp = 0.0;
	if (h <= -1.85e+82)
		tmp = d * t_0;
	else
		tmp = d / t_0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1.85e+82], N[(d * t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;h \leq -1.85 \cdot 10^{+82}:\\
\;\;\;\;d \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -1.8500000000000001e82

    1. Initial program 46.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. Simplified48.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow248.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow148.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times46.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow148.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr48.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*46.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative46.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*48.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified48.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 5.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval5.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr5.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square5.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt5.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr5.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt5.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified5.2%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 5.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. unpow-15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval5.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr5.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square5.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. metadata-eval5.2%

        \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      6. pow-sqr5.2%

        \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      7. fabs-sqr5.2%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      8. pow-sqr5.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      9. metadata-eval5.2%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      10. exp-to-pow5.2%

        \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      11. metadata-eval5.2%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      12. distribute-rgt-neg-in5.2%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      13. exp-neg5.2%

        \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      14. associate-*r/5.2%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      15. *-rgt-identity5.2%

        \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      16. exp-to-pow5.2%

        \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      17. unpow1/25.2%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    13. Simplified5.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    14. Step-by-step derivation
      1. add-cbrt-cube5.1%

        \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{\left(\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}\right) \cdot \sqrt{h \cdot \ell}}}} \]
      2. pow1/35.1%

        \[\leadsto \frac{d}{\color{blue}{{\left(\left(\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}\right) \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}}} \]
      3. add-sqr-sqrt5.1%

        \[\leadsto \frac{d}{{\left(\color{blue}{\left(h \cdot \ell\right)} \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}} \]
      4. pow15.1%

        \[\leadsto \frac{d}{{\left(\color{blue}{{\left(h \cdot \ell\right)}^{1}} \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}} \]
      5. pow1/25.1%

        \[\leadsto \frac{d}{{\left({\left(h \cdot \ell\right)}^{1} \cdot \color{blue}{{\left(h \cdot \ell\right)}^{0.5}}\right)}^{0.3333333333333333}} \]
      6. pow-prod-up5.1%

        \[\leadsto \frac{d}{{\color{blue}{\left({\left(h \cdot \ell\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}} \]
      7. metadata-eval5.1%

        \[\leadsto \frac{d}{{\left({\left(h \cdot \ell\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}} \]
    15. Applied egg-rr5.1%

      \[\leadsto \frac{d}{\color{blue}{{\left({\left(h \cdot \ell\right)}^{1.5}\right)}^{0.3333333333333333}}} \]
    16. Step-by-step derivation
      1. unpow1/35.1%

        \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}} \]
    17. Simplified5.1%

      \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}} \]
    18. Step-by-step derivation
      1. clear-num5.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}{d}}} \]
      2. pow1/35.1%

        \[\leadsto \frac{1}{\frac{\color{blue}{{\left({\left(h \cdot \ell\right)}^{1.5}\right)}^{0.3333333333333333}}}{d}} \]
      3. pow-pow5.2%

        \[\leadsto \frac{1}{\frac{\color{blue}{{\left(h \cdot \ell\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}}{d}} \]
      4. metadata-eval5.2%

        \[\leadsto \frac{1}{\frac{{\left(h \cdot \ell\right)}^{\color{blue}{0.5}}}{d}} \]
      5. pow1/25.2%

        \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{h \cdot \ell}}}{d}} \]
      6. rem-log-exp15.9%

        \[\leadsto \frac{1}{\frac{\color{blue}{\log \left(e^{\sqrt{h \cdot \ell}}\right)}}{d}} \]
      7. associate-/r/15.9%

        \[\leadsto \color{blue}{\frac{1}{\log \left(e^{\sqrt{h \cdot \ell}}\right)} \cdot d} \]
    19. Applied egg-rr16.5%

      \[\leadsto \color{blue}{\sqrt{h \cdot \ell} \cdot d} \]

    if -1.8500000000000001e82 < h

    1. Initial program 66.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. Simplified64.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow264.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod64.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow165.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-/l*65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. pow165.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. *-un-lft-identity65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. times-frac65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. metadata-eval65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr65.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*65.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. associate-/l*67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. *-commutative67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. associate-/l*66.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. associate-*l*66.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      6. associate-/l*66.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified66.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 28.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-128.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval28.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr28.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square28.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt28.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr28.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt28.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified28.3%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 28.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. unpow-128.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval28.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr28.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square28.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. metadata-eval28.3%

        \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
      6. pow-sqr28.2%

        \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
      7. fabs-sqr28.2%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
      8. pow-sqr28.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
      9. metadata-eval28.3%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
      10. exp-to-pow27.3%

        \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
      11. metadata-eval27.3%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
      12. distribute-rgt-neg-in27.3%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      13. exp-neg27.3%

        \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      14. associate-*r/27.3%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
      15. *-rgt-identity27.3%

        \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      16. exp-to-pow28.3%

        \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
      17. unpow1/228.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    13. Simplified28.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.85 \cdot 10^{+82}:\\ \;\;\;\;d \cdot \sqrt{\ell \cdot h}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 4.1% accurate, 3.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ d \cdot \sqrt{\ell \cdot h} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m) :precision binary64 (* d (sqrt (* l h))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	return d * sqrt((l * h));
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    code = d * sqrt((l * h))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	return d * Math.sqrt((l * h));
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	return d * math.sqrt((l * h))
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	return Float64(d * sqrt(Float64(l * h)))
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp = code(d, h, l, M_m, D_m)
	tmp = d * sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d * N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
d \cdot \sqrt{\ell \cdot h}
\end{array}
Derivation
  1. Initial program 62.9%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Simplified61.8%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt61.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
    2. pow261.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
    3. sqrt-prod61.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
    4. sqrt-pow162.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. metadata-eval62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    6. frac-times63.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    7. associate-/l*62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    8. pow162.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    9. *-un-lft-identity62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    10. times-frac62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    11. metadata-eval62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
  5. Applied egg-rr62.2%

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
  6. Step-by-step derivation
    1. associate-*r*62.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    2. associate-/l*63.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    3. *-commutative63.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\frac{\color{blue}{D \cdot \left(M \cdot 0.5\right)}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    4. associate-/l*63.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M \cdot 0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. associate-*l*63.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    6. associate-/l*63.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
  7. Simplified63.0%

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
  8. Taylor expanded in d around inf 24.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  9. Step-by-step derivation
    1. unpow-124.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
    2. metadata-eval24.1%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr24.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square24.4%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. rem-square-sqrt24.3%

      \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
    6. fabs-sqr24.3%

      \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
    7. rem-square-sqrt24.4%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  10. Simplified24.4%

    \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  11. Taylor expanded in d around 0 24.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  12. Step-by-step derivation
    1. unpow-124.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
    2. metadata-eval24.1%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr24.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square24.4%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. metadata-eval24.4%

      \[\leadsto d \cdot \left|{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.25\right)}}\right| \]
    6. pow-sqr24.3%

      \[\leadsto d \cdot \left|\color{blue}{{\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}}\right| \]
    7. fabs-sqr24.3%

      \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.25} \cdot {\left(h \cdot \ell\right)}^{-0.25}\right)} \]
    8. pow-sqr24.4%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(2 \cdot -0.25\right)}} \]
    9. metadata-eval24.4%

      \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
    10. exp-to-pow23.5%

      \[\leadsto d \cdot \color{blue}{e^{\log \left(h \cdot \ell\right) \cdot -0.5}} \]
    11. metadata-eval23.5%

      \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{\left(-0.5\right)}} \]
    12. distribute-rgt-neg-in23.5%

      \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    13. exp-neg23.5%

      \[\leadsto d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
    14. associate-*r/23.5%

      \[\leadsto \color{blue}{\frac{d \cdot 1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \]
    15. *-rgt-identity23.5%

      \[\leadsto \frac{\color{blue}{d}}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}} \]
    16. exp-to-pow24.4%

      \[\leadsto \frac{d}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \]
    17. unpow1/224.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
  13. Simplified24.4%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  14. Step-by-step derivation
    1. add-cbrt-cube22.9%

      \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{\left(\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}\right) \cdot \sqrt{h \cdot \ell}}}} \]
    2. pow1/322.2%

      \[\leadsto \frac{d}{\color{blue}{{\left(\left(\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}\right) \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}}} \]
    3. add-sqr-sqrt22.2%

      \[\leadsto \frac{d}{{\left(\color{blue}{\left(h \cdot \ell\right)} \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}} \]
    4. pow122.2%

      \[\leadsto \frac{d}{{\left(\color{blue}{{\left(h \cdot \ell\right)}^{1}} \cdot \sqrt{h \cdot \ell}\right)}^{0.3333333333333333}} \]
    5. pow1/222.2%

      \[\leadsto \frac{d}{{\left({\left(h \cdot \ell\right)}^{1} \cdot \color{blue}{{\left(h \cdot \ell\right)}^{0.5}}\right)}^{0.3333333333333333}} \]
    6. pow-prod-up22.2%

      \[\leadsto \frac{d}{{\color{blue}{\left({\left(h \cdot \ell\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}} \]
    7. metadata-eval22.2%

      \[\leadsto \frac{d}{{\left({\left(h \cdot \ell\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}} \]
  15. Applied egg-rr22.2%

    \[\leadsto \frac{d}{\color{blue}{{\left({\left(h \cdot \ell\right)}^{1.5}\right)}^{0.3333333333333333}}} \]
  16. Step-by-step derivation
    1. unpow1/322.9%

      \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}} \]
  17. Simplified22.9%

    \[\leadsto \frac{d}{\color{blue}{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}} \]
  18. Step-by-step derivation
    1. clear-num22.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt[3]{{\left(h \cdot \ell\right)}^{1.5}}}{d}}} \]
    2. pow1/322.2%

      \[\leadsto \frac{1}{\frac{\color{blue}{{\left({\left(h \cdot \ell\right)}^{1.5}\right)}^{0.3333333333333333}}}{d}} \]
    3. pow-pow24.3%

      \[\leadsto \frac{1}{\frac{\color{blue}{{\left(h \cdot \ell\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}}{d}} \]
    4. metadata-eval24.3%

      \[\leadsto \frac{1}{\frac{{\left(h \cdot \ell\right)}^{\color{blue}{0.5}}}{d}} \]
    5. pow1/224.3%

      \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{h \cdot \ell}}}{d}} \]
    6. rem-log-exp18.4%

      \[\leadsto \frac{1}{\frac{\color{blue}{\log \left(e^{\sqrt{h \cdot \ell}}\right)}}{d}} \]
    7. associate-/r/18.4%

      \[\leadsto \color{blue}{\frac{1}{\log \left(e^{\sqrt{h \cdot \ell}}\right)} \cdot d} \]
  19. Applied egg-rr4.9%

    \[\leadsto \color{blue}{\sqrt{h \cdot \ell} \cdot d} \]
  20. Final simplification4.9%

    \[\leadsto d \cdot \sqrt{\ell \cdot h} \]
  21. Add Preprocessing

Reproduce

?
herbie shell --seed 2024105 
(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)))))