Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.8% → 77.2%
Time: 26.4s
Alternatives: 22
Speedup: 1.5×

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

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

Initial Program: 66.8% accurate, 1.0× speedup?

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

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

Alternative 1: 77.2% accurate, 0.8× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ t_1 := \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{if}\;d \leq -7.5 \cdot 10^{+225}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -2.85 \cdot 10^{+41}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 4 \cdot 10^{-309}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}\right)}{\ell}\right)\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (/
          (fma 0.125 (/ D (/ (* d l) (* M (* D (* h M))))) (- d))
          (sqrt (* h l))))
        (t_1
         (*
          (/ (sqrt (/ d h)) (sqrt (/ l d)))
          (- 1.0 (* h (/ 0.5 (/ l (pow (* M (/ (/ D d) 2.0)) 2.0))))))))
   (if (<= d -7.5e+225)
     t_1
     (if (<= d -2.85e+41)
       t_0
       (if (<= d -1.8e-109)
         t_1
         (if (<= d 4e-309)
           t_0
           (*
            (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))
            (- 1.0 (/ (* h (* 0.5 (pow (* (/ D d) (* 0.5 M)) 2.0))) l)))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = fma(0.125, (D / ((d * l) / (M * (D * (h * M))))), -d) / sqrt((h * l));
	double t_1 = (sqrt((d / h)) / sqrt((l / d))) * (1.0 - (h * (0.5 / (l / pow((M * ((D / d) / 2.0)), 2.0)))));
	double tmp;
	if (d <= -7.5e+225) {
		tmp = t_1;
	} else if (d <= -2.85e+41) {
		tmp = t_0;
	} else if (d <= -1.8e-109) {
		tmp = t_1;
	} else if (d <= 4e-309) {
		tmp = t_0;
	} else {
		tmp = ((sqrt(d) / sqrt(h)) * sqrt((d / l))) * (1.0 - ((h * (0.5 * pow(((D / d) * (0.5 * M)), 2.0))) / l));
	}
	return tmp;
}
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(fma(0.125, Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M))))), Float64(-d)) / sqrt(Float64(h * l)))
	t_1 = Float64(Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.5 / Float64(l / (Float64(M * Float64(Float64(D / d) / 2.0)) ^ 2.0))))))
	tmp = 0.0
	if (d <= -7.5e+225)
		tmp = t_1;
	elseif (d <= -2.85e+41)
		tmp = t_0;
	elseif (d <= -1.8e-109)
		tmp = t_1;
	elseif (d <= 4e-309)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0))) / l)));
	end
	return tmp
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-d)), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.5 / N[(l / N[Power[N[(M * N[(N[(D / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -7.5e+225], t$95$1, If[LessEqual[d, -2.85e+41], t$95$0, If[LessEqual[d, -1.8e-109], t$95$1, If[LessEqual[d, 4e-309], t$95$0, N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\
t_1 := \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\
\mathbf{if}\;d \leq -7.5 \cdot 10^{+225}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;d \leq -2.85 \cdot 10^{+41}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;d \leq 4 \cdot 10^{-309}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -7.49999999999999938e225 or -2.8500000000000001e41 < d < -1.8e-109

    1. Initial program 89.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. Step-by-step derivation
      1. metadata-eval89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999938e225 < d < -2.8500000000000001e41 or -1.8e-109 < d < 3.9999999999999977e-309

    1. Initial program 51.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. Step-by-step derivation
      1. metadata-eval51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*75.4%

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

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

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

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

    if 3.9999999999999977e-309 < d

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -7.5 \cdot 10^{+225}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{elif}\;d \leq -2.85 \cdot 10^{+41}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{elif}\;d \leq 4 \cdot 10^{-309}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}\right)}{\ell}\right)\\ \end{array} \]

Alternative 2: 75.6% accurate, 0.8× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \frac{t_1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{if}\;d \leq -2.2 \cdot 10^{+225}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq -1.25 \cdot 10^{+45}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-309}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}\right)}{\ell}\right) \cdot \left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (/
          (fma 0.125 (/ D (/ (* d l) (* M (* D (* h M))))) (- d))
          (sqrt (* h l))))
        (t_1 (sqrt (/ d h)))
        (t_2
         (*
          (/ t_1 (sqrt (/ l d)))
          (- 1.0 (* h (/ 0.5 (/ l (pow (* M (/ (/ D d) 2.0)) 2.0))))))))
   (if (<= d -2.2e+225)
     t_2
     (if (<= d -1.25e+45)
       t_0
       (if (<= d -1.8e-109)
         t_2
         (if (<= d 5e-309)
           t_0
           (*
            (- 1.0 (/ (* h (* 0.5 (pow (* (/ D d) (* 0.5 M)) 2.0))) l))
            (* t_1 (/ (sqrt d) (sqrt l))))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = fma(0.125, (D / ((d * l) / (M * (D * (h * M))))), -d) / sqrt((h * l));
	double t_1 = sqrt((d / h));
	double t_2 = (t_1 / sqrt((l / d))) * (1.0 - (h * (0.5 / (l / pow((M * ((D / d) / 2.0)), 2.0)))));
	double tmp;
	if (d <= -2.2e+225) {
		tmp = t_2;
	} else if (d <= -1.25e+45) {
		tmp = t_0;
	} else if (d <= -1.8e-109) {
		tmp = t_2;
	} else if (d <= 5e-309) {
		tmp = t_0;
	} else {
		tmp = (1.0 - ((h * (0.5 * pow(((D / d) * (0.5 * M)), 2.0))) / l)) * (t_1 * (sqrt(d) / sqrt(l)));
	}
	return tmp;
}
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(fma(0.125, Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M))))), Float64(-d)) / sqrt(Float64(h * l)))
	t_1 = sqrt(Float64(d / h))
	t_2 = Float64(Float64(t_1 / sqrt(Float64(l / d))) * Float64(1.0 - Float64(h * Float64(0.5 / Float64(l / (Float64(M * Float64(Float64(D / d) / 2.0)) ^ 2.0))))))
	tmp = 0.0
	if (d <= -2.2e+225)
		tmp = t_2;
	elseif (d <= -1.25e+45)
		tmp = t_0;
	elseif (d <= -1.8e-109)
		tmp = t_2;
	elseif (d <= 5e-309)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 - Float64(Float64(h * Float64(0.5 * (Float64(Float64(D / d) * Float64(0.5 * M)) ^ 2.0))) / l)) * Float64(t_1 * Float64(sqrt(d) / sqrt(l))));
	end
	return tmp
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-d)), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(0.5 / N[(l / N[Power[N[(M * N[(N[(D / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.2e+225], t$95$2, If[LessEqual[d, -1.25e+45], t$95$0, If[LessEqual[d, -1.8e-109], t$95$2, If[LessEqual[d, 5e-309], t$95$0, N[(N[(1.0 - N[(N[(h * N[(0.5 * N[Power[N[(N[(D / d), $MachinePrecision] * N[(0.5 * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \frac{t_1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\
\mathbf{if}\;d \leq -2.2 \cdot 10^{+225}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;d \leq -1.25 \cdot 10^{+45}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;d \leq 5 \cdot 10^{-309}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -2.20000000000000014e225 or -1.25e45 < d < -1.8e-109

    1. Initial program 89.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. Step-by-step derivation
      1. metadata-eval89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000014e225 < d < -1.25e45 or -1.8e-109 < d < 4.9999999999999995e-309

    1. Initial program 51.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. Step-by-step derivation
      1. metadata-eval51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*75.4%

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

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

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

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

    if 4.9999999999999995e-309 < d

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.2 \cdot 10^{+225}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{elif}\;d \leq -1.25 \cdot 10^{+45}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -1.8 \cdot 10^{-109}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{D}{d} \cdot \left(0.5 \cdot M\right)\right)}^{2}\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \]

Alternative 3: 73.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -9.99999999999999966e-275

    1. Initial program 66.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*76.8%

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

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

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

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

    if -9.99999999999999966e-275 < l < 1.80000000000000007e82

    1. Initial program 68.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. Step-by-step derivation
      1. metadata-eval68.8%

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

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

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

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

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

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

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

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

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

    if 1.80000000000000007e82 < l

    1. Initial program 53.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. Step-by-step derivation
      1. metadata-eval53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. associate-/r*39.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    8. Simplified39.6%

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}} \]
    10. Applied egg-rr62.2%

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

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

Alternative 4: 71.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 66.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*76.8%

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

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

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

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

    if -5.4000000000000003e-279 < l

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 72.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 66.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*76.8%

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

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

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

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

    if -6.6e-279 < l

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 70.6% accurate, 1.5× speedup?

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

\mathbf{elif}\;\ell \leq 5.3 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \frac{0.125}{\ell} \cdot \left(h \cdot {\left(\frac{M \cdot D}{d}\right)}^{2}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -3.4999999999999997e-278

    1. Initial program 66.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*76.8%

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

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

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

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

    if -3.4999999999999997e-278 < l < 5.3000000000000001e-6

    1. Initial program 66.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. Step-by-step derivation
      1. metadata-eval66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3000000000000001e-6 < l

    1. Initial program 60.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. Step-by-step derivation
      1. metadata-eval60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    7. Step-by-step derivation
      1. *-commutative45.5%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. associate-/r*46.9%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    8. Simplified46.9%

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}} \]
    10. Applied egg-rr64.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.5 \cdot 10^{-278}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 5.3 \cdot 10^{-6}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \frac{0.125}{\ell} \cdot \left(h \cdot {\left(\frac{M \cdot D}{d}\right)}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]

Alternative 7: 62.1% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-154}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\ \mathbf{elif}\;d \leq 3 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -2.6e-154)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d -4e-310)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (<= d 8.5e-162)
           (* -0.125 (/ (* (* D D) (* M M)) (/ d (sqrt (/ h (pow l 3.0))))))
           (if (<= d 3e+128)
             (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))
             (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -2.6e-154) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if (d <= 8.5e-162) {
		tmp = -0.125 * (((D * D) * (M * M)) / (d / sqrt((h / pow(l, 3.0)))));
	} else if (d <= 3e+128) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-2.6d-154)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if (d <= 8.5d-162) then
        tmp = (-0.125d0) * (((d_1 * d_1) * (m * m)) / (d / sqrt((h / (l ** 3.0d0)))))
    else if (d <= 3d+128) then
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    else
        tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -2.6e-154) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if (d <= 8.5e-162) {
		tmp = -0.125 * (((D * D) * (M * M)) / (d / Math.sqrt((h / Math.pow(l, 3.0)))));
	} else if (d <= 3e+128) {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -2.6e-154:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif d <= 8.5e-162:
		tmp = -0.125 * (((D * D) * (M * M)) / (d / math.sqrt((h / math.pow(l, 3.0)))))
	elif d <= 3e+128:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	else:
		tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -2.6e-154)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif (d <= 8.5e-162)
		tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(M * M)) / Float64(d / sqrt(Float64(h / (l ^ 3.0))))));
	elseif (d <= 3e+128)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	else
		tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -2.6e-154)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif (d <= 8.5e-162)
		tmp = -0.125 * (((D * D) * (M * M)) / (d / sqrt((h / (l ^ 3.0)))));
	elseif (d <= 3e+128)
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	else
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.6e-154], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e-162], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3e+128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -2.6 \cdot 10^{-154}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\

\mathbf{elif}\;d \leq 3 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1600000000000001e159 < d < -2.6e-154

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

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

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

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

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

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

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

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

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

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

    if -2.6e-154 < d < -3.999999999999988e-310

    1. Initial program 28.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. Step-by-step derivation
      1. metadata-eval28.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < d < 8.49999999999999955e-162

    1. Initial program 35.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. Step-by-step derivation
      1. metadata-eval35.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}} \]
      3. unpow233.7%

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

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

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

    if 8.49999999999999955e-162 < d < 2.9999999999999998e128

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9999999999999998e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

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

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
    8. Applied egg-rr73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-154}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\ \mathbf{elif}\;d \leq 3 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 8: 62.3% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -1.1 \cdot 10^{-152}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-167}:\\ \;\;\;\;-0.125 \cdot \frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\ \mathbf{elif}\;d \leq 2.2 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -1.1e-152)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d -4e-310)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (<= d 8.5e-167)
           (* -0.125 (/ (* D (* D (* M M))) (/ d (sqrt (/ h (pow l 3.0))))))
           (if (<= d 2.2e+128)
             (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))
             (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.1e-152) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if (d <= 8.5e-167) {
		tmp = -0.125 * ((D * (D * (M * M))) / (d / sqrt((h / pow(l, 3.0)))));
	} else if (d <= 2.2e+128) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-1.1d-152)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if (d <= 8.5d-167) then
        tmp = (-0.125d0) * ((d_1 * (d_1 * (m * m))) / (d / sqrt((h / (l ** 3.0d0)))))
    else if (d <= 2.2d+128) then
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    else
        tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.1e-152) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if (d <= 8.5e-167) {
		tmp = -0.125 * ((D * (D * (M * M))) / (d / Math.sqrt((h / Math.pow(l, 3.0)))));
	} else if (d <= 2.2e+128) {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -1.1e-152:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif d <= 8.5e-167:
		tmp = -0.125 * ((D * (D * (M * M))) / (d / math.sqrt((h / math.pow(l, 3.0)))))
	elif d <= 2.2e+128:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	else:
		tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -1.1e-152)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif (d <= 8.5e-167)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * M))) / Float64(d / sqrt(Float64(h / (l ^ 3.0))))));
	elseif (d <= 2.2e+128)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	else
		tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -1.1e-152)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif (d <= 8.5e-167)
		tmp = -0.125 * ((D * (D * (M * M))) / (d / sqrt((h / (l ^ 3.0)))));
	elseif (d <= 2.2e+128)
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	else
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.1e-152], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e-167], N[(-0.125 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.2e+128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -1.1 \cdot 10^{-152}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 8.5 \cdot 10^{-167}:\\
\;\;\;\;-0.125 \cdot \frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\

\mathbf{elif}\;d \leq 2.2 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1600000000000001e159 < d < -1.09999999999999992e-152

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

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

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

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

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

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

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

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

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

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

    if -1.09999999999999992e-152 < d < -3.999999999999988e-310

    1. Initial program 28.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. Step-by-step derivation
      1. metadata-eval28.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp14.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 36.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow136.2%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative36.2%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr36.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow136.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out36.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/47.5%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac47.5%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified47.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 39.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative39.7%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow239.7%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*41.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow241.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*41.1%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*51.5%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified58.6%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d < 8.4999999999999994e-167

    1. Initial program 35.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. Step-by-step derivation
      1. metadata-eval35.7%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/235.7%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval35.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/235.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative35.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*35.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac35.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval35.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified35.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def16.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p29.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp23.1%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/14.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*23.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff23.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div23.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp23.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp29.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified29.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Step-by-step derivation
      1. sqrt-div35.7%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Applied egg-rr35.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    9. Step-by-step derivation
      1. pow135.7%

        \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left({\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}}\right) \]
      2. associate-/r/35.7%

        \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - {\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}\right) \]
    10. Applied egg-rr35.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left({\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}}\right) \]
    11. Simplified35.9%

      \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}}\right) \]
    12. Taylor expanded in d around 0 33.6%

      \[\leadsto \color{blue}{-0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    13. Step-by-step derivation
      1. associate-*l/33.7%

        \[\leadsto -0.125 \cdot \color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{d}} \]
      2. associate-/l*33.7%

        \[\leadsto -0.125 \cdot \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}} \]
      3. *-commutative33.7%

        \[\leadsto -0.125 \cdot \frac{\color{blue}{{M}^{2} \cdot {D}^{2}}}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}} \]
      4. unpow233.7%

        \[\leadsto -0.125 \cdot \frac{{M}^{2} \cdot \color{blue}{\left(D \cdot D\right)}}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}} \]
      5. associate-*r*37.1%

        \[\leadsto -0.125 \cdot \frac{\color{blue}{\left({M}^{2} \cdot D\right) \cdot D}}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}} \]
      6. unpow237.1%

        \[\leadsto -0.125 \cdot \frac{\left(\color{blue}{\left(M \cdot M\right)} \cdot D\right) \cdot D}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}} \]
    14. Simplified37.1%

      \[\leadsto \color{blue}{-0.125 \cdot \frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}} \]

    if 8.4999999999999994e-167 < d < 2.20000000000000017e128

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac79.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval79.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr9.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def32.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.1%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp62.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/59.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*61.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff61.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div61.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp61.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp68.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified68.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 57.0%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative57.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac63.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow263.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow263.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac65.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*62.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow262.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified62.0%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if 2.20000000000000017e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. sqrt-div73.9%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
    8. Applied egg-rr73.9%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification64.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -1.1 \cdot 10^{-152}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-167}:\\ \;\;\;\;-0.125 \cdot \frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\frac{d}{\sqrt{\frac{h}{{\ell}^{3}}}}}\\ \mathbf{elif}\;d \leq 2.2 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 9: 62.8% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-155}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{-116}:\\ \;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\ \mathbf{elif}\;d \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -2.6e-155)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d -4e-310)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (<= d 7.2e-116)
           (* (sqrt (/ h (pow l 3.0))) (* -0.125 (/ (* D D) (/ (/ d M) M))))
           (if (<= d 1.2e+129)
             (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))
             (* d (/ (sqrt (/ 1.0 h)) (sqrt l))))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -2.6e-155) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if (d <= 7.2e-116) {
		tmp = sqrt((h / pow(l, 3.0))) * (-0.125 * ((D * D) / ((d / M) / M)));
	} else if (d <= 1.2e+129) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-2.6d-155)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if (d <= 7.2d-116) then
        tmp = sqrt((h / (l ** 3.0d0))) * ((-0.125d0) * ((d_1 * d_1) / ((d / m) / m)))
    else if (d <= 1.2d+129) then
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    else
        tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -2.6e-155) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if (d <= 7.2e-116) {
		tmp = Math.sqrt((h / Math.pow(l, 3.0))) * (-0.125 * ((D * D) / ((d / M) / M)));
	} else if (d <= 1.2e+129) {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -2.6e-155:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif d <= 7.2e-116:
		tmp = math.sqrt((h / math.pow(l, 3.0))) * (-0.125 * ((D * D) / ((d / M) / M)))
	elif d <= 1.2e+129:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	else:
		tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -2.6e-155)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif (d <= 7.2e-116)
		tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(d / M) / M))));
	elseif (d <= 1.2e+129)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	else
		tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -2.6e-155)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif (d <= 7.2e-116)
		tmp = sqrt((h / (l ^ 3.0))) * (-0.125 * ((D * D) / ((d / M) / M)));
	elseif (d <= 1.2e+129)
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	else
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.6e-155], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.2e-116], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.2e+129], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -2.6 \cdot 10^{-155}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 7.2 \cdot 10^{-116}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\

\mathbf{elif}\;d \leq 1.2 \cdot 10^{+129}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p64.0%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp64.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/53.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*64.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified64.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 76.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 43.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative38.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac41.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac58.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*55.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow255.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    10. Simplified62.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -1.1600000000000001e159 < d < -2.60000000000000008e-155

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr26.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def34.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p65.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 82.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}}\right) \]
      2. associate-*r*58.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot h\right) \cdot {M}^{2}}}{\ell \cdot {d}^{2}}\right) \]
      3. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot h\right) \cdot {M}^{2}}{\ell \cdot {d}^{2}}\right) \]
      4. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(M \cdot M\right)}}{\ell \cdot {d}^{2}}\right) \]
      5. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right) \]
    10. Simplified58.6%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
    12. Step-by-step derivation
      1. unpow261.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      2. associate-*r*70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      3. *-commutative70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      4. unpow270.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      5. associate-*r*76.0%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      6. associate-*r*80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \color{blue}{\left(\left(D \cdot \left(h \cdot M\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      7. *-commutative80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
    13. Simplified80.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(\left(D \cdot \left(M \cdot h\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]

    if -2.60000000000000008e-155 < d < -3.999999999999988e-310

    1. Initial program 28.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. Step-by-step derivation
      1. metadata-eval28.1%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/228.1%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/228.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified24.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr7.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def10.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p17.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp17.1%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/14.5%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*14.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp14.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 36.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow136.2%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative36.2%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr36.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow136.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out36.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/47.5%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac47.5%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified47.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 39.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative39.7%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow239.7%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*41.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow241.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*41.1%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*51.5%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified58.6%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d < 7.19999999999999951e-116

    1. Initial program 40.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. Step-by-step derivation
      1. metadata-eval40.8%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/240.8%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/240.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified40.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}}\right) \]
      2. frac-times40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}\right) \]
      3. *-commutative40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      4. metadata-eval40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. associate-*r/43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      6. metadata-eval43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}\right) \]
      7. *-commutative43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot 0.5\right)} \cdot h}{\ell}\right) \]
      8. frac-times43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      9. *-commutative43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      10. div-inv43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \color{blue}{\left(M \cdot \frac{1}{2}\right)}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      11. metadata-eval43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot \color{blue}{0.5}\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    5. Applied egg-rr43.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}}\right) \]
    6. Taylor expanded in d around 0 31.1%

      \[\leadsto \color{blue}{-0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*31.1%

        \[\leadsto \color{blue}{\left(-0.125 \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutative31.1%

        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
      3. associate-/l*30.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2}}}}\right) \]
      4. unpow230.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{{M}^{2}}}\right) \]
      5. unpow230.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
      6. associate-/r*39.1%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\color{blue}{\frac{\frac{d}{M}}{M}}}\right) \]
    8. Simplified39.1%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)} \]

    if 7.19999999999999951e-116 < d < 1.1999999999999999e129

    1. Initial program 80.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. Step-by-step derivation
      1. metadata-eval80.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/280.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/280.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified80.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp63.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/60.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*62.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 59.5%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative59.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac64.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac66.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*65.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow265.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified65.1%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if 1.1999999999999999e129 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. sqrt-div73.9%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
    8. Applied egg-rr73.9%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification65.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-155}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{-116}:\\ \;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\ \mathbf{elif}\;d \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 10: 66.6% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2 \cdot 10^{-113}:\\ \;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\ \mathbf{elif}\;d \leq 4.7 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -4e-310)
   (/ (fma 0.125 (/ D (/ (* d l) (* M (* D (* h M))))) (- d)) (sqrt (* h l)))
   (if (<= d 2e-113)
     (* (sqrt (/ h (pow l 3.0))) (* -0.125 (/ (* D D) (/ (/ d M) M))))
     (if (<= d 4.7e+128)
       (*
        (sqrt (/ (/ d h) (/ l d)))
        (- 1.0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))
       (* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -4e-310) {
		tmp = fma(0.125, (D / ((d * l) / (M * (D * (h * M))))), -d) / sqrt((h * l));
	} else if (d <= 2e-113) {
		tmp = sqrt((h / pow(l, 3.0))) * (-0.125 * ((D * D) / ((d / M) / M)));
	} else if (d <= 4.7e+128) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - (0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
	} else {
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	}
	return tmp;
}
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -4e-310)
		tmp = Float64(fma(0.125, Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M))))), Float64(-d)) / sqrt(Float64(h * l)));
	elseif (d <= 2e-113)
		tmp = Float64(sqrt(Float64(h / (l ^ 3.0))) * Float64(-0.125 * Float64(Float64(D * D) / Float64(Float64(d / M) / M))));
	elseif (d <= 4.7e+128)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))));
	else
		tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l)));
	end
	return tmp
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-d)), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2e-113], N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.7e+128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 2 \cdot 10^{-113}:\\
\;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\

\mathbf{elif}\;d \leq 4.7 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -3.999999999999988e-310

    1. Initial program 67.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. Step-by-step derivation
      1. metadata-eval67.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/267.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval67.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/267.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative67.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*67.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac65.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval65.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified65.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr27.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p54.8%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp49.8%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/43.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*49.3%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff49.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div49.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp49.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp54.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified54.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 70.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow170.9%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative70.9%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/70.9%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg70.9%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div71.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval71.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr71.0%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow171.0%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out71.0%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/71.0%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity71.0%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/73.4%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac73.4%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified73.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around 0 57.9%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell} + -1 \cdot d}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. fma-def57.9%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(0.125, \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}, -1 \cdot d\right)}}{\sqrt{h \cdot \ell}} \]
      2. unpow257.9%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      3. associate-*r*65.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      4. *-commutative65.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      5. unpow265.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      6. *-commutative65.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      7. associate-/l*65.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      8. *-commutative65.0%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      9. associate-*r*71.7%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      10. associate-*r*75.5%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      11. *-commutative75.5%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}, -1 \cdot d\right)}{\sqrt{h \cdot \ell}} \]
      12. neg-mul-175.5%

        \[\leadsto \frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}, \color{blue}{-d}\right)}{\sqrt{h \cdot \ell}} \]
    14. Simplified75.5%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}, -d\right)}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d < 1.99999999999999996e-113

    1. Initial program 40.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. Step-by-step derivation
      1. metadata-eval40.8%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/240.8%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/240.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified40.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*40.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}}\right) \]
      2. frac-times40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}\right) \]
      3. *-commutative40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      4. metadata-eval40.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. associate-*r/43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      6. metadata-eval43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}\right) \]
      7. *-commutative43.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot 0.5\right)} \cdot h}{\ell}\right) \]
      8. frac-times43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      9. *-commutative43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      10. div-inv43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \color{blue}{\left(M \cdot \frac{1}{2}\right)}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      11. metadata-eval43.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot \color{blue}{0.5}\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    5. Applied egg-rr43.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}}\right) \]
    6. Taylor expanded in d around 0 31.1%

      \[\leadsto \color{blue}{-0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*31.1%

        \[\leadsto \color{blue}{\left(-0.125 \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutative31.1%

        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
      3. associate-/l*30.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2}}}}\right) \]
      4. unpow230.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{{M}^{2}}}\right) \]
      5. unpow230.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
      6. associate-/r*39.1%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\color{blue}{\frac{\frac{d}{M}}{M}}}\right) \]
    8. Simplified39.1%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)} \]

    if 1.99999999999999996e-113 < d < 4.6999999999999998e128

    1. Initial program 80.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. Step-by-step derivation
      1. metadata-eval80.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/280.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/280.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified80.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp63.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/60.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*62.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 59.5%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative59.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac64.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac66.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*65.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow265.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified65.1%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if 4.6999999999999998e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. sqrt-div73.9%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
    8. Applied egg-rr73.9%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.125, \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}, -d\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2 \cdot 10^{-113}:\\ \;\;\;\;\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{M}}\right)\\ \mathbf{elif}\;d \leq 4.7 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 11: 60.3% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -1.05 \cdot 10^{-152}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{-114} \lor \neg \left(d \leq 9.5 \cdot 10^{+128}\right):\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -1.05e-152)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d -4e-310)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (or (<= d 2.5e-114) (not (<= d 9.5e+128)))
           (* d (/ (sqrt (/ 1.0 h)) (sqrt l)))
           (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.05e-152) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if ((d <= 2.5e-114) || !(d <= 9.5e+128)) {
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	} else {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-1.05d-152)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if ((d <= 2.5d-114) .or. (.not. (d <= 9.5d+128))) then
        tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
    else
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.05e-152) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if ((d <= 2.5e-114) || !(d <= 9.5e+128)) {
		tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
	} else {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -1.05e-152:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif (d <= 2.5e-114) or not (d <= 9.5e+128):
		tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l))
	else:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -1.05e-152)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif ((d <= 2.5e-114) || !(d <= 9.5e+128))
		tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l)));
	else
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -1.05e-152)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif ((d <= 2.5e-114) || ~((d <= 9.5e+128)))
		tmp = d * (sqrt((1.0 / h)) / sqrt(l));
	else
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.05e-152], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 2.5e-114], N[Not[LessEqual[d, 9.5e+128]], $MachinePrecision]], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -1.05 \cdot 10^{-152}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 2.5 \cdot 10^{-114} \lor \neg \left(d \leq 9.5 \cdot 10^{+128}\right):\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p64.0%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp64.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/53.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*64.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified64.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 76.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 43.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative38.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac41.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac58.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*55.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow255.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    10. Simplified62.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -1.1600000000000001e159 < d < -1.04999999999999999e-152

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr26.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def34.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p65.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 82.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}}\right) \]
      2. associate-*r*58.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot h\right) \cdot {M}^{2}}}{\ell \cdot {d}^{2}}\right) \]
      3. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot h\right) \cdot {M}^{2}}{\ell \cdot {d}^{2}}\right) \]
      4. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(M \cdot M\right)}}{\ell \cdot {d}^{2}}\right) \]
      5. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right) \]
    10. Simplified58.6%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
    12. Step-by-step derivation
      1. unpow261.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      2. associate-*r*70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      3. *-commutative70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      4. unpow270.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      5. associate-*r*76.0%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      6. associate-*r*80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \color{blue}{\left(\left(D \cdot \left(h \cdot M\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      7. *-commutative80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
    13. Simplified80.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(\left(D \cdot \left(M \cdot h\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]

    if -1.04999999999999999e-152 < d < -3.999999999999988e-310

    1. Initial program 28.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. Step-by-step derivation
      1. metadata-eval28.1%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/228.1%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/228.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified24.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr7.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def10.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p17.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp17.1%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/14.5%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*14.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp14.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 36.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow136.2%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative36.2%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr36.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow136.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out36.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/47.5%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac47.5%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified47.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 39.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative39.7%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow239.7%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*41.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow241.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*41.1%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*51.5%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified58.6%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d < 2.49999999999999995e-114 or 9.50000000000000014e128 < d

    1. Initial program 47.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. Step-by-step derivation
      1. metadata-eval47.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/247.9%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/247.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac47.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval47.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified47.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 43.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative43.4%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative43.4%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*43.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified43.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. sqrt-div50.5%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
    8. Applied egg-rr50.5%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]

    if 2.49999999999999995e-114 < d < 9.50000000000000014e128

    1. Initial program 80.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. Step-by-step derivation
      1. metadata-eval80.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/280.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/280.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified80.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp63.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/60.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*62.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 59.5%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative59.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac64.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac66.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*65.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow265.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified65.1%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -1.05 \cdot 10^{-152}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{-114} \lor \neg \left(d \leq 9.5 \cdot 10^{+128}\right):\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \end{array} \]

Alternative 12: 60.3% accurate, 1.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -1.9 \cdot 10^{-153}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 3 \cdot 10^{-113} \lor \neg \left(d \leq 2.9 \cdot 10^{+128}\right):\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -1.9e-153)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d -4e-310)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (or (<= d 3e-113) (not (<= d 2.9e+128)))
           (/ d (* (sqrt h) (sqrt l)))
           (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.9e-153) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if ((d <= 3e-113) || !(d <= 2.9e+128)) {
		tmp = d / (sqrt(h) * sqrt(l));
	} else {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-1.9d-153)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if ((d <= 3d-113) .or. (.not. (d <= 2.9d+128))) then
        tmp = d / (sqrt(h) * sqrt(l))
    else
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.9e-153) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if ((d <= 3e-113) || !(d <= 2.9e+128)) {
		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
	} else {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -1.9e-153:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif (d <= 3e-113) or not (d <= 2.9e+128):
		tmp = d / (math.sqrt(h) * math.sqrt(l))
	else:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -1.9e-153)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif ((d <= 3e-113) || !(d <= 2.9e+128))
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	else
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -1.9e-153)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif ((d <= 3e-113) || ~((d <= 2.9e+128)))
		tmp = d / (sqrt(h) * sqrt(l));
	else
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.9e-153], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 3e-113], N[Not[LessEqual[d, 2.9e+128]], $MachinePrecision]], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -1.9 \cdot 10^{-153}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 3 \cdot 10^{-113} \lor \neg \left(d \leq 2.9 \cdot 10^{+128}\right):\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p64.0%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp64.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/53.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*64.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified64.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 76.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 43.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative38.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac41.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac58.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*55.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow255.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    10. Simplified62.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -1.1600000000000001e159 < d < -1.90000000000000011e-153

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr26.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def34.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p65.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 82.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}}\right) \]
      2. associate-*r*58.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot h\right) \cdot {M}^{2}}}{\ell \cdot {d}^{2}}\right) \]
      3. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot h\right) \cdot {M}^{2}}{\ell \cdot {d}^{2}}\right) \]
      4. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(M \cdot M\right)}}{\ell \cdot {d}^{2}}\right) \]
      5. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right) \]
    10. Simplified58.6%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
    12. Step-by-step derivation
      1. unpow261.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      2. associate-*r*70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      3. *-commutative70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      4. unpow270.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      5. associate-*r*76.0%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      6. associate-*r*80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \color{blue}{\left(\left(D \cdot \left(h \cdot M\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      7. *-commutative80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
    13. Simplified80.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(\left(D \cdot \left(M \cdot h\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]

    if -1.90000000000000011e-153 < d < -3.999999999999988e-310

    1. Initial program 28.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. Step-by-step derivation
      1. metadata-eval28.1%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/228.1%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/228.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*28.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval24.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified24.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr7.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def10.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p17.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp17.1%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/14.5%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*14.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp14.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp14.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 36.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow136.2%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative36.2%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval36.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr36.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow136.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out36.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity36.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/47.5%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac47.5%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified47.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 39.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative39.7%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/39.7%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow239.7%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*41.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow241.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*41.1%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative41.1%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*51.5%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative58.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified58.6%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d < 3.0000000000000001e-113 or 2.9e128 < d

    1. Initial program 47.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. Step-by-step derivation
      1. metadata-eval47.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/247.9%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/247.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac47.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval47.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified47.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*47.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}}\right) \]
      2. frac-times47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}\right) \]
      3. *-commutative47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      4. metadata-eval47.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. associate-*r/52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      6. metadata-eval52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}\right) \]
      7. *-commutative52.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot 0.5\right)} \cdot h}{\ell}\right) \]
      8. frac-times52.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      9. *-commutative52.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      10. div-inv52.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \color{blue}{\left(M \cdot \frac{1}{2}\right)}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
      11. metadata-eval52.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot \color{blue}{0.5}\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    5. Applied egg-rr52.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}}\right) \]
    6. Taylor expanded in d around inf 43.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    7. Step-by-step derivation
      1. *-commutative43.4%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. associate-/r*43.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    8. Simplified43.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    9. Step-by-step derivation
      1. associate-/r*43.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \]
      2. add-cbrt-cube26.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}} \]
      3. pow126.7%

        \[\leadsto \color{blue}{{\left(d \cdot \sqrt{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}\right)}^{1}} \]
      4. add-cbrt-cube43.4%

        \[\leadsto {\left(d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}}\right)}^{1} \]
      5. sqrt-div43.4%

        \[\leadsto {\left(d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)}^{1} \]
      6. metadata-eval43.4%

        \[\leadsto {\left(d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)}^{1} \]
    10. Applied egg-rr43.4%

      \[\leadsto \color{blue}{{\left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)}^{1}} \]
    11. Step-by-step derivation
      1. unpow143.4%

        \[\leadsto \color{blue}{d \cdot \frac{1}{\sqrt{\ell \cdot h}}} \]
      2. associate-*r/43.3%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      3. *-rgt-identity43.3%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      4. *-commutative43.3%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    12. Simplified43.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    13. Step-by-step derivation
      1. sqrt-prod50.4%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    14. Applied egg-rr50.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]

    if 3.0000000000000001e-113 < d < 2.9e128

    1. Initial program 80.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. Step-by-step derivation
      1. metadata-eval80.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/280.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/280.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval80.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified80.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp63.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/60.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*62.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp62.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 59.5%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative59.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac64.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow264.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac66.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*65.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow265.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified65.1%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -1.9 \cdot 10^{-153}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 3 \cdot 10^{-113} \lor \neg \left(d \leq 2.9 \cdot 10^{+128}\right):\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \end{array} \]

Alternative 13: 58.0% accurate, 2.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\ t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq -1.46 \cdot 10^{-154}:\\ \;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq 3 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h)))))
        (t_1 (* M (* D (* h M))))
        (t_2 (* d (sqrt (/ 1.0 (* h l))))))
   (if (<= d -1.16e+159)
     (* t_2 (+ t_0 -1.0))
     (if (<= d -1.46e-154)
       (* t_2 (+ -1.0 (* 0.125 (/ (* D t_1) (* l (* d d))))))
       (if (<= d 3e-218)
         (/ (* 0.125 (/ D (/ (* d l) t_1))) (sqrt (* h l)))
         (if (<= d 6.2e+128)
           (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))
           (* d (sqrt (/ (/ 1.0 h) l)))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.46e-154) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= 3e-218) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	} else if (d <= 6.2e+128) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    t_1 = m * (d_1 * (h * m))
    t_2 = d * sqrt((1.0d0 / (h * l)))
    if (d <= (-1.16d+159)) then
        tmp = t_2 * (t_0 + (-1.0d0))
    else if (d <= (-1.46d-154)) then
        tmp = t_2 * ((-1.0d0) + (0.125d0 * ((d_1 * t_1) / (l * (d * d)))))
    else if (d <= 3d-218) then
        tmp = (0.125d0 * (d_1 / ((d * l) / t_1))) / sqrt((h * l))
    else if (d <= 6.2d+128) then
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double t_1 = M * (D * (h * M));
	double t_2 = d * Math.sqrt((1.0 / (h * l)));
	double tmp;
	if (d <= -1.16e+159) {
		tmp = t_2 * (t_0 + -1.0);
	} else if (d <= -1.46e-154) {
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	} else if (d <= 3e-218) {
		tmp = (0.125 * (D / ((d * l) / t_1))) / Math.sqrt((h * l));
	} else if (d <= 6.2e+128) {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	t_1 = M * (D * (h * M))
	t_2 = d * math.sqrt((1.0 / (h * l)))
	tmp = 0
	if d <= -1.16e+159:
		tmp = t_2 * (t_0 + -1.0)
	elif d <= -1.46e-154:
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))))
	elif d <= 3e-218:
		tmp = (0.125 * (D / ((d * l) / t_1))) / math.sqrt((h * l))
	elif d <= 6.2e+128:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	t_1 = Float64(M * Float64(D * Float64(h * M)))
	t_2 = Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
	tmp = 0.0
	if (d <= -1.16e+159)
		tmp = Float64(t_2 * Float64(t_0 + -1.0));
	elseif (d <= -1.46e-154)
		tmp = Float64(t_2 * Float64(-1.0 + Float64(0.125 * Float64(Float64(D * t_1) / Float64(l * Float64(d * d))))));
	elseif (d <= 3e-218)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / t_1))) / sqrt(Float64(h * l)));
	elseif (d <= 6.2e+128)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	t_1 = M * (D * (h * M));
	t_2 = d * sqrt((1.0 / (h * l)));
	tmp = 0.0;
	if (d <= -1.16e+159)
		tmp = t_2 * (t_0 + -1.0);
	elseif (d <= -1.46e-154)
		tmp = t_2 * (-1.0 + (0.125 * ((D * t_1) / (l * (d * d)))));
	elseif (d <= 3e-218)
		tmp = (0.125 * (D / ((d * l) / t_1))) / sqrt((h * l));
	elseif (d <= 6.2e+128)
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.16e+159], N[(t$95$2 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.46e-154], N[(t$95$2 * N[(-1.0 + N[(0.125 * N[(N[(D * t$95$1), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3e-218], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.2e+128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
t_1 := M \cdot \left(D \cdot \left(h \cdot M\right)\right)\\
t_2 := d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_2 \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq -1.46 \cdot 10^{-154}:\\
\;\;\;\;t_2 \cdot \left(-1 + 0.125 \cdot \frac{D \cdot t_1}{\ell \cdot \left(d \cdot d\right)}\right)\\

\mathbf{elif}\;d \leq 3 \cdot 10^{-218}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{t_1}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 6.2 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.1600000000000001e159

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p64.0%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp64.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/53.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*64.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp64.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified64.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 76.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 43.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative38.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac41.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow241.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac58.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*55.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow255.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    10. Simplified62.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -1.1600000000000001e159 < d < -1.46000000000000007e-154

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval79.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr26.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def34.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p65.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp55.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 82.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}}\right) \]
      2. associate-*r*58.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot h\right) \cdot {M}^{2}}}{\ell \cdot {d}^{2}}\right) \]
      3. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot h\right) \cdot {M}^{2}}{\ell \cdot {d}^{2}}\right) \]
      4. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(M \cdot M\right)}}{\ell \cdot {d}^{2}}\right) \]
      5. unpow258.6%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right) \]
    10. Simplified58.6%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}}\right) \]
    11. Taylor expanded in D around 0 61.5%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
    12. Step-by-step derivation
      1. unpow261.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      2. associate-*r*70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      3. *-commutative70.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      4. unpow270.5%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      5. associate-*r*76.0%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      6. associate-*r*80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \color{blue}{\left(\left(D \cdot \left(h \cdot M\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]
      7. *-commutative80.4%

        \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{D \cdot \left(\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
    13. Simplified80.4%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - 0.125 \cdot \frac{\color{blue}{D \cdot \left(\left(D \cdot \left(M \cdot h\right)\right) \cdot M\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \]

    if -1.46000000000000007e-154 < d < 2.9999999999999998e-218

    1. Initial program 31.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval31.2%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/231.2%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval31.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/231.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative31.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*31.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac29.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval29.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified29.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr10.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def13.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p21.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp17.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/12.9%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*16.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff16.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div16.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp16.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp20.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified20.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 26.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow126.0%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative26.0%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/26.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg26.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div26.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval26.0%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr26.0%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow126.0%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out26.0%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/26.0%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity26.0%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/32.2%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac32.2%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified32.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 28.2%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/28.2%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative28.2%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/28.2%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow228.2%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*29.0%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative29.0%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow229.0%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative29.0%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*29.0%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative29.0%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*34.8%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*38.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative38.6%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified38.6%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if 2.9999999999999998e-218 < d < 6.20000000000000008e128

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac74.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval74.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified74.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr8.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def29.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p66.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp59.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*58.3%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 53.4%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative53.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac58.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow258.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow258.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac61.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*59.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow259.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified59.2%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if 6.20000000000000008e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification61.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.16 \cdot 10^{+159}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq -1.46 \cdot 10^{-154}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(-1 + 0.125 \cdot \frac{D \cdot \left(M \cdot \left(D \cdot \left(h \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq 3 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 14: 51.5% accurate, 2.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{if}\;d \leq -8.8 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 2.7 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+128}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (sqrt (/ (/ d h) (/ l d)))
          (- 1.0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))))
   (if (<= d -8.8e-13)
     t_0
     (if (<= d 2.7e-218)
       (/ (* 0.125 (/ D (/ (* d l) (* M (* D (* h M)))))) (sqrt (* h l)))
       (if (<= d 2.5e+128) t_0 (* d (sqrt (/ (/ 1.0 h) l))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt(((d / h) / (l / d))) * (1.0 - (0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
	double tmp;
	if (d <= -8.8e-13) {
		tmp = t_0;
	} else if (d <= 2.7e-218) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / sqrt((h * l));
	} else if (d <= 2.5e+128) {
		tmp = t_0;
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((d / h) / (l / d))) * (1.0d0 - (0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))))
    if (d <= (-8.8d-13)) then
        tmp = t_0
    else if (d <= 2.7d-218) then
        tmp = (0.125d0 * (d_1 / ((d * l) / (m * (d_1 * (h * m)))))) / sqrt((h * l))
    else if (d <= 2.5d+128) then
        tmp = t_0
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt(((d / h) / (l / d))) * (1.0 - (0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
	double tmp;
	if (d <= -8.8e-13) {
		tmp = t_0;
	} else if (d <= 2.7e-218) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / Math.sqrt((h * l));
	} else if (d <= 2.5e+128) {
		tmp = t_0;
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = math.sqrt(((d / h) / (l / d))) * (1.0 - (0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))))
	tmp = 0
	if d <= -8.8e-13:
		tmp = t_0
	elif d <= 2.7e-218:
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / math.sqrt((h * l))
	elif d <= 2.5e+128:
		tmp = t_0
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))))
	tmp = 0.0
	if (d <= -8.8e-13)
		tmp = t_0;
	elseif (d <= 2.7e-218)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M)))))) / sqrt(Float64(h * l)));
	elseif (d <= 2.5e+128)
		tmp = t_0;
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt(((d / h) / (l / d))) * (1.0 - (0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))));
	tmp = 0.0;
	if (d <= -8.8e-13)
		tmp = t_0;
	elseif (d <= 2.7e-218)
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / sqrt((h * l));
	elseif (d <= 2.5e+128)
		tmp = t_0;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -8.8e-13], t$95$0, If[LessEqual[d, 2.7e-218], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e+128], t$95$0, N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\
\mathbf{if}\;d \leq -8.8 \cdot 10^{-13}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;d \leq 2.7 \cdot 10^{-218}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -8.79999999999999986e-13 or 2.7e-218 < d < 2.5e128

    1. Initial program 77.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. Step-by-step derivation
      1. metadata-eval77.1%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/277.1%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval77.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/277.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative77.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*77.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac76.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval76.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr26.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def39.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p68.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp63.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/56.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*62.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff62.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div62.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp62.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp68.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified68.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 49.7%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative49.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac53.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow253.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow253.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac59.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*57.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow257.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified57.4%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -8.79999999999999986e-13 < d < 2.7e-218

    1. Initial program 46.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. Step-by-step derivation
      1. metadata-eval46.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/246.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/246.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac45.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval45.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified45.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr8.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def14.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p31.8%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp24.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/21.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*23.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp31.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified31.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 44.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow144.5%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative44.5%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr44.5%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow144.5%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out44.5%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/44.5%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity44.5%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/48.4%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac48.4%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified48.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 36.0%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/36.0%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative36.0%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/36.0%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow236.0%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*39.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative39.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow239.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative39.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*39.2%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative39.2%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*45.2%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*47.7%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative47.7%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified47.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if 2.5e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.8 \cdot 10^{-13}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 2.7 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 15: 53.7% accurate, 2.5× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\ \mathbf{if}\;d \leq -3.4 \cdot 10^{-13}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(t_0 + -1\right)\\ \mathbf{elif}\;d \leq 3.3 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 6 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* 0.125 (* (* (/ D d) (/ D d)) (/ (* M M) (/ l h))))))
   (if (<= d -3.4e-13)
     (* (* d (sqrt (/ 1.0 (* h l)))) (+ t_0 -1.0))
     (if (<= d 3.3e-218)
       (/ (* 0.125 (/ D (/ (* d l) (* M (* D (* h M)))))) (sqrt (* h l)))
       (if (<= d 6e+128)
         (* (sqrt (/ (/ d h) (/ l d))) (- 1.0 t_0))
         (* d (sqrt (/ (/ 1.0 h) l))))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double tmp;
	if (d <= -3.4e-13) {
		tmp = (d * sqrt((1.0 / (h * l)))) * (t_0 + -1.0);
	} else if (d <= 3.3e-218) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / sqrt((h * l));
	} else if (d <= 6e+128) {
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.125d0 * (((d_1 / d) * (d_1 / d)) * ((m * m) / (l / h)))
    if (d <= (-3.4d-13)) then
        tmp = (d * sqrt((1.0d0 / (h * l)))) * (t_0 + (-1.0d0))
    else if (d <= 3.3d-218) then
        tmp = (0.125d0 * (d_1 / ((d * l) / (m * (d_1 * (h * m)))))) / sqrt((h * l))
    else if (d <= 6d+128) then
        tmp = sqrt(((d / h) / (l / d))) * (1.0d0 - t_0)
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	double tmp;
	if (d <= -3.4e-13) {
		tmp = (d * Math.sqrt((1.0 / (h * l)))) * (t_0 + -1.0);
	} else if (d <= 3.3e-218) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / Math.sqrt((h * l));
	} else if (d <= 6e+128) {
		tmp = Math.sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)))
	tmp = 0
	if d <= -3.4e-13:
		tmp = (d * math.sqrt((1.0 / (h * l)))) * (t_0 + -1.0)
	elif d <= 3.3e-218:
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / math.sqrt((h * l))
	elif d <= 6e+128:
		tmp = math.sqrt(((d / h) / (l / d))) * (1.0 - t_0)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = Float64(0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M * M) / Float64(l / h))))
	tmp = 0.0
	if (d <= -3.4e-13)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(t_0 + -1.0));
	elseif (d <= 3.3e-218)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M)))))) / sqrt(Float64(h * l)));
	elseif (d <= 6e+128)
		tmp = Float64(sqrt(Float64(Float64(d / h) / Float64(l / d))) * Float64(1.0 - t_0));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = 0.125 * (((D / d) * (D / d)) * ((M * M) / (l / h)));
	tmp = 0.0;
	if (d <= -3.4e-13)
		tmp = (d * sqrt((1.0 / (h * l)))) * (t_0 + -1.0);
	elseif (d <= 3.3e-218)
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / sqrt((h * l));
	elseif (d <= 6e+128)
		tmp = sqrt(((d / h) / (l / d))) * (1.0 - t_0);
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.4e-13], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.3e-218], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6e+128], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\\
\mathbf{if}\;d \leq -3.4 \cdot 10^{-13}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(t_0 + -1\right)\\

\mathbf{elif}\;d \leq 3.3 \cdot 10^{-218}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 6 \cdot 10^{+128}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - t_0\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -3.40000000000000015e-13

    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. Step-by-step derivation
      1. metadata-eval79.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/279.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/279.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*79.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac78.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval78.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified78.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p70.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp66.9%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/56.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*67.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff67.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div67.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp67.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp70.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified70.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 81.6%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Taylor expanded in M around 0 51.0%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    9. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac47.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow247.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow247.5%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac57.1%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*55.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow255.7%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    10. Simplified63.0%

      \[\leadsto \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if -3.40000000000000015e-13 < d < 3.30000000000000023e-218

    1. Initial program 46.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. Step-by-step derivation
      1. metadata-eval46.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/246.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/246.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*46.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac45.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval45.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified45.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr8.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def14.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p31.8%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp24.6%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/21.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*23.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp23.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp31.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified31.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 44.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow144.5%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative44.5%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval44.5%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr44.5%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow144.5%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out44.5%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/44.5%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity44.5%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/48.4%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac48.4%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified48.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 36.0%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/36.0%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative36.0%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/36.0%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow236.0%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*39.1%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative39.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow239.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative39.1%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*39.2%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative39.2%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*45.2%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*47.7%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative47.7%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified47.7%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if 3.30000000000000023e-218 < d < 5.9999999999999997e128

    1. Initial program 74.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. Step-by-step derivation
      1. metadata-eval74.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/274.5%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/274.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*74.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac74.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval74.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified74.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr8.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def29.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p66.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp59.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/55.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*58.3%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp58.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp65.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified65.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0 53.4%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}}\right) \]
    8. Step-by-step derivation
      1. *-commutative53.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right) \]
      2. times-frac58.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right) \]
      3. unpow258.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      4. unpow258.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      5. times-frac61.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right) \]
      6. associate-/l*59.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}}\right)\right) \]
      7. unpow259.2%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}}\right)\right) \]
    9. Simplified59.2%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)}\right) \]

    if 5.9999999999999997e128 < d

    1. Initial program 56.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. Step-by-step derivation
      1. metadata-eval56.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/256.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/256.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval56.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified56.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 61.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative61.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative61.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*62.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified62.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.4 \cdot 10^{-13}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right) + -1\right)\\ \mathbf{elif}\;d \leq 3.3 \cdot 10^{-218}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 6 \cdot 10^{+128}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 16: 47.5% accurate, 2.7× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{h \cdot \ell}\\ \mathbf{if}\;d \leq -4100:\\ \;\;\;\;\frac{-d}{t_0}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \frac{M}{\frac{d}{M}}\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (* h l))))
   (if (<= d -4100.0)
     (/ (- d) t_0)
     (if (<= d -4e-310)
       (/ (* 0.125 (* (* (/ h l) (* D D)) (/ M (/ d M)))) t_0)
       (* d (sqrt (/ (/ 1.0 h) l)))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h * l));
	double tmp;
	if (d <= -4100.0) {
		tmp = -d / t_0;
	} else if (d <= -4e-310) {
		tmp = (0.125 * (((h / l) * (D * D)) * (M / (d / M)))) / t_0;
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((h * l))
    if (d <= (-4100.0d0)) then
        tmp = -d / t_0
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (((h / l) * (d_1 * d_1)) * (m / (d / m)))) / t_0
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h * l));
	double tmp;
	if (d <= -4100.0) {
		tmp = -d / t_0;
	} else if (d <= -4e-310) {
		tmp = (0.125 * (((h / l) * (D * D)) * (M / (d / M)))) / t_0;
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = math.sqrt((h * l))
	tmp = 0
	if d <= -4100.0:
		tmp = -d / t_0
	elif d <= -4e-310:
		tmp = (0.125 * (((h / l) * (D * D)) * (M / (d / M)))) / t_0
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h * l))
	tmp = 0.0
	if (d <= -4100.0)
		tmp = Float64(Float64(-d) / t_0);
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(Float64(Float64(h / l) * Float64(D * D)) * Float64(M / Float64(d / M)))) / t_0);
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h * l));
	tmp = 0.0;
	if (d <= -4100.0)
		tmp = -d / t_0;
	elseif (d <= -4e-310)
		tmp = (0.125 * (((h / l) * (D * D)) * (M / (d / M)))) / t_0;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -4100.0], N[((-d) / t$95$0), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(N[(N[(h / l), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{h \cdot \ell}\\
\mathbf{if}\;d \leq -4100:\\
\;\;\;\;\frac{-d}{t_0}\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \frac{M}{\frac{d}{M}}\right)}{t_0}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -4100

    1. Initial program 78.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. Step-by-step derivation
      1. metadata-eval78.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/278.9%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/278.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac77.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval77.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified77.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p69.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp66.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*66.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 81.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow181.1%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative81.1%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/81.1%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg81.1%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div81.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval81.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr81.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow181.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out81.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/81.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity81.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/81.2%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac81.2%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified81.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around 0 63.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot d}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. neg-mul-163.9%

        \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]
    14. Simplified63.9%

      \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]

    if -4100 < d < -3.999999999999988e-310

    1. Initial program 52.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval52.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/252.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/252.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac50.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval50.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified50.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr6.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def13.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p36.2%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp29.8%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/28.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*28.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp35.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified35.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 58.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow158.4%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative58.4%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr58.4%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow158.4%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out58.4%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/58.4%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity58.4%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/63.7%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac63.7%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified63.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 45.0%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/45.0%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative45.0%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/45.0%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. *-commutative45.0%

        \[\leadsto \frac{0.125 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*43.3%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left({D}^{2} \cdot h\right) \cdot {M}^{2}}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative43.3%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(h \cdot {D}^{2}\right)} \cdot {M}^{2}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow243.3%

        \[\leadsto \frac{0.125 \cdot \frac{\left(h \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot {M}^{2}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative43.3%

        \[\leadsto \frac{0.125 \cdot \frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot {M}^{2}}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. times-frac41.8%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\left(\frac{h \cdot \left(D \cdot D\right)}{\ell} \cdot \frac{{M}^{2}}{d}\right)}}{\sqrt{h \cdot \ell}} \]
      10. unpow241.8%

        \[\leadsto \frac{0.125 \cdot \left(\frac{h \cdot \color{blue}{{D}^{2}}}{\ell} \cdot \frac{{M}^{2}}{d}\right)}{\sqrt{h \cdot \ell}} \]
      11. associate-/l*43.4%

        \[\leadsto \frac{0.125 \cdot \left(\color{blue}{\frac{h}{\frac{\ell}{{D}^{2}}}} \cdot \frac{{M}^{2}}{d}\right)}{\sqrt{h \cdot \ell}} \]
      12. associate-/r/40.1%

        \[\leadsto \frac{0.125 \cdot \left(\color{blue}{\left(\frac{h}{\ell} \cdot {D}^{2}\right)} \cdot \frac{{M}^{2}}{d}\right)}{\sqrt{h \cdot \ell}} \]
      13. unpow240.1%

        \[\leadsto \frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{d}\right)}{\sqrt{h \cdot \ell}} \]
      14. unpow240.1%

        \[\leadsto \frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{M \cdot M}}{d}\right)}{\sqrt{h \cdot \ell}} \]
      15. associate-/l*45.4%

        \[\leadsto \frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)}{\sqrt{h \cdot \ell}} \]
    14. Simplified45.4%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \frac{M}{\frac{d}{M}}\right)}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d

    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. Step-by-step derivation
      1. metadata-eval62.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/262.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/262.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified62.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 37.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative37.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative37.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*38.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified38.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4100:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \left(\left(\frac{h}{\ell} \cdot \left(D \cdot D\right)\right) \cdot \frac{M}{\frac{d}{M}}\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 17: 49.5% accurate, 2.7× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{h \cdot \ell}\\ \mathbf{if}\;d \leq -7700:\\ \;\;\;\;\frac{-d}{t_0}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (* h l))))
   (if (<= d -7700.0)
     (/ (- d) t_0)
     (if (<= d -4e-310)
       (/ (* 0.125 (/ D (/ (* d l) (* M (* D (* h M)))))) t_0)
       (* d (sqrt (/ (/ 1.0 h) l)))))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h * l));
	double tmp;
	if (d <= -7700.0) {
		tmp = -d / t_0;
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / t_0;
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((h * l))
    if (d <= (-7700.0d0)) then
        tmp = -d / t_0
    else if (d <= (-4d-310)) then
        tmp = (0.125d0 * (d_1 / ((d * l) / (m * (d_1 * (h * m)))))) / t_0
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h * l));
	double tmp;
	if (d <= -7700.0) {
		tmp = -d / t_0;
	} else if (d <= -4e-310) {
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / t_0;
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	t_0 = math.sqrt((h * l))
	tmp = 0
	if d <= -7700.0:
		tmp = -d / t_0
	elif d <= -4e-310:
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / t_0
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h * l))
	tmp = 0.0
	if (d <= -7700.0)
		tmp = Float64(Float64(-d) / t_0);
	elseif (d <= -4e-310)
		tmp = Float64(Float64(0.125 * Float64(D / Float64(Float64(d * l) / Float64(M * Float64(D * Float64(h * M)))))) / t_0);
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h * l));
	tmp = 0.0;
	if (d <= -7700.0)
		tmp = -d / t_0;
	elseif (d <= -4e-310)
		tmp = (0.125 * (D / ((d * l) / (M * (D * (h * M)))))) / t_0;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7700.0], N[((-d) / t$95$0), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(0.125 * N[(D / N[(N[(d * l), $MachinePrecision] / N[(M * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{h \cdot \ell}\\
\mathbf{if}\;d \leq -7700:\\
\;\;\;\;\frac{-d}{t_0}\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -7700

    1. Initial program 78.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. Step-by-step derivation
      1. metadata-eval78.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/278.9%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/278.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*78.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac77.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval77.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified77.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr43.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def48.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p69.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp66.0%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/55.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*66.0%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp66.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp69.9%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified69.9%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 81.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow181.1%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative81.1%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/81.1%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg81.1%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div81.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval81.2%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr81.2%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow181.2%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out81.2%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/81.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity81.2%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/81.2%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac81.2%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified81.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around 0 63.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot d}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. neg-mul-163.9%

        \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]
    14. Simplified63.9%

      \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]

    if -7700 < d < -3.999999999999988e-310

    1. Initial program 52.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval52.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/252.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/252.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*52.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac50.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval50.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified50.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr6.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def13.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p36.2%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp29.8%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/28.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*28.6%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp28.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp35.0%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified35.0%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 58.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow158.4%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative58.4%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval58.4%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr58.4%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow158.4%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out58.4%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/58.4%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity58.4%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/63.7%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac63.7%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified63.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around inf 45.0%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. associate-*r/45.0%

        \[\leadsto \frac{\color{blue}{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      2. *-commutative45.0%

        \[\leadsto \frac{\frac{0.125 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      3. associate-*r/45.0%

        \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}}{\sqrt{h \cdot \ell}} \]
      4. unpow245.0%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      5. associate-*r*49.2%

        \[\leadsto \frac{0.125 \cdot \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      6. *-commutative49.2%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      7. unpow249.2%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{d \cdot \ell}}{\sqrt{h \cdot \ell}} \]
      8. *-commutative49.2%

        \[\leadsto \frac{0.125 \cdot \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{\ell \cdot d}}}{\sqrt{h \cdot \ell}} \]
      9. associate-/l*49.2%

        \[\leadsto \frac{0.125 \cdot \color{blue}{\frac{D}{\frac{\ell \cdot d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}}{\sqrt{h \cdot \ell}} \]
      10. *-commutative49.2%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{\color{blue}{d \cdot \ell}}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}} \]
      11. associate-*r*57.4%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{D \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}}}}{\sqrt{h \cdot \ell}} \]
      12. associate-*r*60.8%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\color{blue}{\left(D \cdot \left(h \cdot M\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]
      13. *-commutative60.8%

        \[\leadsto \frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \color{blue}{\left(M \cdot h\right)}\right) \cdot M}}}{\sqrt{h \cdot \ell}} \]
    14. Simplified60.8%

      \[\leadsto \frac{\color{blue}{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{\left(D \cdot \left(M \cdot h\right)\right) \cdot M}}}}{\sqrt{h \cdot \ell}} \]

    if -3.999999999999988e-310 < d

    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. Step-by-step derivation
      1. metadata-eval62.6%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/262.6%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/262.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval62.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified62.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 37.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative37.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative37.3%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*38.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified38.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -7700:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{0.125 \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \left(D \cdot \left(h \cdot M\right)\right)}}}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 18: 43.9% accurate, 3.0× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 2.4 \cdot 10^{-238}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 2.4e-238)
   (* d (- (sqrt (/ (/ 1.0 l) h))))
   (* d (sqrt (/ (/ 1.0 h) l)))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.4e-238) {
		tmp = d * -sqrt(((1.0 / l) / h));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= 2.4d-238) then
        tmp = d * -sqrt(((1.0d0 / l) / h))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.4e-238) {
		tmp = d * -Math.sqrt(((1.0 / l) / h));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	tmp = 0
	if l <= 2.4e-238:
		tmp = d * -math.sqrt(((1.0 / l) / h))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 2.4e-238)
		tmp = Float64(d * Float64(-sqrt(Float64(Float64(1.0 / l) / h))));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 2.4e-238)
		tmp = d * -sqrt(((1.0 / l) / h));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.4e-238], N[(d * (-N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.4 \cdot 10^{-238}:\\
\;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.3999999999999998e-238

    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. Step-by-step derivation
      1. metadata-eval66.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/266.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr25.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def30.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p54.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp50.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/43.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp54.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified54.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Step-by-step derivation
      1. sqrt-div65.1%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    9. Step-by-step derivation
      1. pow165.1%

        \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left({\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}}\right) \]
      2. associate-/r/65.1%

        \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - {\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}\right) \]
    10. Applied egg-rr65.1%

      \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left({\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}^{1}}\right) \]
    11. Simplified66.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{h \cdot \frac{0.5}{\frac{\ell}{{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}}}}\right) \]
    12. Taylor expanded in d around -inf 42.7%

      \[\leadsto \color{blue}{-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \]
    13. Step-by-step derivation
      1. associate-*r*42.7%

        \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. neg-mul-142.7%

        \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      3. associate-/r*43.2%

        \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    14. Simplified43.2%

      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]

    if 2.3999999999999998e-238 < l

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.0%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/263.0%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified62.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 39.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative39.6%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative39.6%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*40.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified40.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.4 \cdot 10^{-238}:\\ \;\;\;\;d \cdot \left(-\sqrt{\frac{\frac{1}{\ell}}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 19: 43.8% accurate, 3.0× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 9 \cdot 10^{-238}:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 9e-238) (/ (- d) (sqrt (* h l))) (* d (sqrt (/ (/ 1.0 h) l)))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 9e-238) {
		tmp = -d / sqrt((h * l));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= 9d-238) then
        tmp = -d / sqrt((h * l))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 9e-238) {
		tmp = -d / Math.sqrt((h * l));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	tmp = 0
	if l <= 9e-238:
		tmp = -d / math.sqrt((h * l))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 9e-238)
		tmp = Float64(Float64(-d) / sqrt(Float64(h * l)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 9e-238)
		tmp = -d / sqrt((h * l));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 9e-238], N[((-d) / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 9 \cdot 10^{-238}:\\
\;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 8.99999999999999992e-238

    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. Step-by-step derivation
      1. metadata-eval66.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/266.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr25.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def30.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p54.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp50.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/43.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp54.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified54.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 63.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow163.7%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative63.7%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/63.7%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg63.7%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div63.8%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval63.8%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr63.8%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow163.8%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out63.8%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/63.8%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity63.8%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/65.9%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac65.9%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified65.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around 0 42.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot d}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. neg-mul-142.8%

        \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]
    14. Simplified42.8%

      \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]

    if 8.99999999999999992e-238 < l

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.0%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/263.0%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified62.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Taylor expanded in d around inf 39.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    5. Step-by-step derivation
      1. *-commutative39.6%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative39.6%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. associate-/r*40.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    6. Simplified40.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 9 \cdot 10^{-238}:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 20: 43.6% accurate, 3.1× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 2.3 \cdot 10^{-238}:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 2.3e-238) (/ (- d) (sqrt (* h l))) (* d (pow (* h l) -0.5))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.3e-238) {
		tmp = -d / sqrt((h * l));
	} else {
		tmp = d * pow((h * l), -0.5);
	}
	return tmp;
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= 2.3d-238) then
        tmp = -d / sqrt((h * l))
    else
        tmp = d * ((h * l) ** (-0.5d0))
    end if
    code = tmp
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.3e-238) {
		tmp = -d / Math.sqrt((h * l));
	} else {
		tmp = d * Math.pow((h * l), -0.5);
	}
	return tmp;
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	tmp = 0
	if l <= 2.3e-238:
		tmp = -d / math.sqrt((h * l))
	else:
		tmp = d * math.pow((h * l), -0.5)
	return tmp
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 2.3e-238)
		tmp = Float64(Float64(-d) / sqrt(Float64(h * l)));
	else
		tmp = Float64(d * (Float64(h * l) ^ -0.5));
	end
	return tmp
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 2.3e-238)
		tmp = -d / sqrt((h * l));
	else
		tmp = d * ((h * l) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.3e-238], N[((-d) / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.3 \cdot 10^{-238}:\\
\;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.30000000000000005e-238

    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. Step-by-step derivation
      1. metadata-eval66.4%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/266.4%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval65.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified65.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr25.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def30.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p54.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp50.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/43.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*49.8%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp49.8%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp54.3%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified54.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Taylor expanded in d around -inf 63.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow163.7%

        \[\leadsto \color{blue}{{\left(\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
      2. *-commutative63.7%

        \[\leadsto {\color{blue}{\left(\left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}}^{1} \]
      3. associate-/r/63.7%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right)\right)}^{1} \]
      4. mul-1-neg63.7%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\left(-d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}\right)}^{1} \]
      5. sqrt-div63.8%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)\right)}^{1} \]
      6. metadata-eval63.8%

        \[\leadsto {\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)\right)}^{1} \]
    9. Applied egg-rr63.8%

      \[\leadsto \color{blue}{{\left(\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow163.8%

        \[\leadsto \color{blue}{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(-d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      2. distribute-rgt-neg-out63.8%

        \[\leadsto \color{blue}{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)} \]
      3. associate-*r/63.8%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
      4. *-rgt-identity63.8%

        \[\leadsto -\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
      5. associate-*r/65.9%

        \[\leadsto -\color{blue}{\frac{\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
      6. distribute-neg-frac65.9%

        \[\leadsto \color{blue}{\frac{-\left(1 - {\left(M \cdot \left(\frac{D}{d} \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \cdot d}{\sqrt{\ell \cdot h}}} \]
    11. Simplified65.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \left(-d\right)}{\sqrt{h \cdot \ell}}} \]
    12. Taylor expanded in M around 0 42.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot d}}{\sqrt{h \cdot \ell}} \]
    13. Step-by-step derivation
      1. neg-mul-142.8%

        \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]
    14. Simplified42.8%

      \[\leadsto \frac{\color{blue}{-d}}{\sqrt{h \cdot \ell}} \]

    if 2.30000000000000005e-238 < l

    1. Initial program 63.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. Step-by-step derivation
      1. metadata-eval63.0%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. unpow1/263.0%

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. metadata-eval63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. unpow1/263.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. *-commutative63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
      6. associate-*l*63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
      7. times-frac62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. metadata-eval62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
    3. Simplified62.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    4. Applied egg-rr12.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def28.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p53.4%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp47.2%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
      4. associate-*r/42.2%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      5. associate-/l*46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
      6. exp-diff46.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
      7. log-div46.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
      8. rem-log-exp46.4%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. rem-log-exp52.6%

        \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. Simplified52.6%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    7. Step-by-step derivation
      1. sqrt-div62.2%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    8. Applied egg-rr62.2%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
    9. Taylor expanded in d around inf 39.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    10. Step-by-step derivation
      1. *-commutative39.6%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
      2. unpow-139.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{-1}}} \]
      3. sqr-pow39.6%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}}} \]
      4. rem-sqrt-square39.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right|} \]
      5. sqr-pow39.5%

        \[\leadsto d \cdot \left|\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \]
      6. fabs-sqr39.5%

        \[\leadsto d \cdot \color{blue}{\left({\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \]
      7. sqr-pow39.6%

        \[\leadsto d \cdot \color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}} \]
      8. *-commutative39.6%

        \[\leadsto d \cdot {\color{blue}{\left(h \cdot \ell\right)}}^{\left(\frac{-1}{2}\right)} \]
      9. metadata-eval39.6%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
    11. Simplified39.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.3 \cdot 10^{-238}:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]

Alternative 21: 26.6% accurate, 3.1× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ d \cdot {\left(h \cdot \ell\right)}^{-0.5} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	return d * pow((h * l), -0.5);
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d * ((h * l) ** (-0.5d0))
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.pow((h * l), -0.5);
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	return d * math.pow((h * l), -0.5)
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	return Float64(d * (Float64(h * l) ^ -0.5))
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
	tmp = d * ((h * l) ^ -0.5);
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 65.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. Step-by-step derivation
    1. metadata-eval65.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. unpow1/265.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. metadata-eval65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. unpow1/265.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    5. *-commutative65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
    6. associate-*l*65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
    7. times-frac64.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. metadata-eval64.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
  3. Simplified64.1%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
  4. Applied egg-rr19.6%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
  5. Step-by-step derivation
    1. expm1-def29.8%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
    2. expm1-log1p54.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
    3. rem-log-exp48.9%

      \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)} \]
    4. associate-*r/43.1%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h} \cdot d}{\ell}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    5. associate-/l*48.3%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \cdot \log \left(e^{1 - {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
    6. exp-diff48.3%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \log \color{blue}{\left(\frac{e^{1}}{e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}}\right)} \]
    7. log-div48.3%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \color{blue}{\left(\log \left(e^{1}\right) - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right)} \]
    8. rem-log-exp48.3%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(\color{blue}{1} - \log \left(e^{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)\right) \]
    9. rem-log-exp53.6%

      \[\leadsto \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - \color{blue}{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right) \]
  6. Simplified53.6%

    \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
  7. Step-by-step derivation
    1. sqrt-div63.9%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
  8. Applied egg-rr63.9%

    \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \cdot \left(1 - {\left(M \cdot \frac{D}{\frac{d}{0.5}}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right) \]
  9. Taylor expanded in d around inf 21.0%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
  10. Step-by-step derivation
    1. *-commutative21.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    2. unpow-121.0%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{-1}}} \]
    3. sqr-pow21.0%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}}} \]
    4. rem-sqrt-square21.0%

      \[\leadsto d \cdot \color{blue}{\left|{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right|} \]
    5. sqr-pow20.9%

      \[\leadsto d \cdot \left|\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \]
    6. fabs-sqr20.9%

      \[\leadsto d \cdot \color{blue}{\left({\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \]
    7. sqr-pow21.0%

      \[\leadsto d \cdot \color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}} \]
    8. *-commutative21.0%

      \[\leadsto d \cdot {\color{blue}{\left(h \cdot \ell\right)}}^{\left(\frac{-1}{2}\right)} \]
    9. metadata-eval21.0%

      \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \]
  11. Simplified21.0%

    \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  12. Final simplification21.0%

    \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]

Alternative 22: 26.7% accurate, 3.2× speedup?

\[\begin{array}{l} M = |M|\\ [M, D] = \mathsf{sort}([M, D])\\ \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
M = abs(M);
assert(M < D);
double code(double d, double h, double l, double M, double D) {
	return d / sqrt((h * l));
}
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d / sqrt((h * l))
end function
M = Math.abs(M);
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
	return d / Math.sqrt((h * l));
}
M = abs(M)
[M, D] = sort([M, D])
def code(d, h, l, M, D):
	return d / math.sqrt((h * l))
M = abs(M)
M, D = sort([M, D])
function code(d, h, l, M, D)
	return Float64(d / sqrt(Float64(h * l)))
end
M = abs(M)
M, D = num2cell(sort([M, D])){:}
function tmp = code(d, h, l, M, D)
	tmp = d / sqrt((h * l));
end
NOTE: M should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Derivation
  1. Initial program 65.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. Step-by-step derivation
    1. metadata-eval65.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. unpow1/265.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. metadata-eval65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. unpow1/265.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    5. *-commutative65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
    6. associate-*l*65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
    7. times-frac64.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. metadata-eval64.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(\color{blue}{0.5} \cdot \frac{h}{\ell}\right)\right) \]
  3. Simplified64.1%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)} \]
  4. Step-by-step derivation
    1. associate-*r*64.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}}\right) \]
    2. frac-times65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot \frac{h}{\ell}\right) \]
    3. *-commutative65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
    4. metadata-eval65.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    5. associate-*r/67.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
    6. metadata-eval67.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}\right) \]
    7. *-commutative67.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot 0.5\right)} \cdot h}{\ell}\right) \]
    8. frac-times67.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    9. *-commutative67.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    10. div-inv67.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \color{blue}{\left(M \cdot \frac{1}{2}\right)}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    11. metadata-eval67.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot \color{blue}{0.5}\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
  5. Applied egg-rr67.0%

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}}\right) \]
  6. Taylor expanded in d around inf 21.0%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
  7. Step-by-step derivation
    1. *-commutative21.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    2. associate-/r*21.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  8. Simplified21.3%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  9. Step-by-step derivation
    1. associate-/r*21.0%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \]
    2. add-cbrt-cube15.4%

      \[\leadsto d \cdot \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}} \]
    3. pow115.4%

      \[\leadsto \color{blue}{{\left(d \cdot \sqrt{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}\right)}^{1}} \]
    4. add-cbrt-cube21.0%

      \[\leadsto {\left(d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}}\right)}^{1} \]
    5. sqrt-div21.0%

      \[\leadsto {\left(d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}}\right)}^{1} \]
    6. metadata-eval21.0%

      \[\leadsto {\left(d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}}\right)}^{1} \]
  10. Applied egg-rr21.0%

    \[\leadsto \color{blue}{{\left(d \cdot \frac{1}{\sqrt{\ell \cdot h}}\right)}^{1}} \]
  11. Step-by-step derivation
    1. unpow121.0%

      \[\leadsto \color{blue}{d \cdot \frac{1}{\sqrt{\ell \cdot h}}} \]
    2. associate-*r/21.0%

      \[\leadsto \color{blue}{\frac{d \cdot 1}{\sqrt{\ell \cdot h}}} \]
    3. *-rgt-identity21.0%

      \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell \cdot h}} \]
    4. *-commutative21.0%

      \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
  12. Simplified21.0%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  13. Final simplification21.0%

    \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]

Reproduce

?
herbie shell --seed 2023242 
(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)))))