Henrywood and Agarwal, Equation (12)

Percentage Accurate: 67.6% → 84.7%
Time: 28.5s
Alternatives: 22
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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: 67.6% 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: 84.7% accurate, 0.7× speedup?

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

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_1 \cdot \frac{t\_2}{\sqrt{-h}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t\_1 \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right)\\


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

    1. Initial program 55.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. Simplified46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000019e169 < l < -9.999999999999969e-311

    1. Initial program 72.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. Simplified72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

    1. Initial program 72.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. Simplified70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    12. Step-by-step derivation
      1. pow1/279.2%

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

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

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

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

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

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

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

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

Alternative 2: 82.3% accurate, 0.8× speedup?

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

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_1 \cdot \frac{t\_2}{\sqrt{-h}}\right)\\

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


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

    1. Initial program 55.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. Simplified46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999998e169 < l < -9.999999999999969e-311

    1. Initial program 72.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. Simplified72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999984e-309 < d < 4.1000000000000002e70

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    12. Step-by-step derivation
      1. associate-*l*82.9%

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

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

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

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

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

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

    if 4.1000000000000002e70 < d

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

Alternative 4: 77.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(t\_0 + -1\right)\\

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


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

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000002e127 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

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

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

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

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

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

    if -4.999999999999985e-310 < h

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

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

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

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

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

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

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

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

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

Alternative 5: 78.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.6e124 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

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

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

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

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

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

    if -4.999999999999985e-310 < h

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.4% accurate, 1.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\_m\right)\right)}{d}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -3.4999999999999998e129

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999998e129 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

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

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

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

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

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

    if -4.999999999999985e-310 < h < 1.8999999999999998e-46

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8999999999999998e-46 < h

    1. Initial program 72.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. Simplified69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    10. Step-by-step derivation
      1. associate-*l*84.8%

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

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

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

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

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

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}{d}}\right)\right) \]
    12. Step-by-step derivation
      1. associate-/l*73.3%

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

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

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

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

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

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

Alternative 7: 73.4% accurate, 1.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\_m\right)\right)}{d}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -2.3000000000000001e119

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e119 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

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

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

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

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

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

    if -4.999999999999985e-310 < h < 1.7500000000000001e-46

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7500000000000001e-46 < h

    1. Initial program 72.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. Simplified69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      12. metadata-eval73.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\color{blue}{1}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      13. pow173.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      14. associate-/r*73.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      15. div-inv73.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{\color{blue}{M \cdot \frac{1}{2}}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      16. metadata-eval73.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot \color{blue}{0.5}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    9. Applied egg-rr73.5%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    10. Step-by-step derivation
      1. associate-*l*84.8%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}\right)\right) \]
      2. associate-*r/84.9%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\frac{D \cdot \left(M \cdot 0.5\right)}{d}} \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right)\right) \]
      3. associate-*l/84.9%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}}\right)\right) \]
      4. associate-*l*82.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \frac{-0.5}{\ell}\right)\right)}}{d}\right)\right) \]
      5. associate-/l*82.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}\right)\right)}{d}\right)\right) \]
    11. Applied egg-rr74.8%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}{d}}\right)\right) \]
    12. Step-by-step derivation
      1. associate-/l*73.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)}\right)\right) \]
      2. associate-*r*73.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot M\right) \cdot 0.5\right)} \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)\right)\right) \]
      3. associate-*r*74.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}}}{d}\right)\right)\right) \]
      4. associate-*r*77.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}}{d}\right)\right)\right) \]
    13. Simplified77.8%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}}{d}\right)}\right)\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -2.3 \cdot 10^{+119}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;h \leq 1.75 \cdot 10^{-46}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\right)\right)}{d}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.4% accurate, 1.3× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\_m\right)\right)}{d}\right)\right)\right)\\ \mathbf{if}\;h \leq -1 \cdot 10^{+130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;h \leq 2 \cdot 10^{-46}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0
         (*
          (sqrt (/ d l))
          (*
           (sqrt (/ d h))
           (+
            1.0
            (*
             h
             (*
              (* 0.5 (* D M_m))
              (/ (* (/ -0.5 l) (* (/ 0.5 d) (* D M_m))) d))))))))
   (if (<= h -1e+130)
     t_0
     (if (<= h -5e-310)
       (*
        (* d (sqrt (/ 1.0 (* l h))))
        (+ (* 0.5 (* (pow (* (/ M_m 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
       (if (<= h 2e-46)
         (*
          (* d (pow (* l h) -0.5))
          (- 1.0 (* 0.5 (/ (* h (pow (* M_m (* 0.5 (/ D d))) 2.0)) l))))
         t_0)))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * (((-0.5 / l) * ((0.5 / d) * (D * M_m))) / d)))));
	double tmp;
	if (h <= -1e+130) {
		tmp = t_0;
	} else if (h <= -5e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * (pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (h <= 2e-46) {
		tmp = (d * pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (h * ((0.5d0 * (d_1 * m_m)) * ((((-0.5d0) / l) * ((0.5d0 / d) * (d_1 * m_m))) / d)))))
    if (h <= (-1d+130)) then
        tmp = t_0
    else if (h <= (-5d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((0.5d0 * ((((m_m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else if (h <= 2d-46) then
        tmp = (d * ((l * h) ** (-0.5d0))) * (1.0d0 - (0.5d0 * ((h * ((m_m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
    else
        tmp = t_0
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * (((-0.5 / l) * ((0.5 / d) * (D * M_m))) / d)))));
	double tmp;
	if (h <= -1e+130) {
		tmp = t_0;
	} else if (h <= -5e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * ((0.5 * (Math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (h <= 2e-46) {
		tmp = (d * Math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * Math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * (((-0.5 / l) * ((0.5 / d) * (D * M_m))) / d)))))
	tmp = 0
	if h <= -1e+130:
		tmp = t_0
	elif h <= -5e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * ((0.5 * (math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	elif h <= 2e-46:
		tmp = (d * math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)))
	else:
		tmp = t_0
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64(Float64(0.5 * Float64(D * M_m)) * Float64(Float64(Float64(-0.5 / l) * Float64(Float64(0.5 / d) * Float64(D * M_m))) / d))))))
	tmp = 0.0
	if (h <= -1e+130)
		tmp = t_0;
	elseif (h <= -5e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M_m / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	elseif (h <= 2e-46)
		tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M_m * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))));
	else
		tmp = t_0;
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * (((-0.5 / l) * ((0.5 / d) * (D * M_m))) / d)))));
	tmp = 0.0;
	if (h <= -1e+130)
		tmp = t_0;
	elseif (h <= -5e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * ((((M_m / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	elseif (h <= 2e-46)
		tmp = (d * ((l * h) ^ -0.5)) * (1.0 - (0.5 * ((h * ((M_m * (0.5 * (D / d))) ^ 2.0)) / l)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(N[(0.5 * N[(D * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 / l), $MachinePrecision] * N[(N[(0.5 / d), $MachinePrecision] * N[(D * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e+130], t$95$0, If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2e-46], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M$95$m * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\_m\right)\right)}{d}\right)\right)\right)\\
\mathbf{if}\;h \leq -1 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\

\mathbf{elif}\;h \leq 2 \cdot 10^{-46}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.0000000000000001e130 or 2.00000000000000005e-46 < h

    1. Initial program 67.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. Simplified64.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\frac{h \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)}{\ell}}\right)\right) \]
      2. *-commutative67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \color{blue}{\left(-0.5 \cdot {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}\right)}}{\ell}\right)\right) \]
      3. associate-*r/69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      4. *-un-lft-identity69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{1 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      5. times-frac67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D}{1} \cdot \frac{\frac{M}{2}}{d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      6. associate-/l/67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{1} \cdot \color{blue}{\frac{M}{d \cdot 2}}\right)}^{2}\right)}{\ell}\right)\right) \]
      7. *-commutative67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      8. times-frac69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D \cdot M}{1 \cdot \left(2 \cdot d\right)}\right)}}^{2}\right)}{\ell}\right)\right) \]
      9. *-un-lft-identity69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      10. *-commutative69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right)}{\ell}\right)\right) \]
      11. associate-/l*68.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      12. *-un-lft-identity68.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2}\right)}{\ell}\right)\right) \]
      13. times-frac68.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2}\right)}{\ell}\right)\right) \]
      14. metadata-eval68.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\right) \]
    5. Applied egg-rr68.3%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}}\right)\right) \]
    6. Step-by-step derivation
      1. associate-/l*72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{h \cdot \frac{-0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}}\right)\right) \]
      2. *-commutative72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\color{blue}{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot -0.5}}{\ell}\right)\right) \]
      3. associate-/l*72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)}\right)\right) \]
      4. *-commutative72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. metadata-eval72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      6. times-frac72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      7. *-rgt-identity72.9%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      8. associate-/l*73.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      9. *-commutative73.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      10. associate-/l*71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      11. *-commutative71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    7. Simplified71.1%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{h \cdot \left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)}\right)\right) \]
    8. Step-by-step derivation
      1. unpow-prod-down58.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left({D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      2. add-sqr-sqrt58.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      3. unpow-prod-down58.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\sqrt{\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      4. sqrt-pow149.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. metadata-eval49.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\color{blue}{1}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      6. pow149.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      7. associate-/r*49.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      8. div-inv49.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{\color{blue}{M \cdot \frac{1}{2}}}{d}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      9. metadata-eval49.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot \color{blue}{0.5}}{d}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      10. unpow-prod-down57.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \sqrt{\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      11. sqrt-pow171.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      12. metadata-eval71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\color{blue}{1}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      13. pow171.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      14. associate-/r*71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      15. div-inv71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{\color{blue}{M \cdot \frac{1}{2}}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      16. metadata-eval71.1%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot \color{blue}{0.5}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    9. Applied egg-rr71.1%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    10. Step-by-step derivation
      1. associate-*l*50.4%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}\right)\right) \]
      2. associate-*r/50.5%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\frac{D \cdot \left(M \cdot 0.5\right)}{d}} \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right)\right) \]
      3. associate-*l/50.5%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}}\right)\right) \]
      4. associate-*l*48.7%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \frac{-0.5}{\ell}\right)\right)}}{d}\right)\right) \]
      5. associate-/l*48.7%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}\right)\right)}{d}\right)\right) \]
    11. Applied egg-rr70.1%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}{d}}\right)\right) \]
    12. Step-by-step derivation
      1. associate-/l*69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)}\right)\right) \]
      2. associate-*r*69.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot M\right) \cdot 0.5\right)} \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)\right)\right) \]
      3. associate-*r*71.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}}}{d}\right)\right)\right) \]
      4. associate-*r*74.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}}{d}\right)\right)\right) \]
    13. Simplified74.5%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}}{d}\right)}\right)\right) \]

    if -1.0000000000000001e130 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg72.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      2. sqrt-div81.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    5. Applied egg-rr82.7%

      \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 85.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if -4.999999999999985e-310 < h < 2.00000000000000005e-46

    1. Initial program 72.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified72.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative72.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div77.3%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div85.6%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times85.7%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt85.8%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr85.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv85.7%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative85.7%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval85.7%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod80.5%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div80.6%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative80.6%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow80.6%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow180.6%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval80.6%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr80.6%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. associate-/l*84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2} \cdot h}{\ell}\right) \]
      6. metadata-eval84.4%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right) \]
    9. Applied egg-rr84.4%

      \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1 \cdot 10^{+130}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\right)\right)}{d}\right)\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;h \leq 2 \cdot 10^{-46}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\right)\right) \cdot \frac{\frac{-0.5}{\ell} \cdot \left(\frac{0.5}{d} \cdot \left(D \cdot M\right)\right)}{d}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.6% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5.9 \cdot 10^{+259}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -5.9e+259)
   (* (sqrt (/ d h)) (sqrt (/ d l)))
   (if (<= l -1e-310)
     (*
      (* d (sqrt (/ 1.0 (* l h))))
      (+ (* 0.5 (* (pow (* (/ M_m 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
     (if (<= l 2.45e+203)
       (*
        (* d (pow (* l h) -0.5))
        (- 1.0 (* 0.5 (/ (* h (pow (* M_m (* 0.5 (/ D d))) 2.0)) l))))
       (/ d (* (sqrt l) (sqrt h)))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -5.9e+259) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else if (l <= -1e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * (pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (l <= 2.45e+203) {
		tmp = (d * pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-5.9d+259)) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else if (l <= (-1d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((0.5d0 * ((((m_m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else if (l <= 2.45d+203) then
        tmp = (d * ((l * h) ** (-0.5d0))) * (1.0d0 - (0.5d0 * ((h * ((m_m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -5.9e+259) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else if (l <= -1e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * ((0.5 * (Math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (l <= 2.45e+203) {
		tmp = (d * Math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * Math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -5.9e+259:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	elif l <= -1e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * ((0.5 * (math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	elif l <= 2.45e+203:
		tmp = (d * math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -5.9e+259)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	elseif (l <= -1e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M_m / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	elseif (l <= 2.45e+203)
		tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M_m * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -5.9e+259)
		tmp = sqrt((d / h)) * sqrt((d / l));
	elseif (l <= -1e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * ((((M_m / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	elseif (l <= 2.45e+203)
		tmp = (d * ((l * h) ^ -0.5)) * (1.0 - (0.5 * ((h * ((M_m * (0.5 * (D / d))) ^ 2.0)) / l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -5.9e+259], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.45e+203], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M$95$m * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.9 \cdot 10^{+259}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\

\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.89999999999999972e259

    1. Initial program 66.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. Simplified66.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 67.7%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]

    if -5.89999999999999972e259 < l < -9.999999999999969e-311

    1. Initial program 69.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. Simplified69.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg73.0%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      2. sqrt-div83.6%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    5. Applied egg-rr78.2%

      \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 76.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if -9.999999999999969e-311 < l < 2.4499999999999999e203

    1. Initial program 77.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified76.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative76.7%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div77.0%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div82.9%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times82.9%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt83.1%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr83.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv83.0%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative83.0%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval83.0%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod78.0%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div78.0%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative78.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow78.0%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow178.1%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval78.1%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr78.1%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times84.8%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. associate-/l*83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2} \cdot h}{\ell}\right) \]
      6. metadata-eval83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right) \]
    9. Applied egg-rr83.2%

      \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right) \]

    if 2.4499999999999999e203 < l

    1. Initial program 50.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified50.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 53.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div53.1%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval53.1%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*68.0%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative71.5%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified71.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification78.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.9 \cdot 10^{+259}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.3% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;\ell \leq -1.7 \cdot 10^{+166}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-306}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)))
   (if (<= l -1.7e+166)
     (* (- d) t_0)
     (if (<= l 5.8e-306)
       (*
        (- 1.0 (* 0.5 (* (pow (* (/ M_m 2.0) (/ D d)) 2.0) (/ h l))))
        (sqrt (* (/ d h) (/ d l))))
       (if (<= l 1.32e+203)
         (*
          (* d t_0)
          (- 1.0 (* 0.5 (/ (* h (pow (* M_m (* 0.5 (/ D d))) 2.0)) l))))
         (/ d (* (sqrt l) (sqrt h))))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = pow((l * h), -0.5);
	double tmp;
	if (l <= -1.7e+166) {
		tmp = -d * t_0;
	} else if (l <= 5.8e-306) {
		tmp = (1.0 - (0.5 * (pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * sqrt(((d / h) * (d / l)));
	} else if (l <= 1.32e+203) {
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    if (l <= (-1.7d+166)) then
        tmp = -d * t_0
    else if (l <= 5.8d-306) then
        tmp = (1.0d0 - (0.5d0 * ((((m_m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * sqrt(((d / h) * (d / l)))
    else if (l <= 1.32d+203) then
        tmp = (d * t_0) * (1.0d0 - (0.5d0 * ((h * ((m_m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.pow((l * h), -0.5);
	double tmp;
	if (l <= -1.7e+166) {
		tmp = -d * t_0;
	} else if (l <= 5.8e-306) {
		tmp = (1.0 - (0.5 * (Math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * Math.sqrt(((d / h) * (d / l)));
	} else if (l <= 1.32e+203) {
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * Math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.pow((l * h), -0.5)
	tmp = 0
	if l <= -1.7e+166:
		tmp = -d * t_0
	elif l <= 5.8e-306:
		tmp = (1.0 - (0.5 * (math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * math.sqrt(((d / h) * (d / l)))
	elif l <= 1.32e+203:
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (l <= -1.7e+166)
		tmp = Float64(Float64(-d) * t_0);
	elseif (l <= 5.8e-306)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M_m / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * sqrt(Float64(Float64(d / h) * Float64(d / l))));
	elseif (l <= 1.32e+203)
		tmp = Float64(Float64(d * t_0) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M_m * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (l <= -1.7e+166)
		tmp = -d * t_0;
	elseif (l <= 5.8e-306)
		tmp = (1.0 - (0.5 * ((((M_m / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * sqrt(((d / h) * (d / l)));
	elseif (l <= 1.32e+203)
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * ((M_m * (0.5 * (D / d))) ^ 2.0)) / l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -1.7e+166], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, 5.8e-306], N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.32e+203], N[(N[(d * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M$95$m * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{+166}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\

\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-306}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\

\mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.7e166

    1. Initial program 55.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. Simplified55.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 19.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt58.4%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg58.4%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified58.4%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -1.7e166 < l < 5.7999999999999998e-306

    1. Initial program 72.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. Simplified73.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative73.2%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-unprod62.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr62.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if 5.7999999999999998e-306 < l < 1.32e203

    1. Initial program 77.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified76.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative76.7%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div77.0%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div82.9%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times82.9%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt83.1%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr83.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv83.0%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative83.0%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval83.0%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod78.0%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div78.0%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative78.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow78.0%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow178.1%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval78.1%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr78.1%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times84.8%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. associate-/l*83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2} \cdot h}{\ell}\right) \]
      6. metadata-eval83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right) \]
    9. Applied egg-rr83.2%

      \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right) \]

    if 1.32e203 < l

    1. Initial program 50.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified50.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 53.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div53.1%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval53.1%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*68.0%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative71.5%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified71.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification70.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.7 \cdot 10^{+166}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-306}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 63.2% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;\ell \leq -6 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 1.35 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)))
   (if (<= l -6e-25)
     (* (- d) t_0)
     (if (<= l -1e-310)
       (* d (sqrt (/ 1.0 0.0)))
       (if (<= l 1.35e+203)
         (*
          (* d t_0)
          (- 1.0 (* 0.5 (/ (* h (pow (* M_m (* 0.5 (/ D d))) 2.0)) l))))
         (/ d (* (sqrt l) (sqrt h))))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = pow((l * h), -0.5);
	double tmp;
	if (l <= -6e-25) {
		tmp = -d * t_0;
	} else if (l <= -1e-310) {
		tmp = d * sqrt((1.0 / 0.0));
	} else if (l <= 1.35e+203) {
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    if (l <= (-6d-25)) then
        tmp = -d * t_0
    else if (l <= (-1d-310)) then
        tmp = d * sqrt((1.0d0 / 0.0d0))
    else if (l <= 1.35d+203) then
        tmp = (d * t_0) * (1.0d0 - (0.5d0 * ((h * ((m_m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.pow((l * h), -0.5);
	double tmp;
	if (l <= -6e-25) {
		tmp = -d * t_0;
	} else if (l <= -1e-310) {
		tmp = d * Math.sqrt((1.0 / 0.0));
	} else if (l <= 1.35e+203) {
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * Math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.pow((l * h), -0.5)
	tmp = 0
	if l <= -6e-25:
		tmp = -d * t_0
	elif l <= -1e-310:
		tmp = d * math.sqrt((1.0 / 0.0))
	elif l <= 1.35e+203:
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (l <= -6e-25)
		tmp = Float64(Float64(-d) * t_0);
	elseif (l <= -1e-310)
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	elseif (l <= 1.35e+203)
		tmp = Float64(Float64(d * t_0) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M_m * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (l <= -6e-25)
		tmp = -d * t_0;
	elseif (l <= -1e-310)
		tmp = d * sqrt((1.0 / 0.0));
	elseif (l <= 1.35e+203)
		tmp = (d * t_0) * (1.0 - (0.5 * ((h * ((M_m * (0.5 * (D / d))) ^ 2.0)) / l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -6e-25], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.35e+203], N[(N[(d * t$95$0), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M$95$m * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -6 \cdot 10^{-25}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\

\mathbf{elif}\;\ell \leq 1.35 \cdot 10^{+203}:\\
\;\;\;\;\left(d \cdot t\_0\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.9999999999999995e-25

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -5.9999999999999995e-25 < l < -9.999999999999969e-311

    1. Initial program 74.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. Simplified74.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 24.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod52.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]

    if -9.999999999999969e-311 < l < 1.35e203

    1. Initial program 77.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified76.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative76.7%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div77.0%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div82.9%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times82.9%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt83.1%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr83.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv83.0%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative83.0%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval83.0%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod78.0%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div78.0%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative78.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow78.0%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow178.1%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval78.1%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr78.1%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times84.8%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. associate-/l*83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2} \cdot h}{\ell}\right) \]
      6. metadata-eval83.2%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right) \]
    9. Applied egg-rr83.2%

      \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right) \]

    if 1.35e203 < l

    1. Initial program 50.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified50.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 53.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div53.1%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval53.1%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative71.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*68.0%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/71.5%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative71.5%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified71.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification66.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 1.35 \cdot 10^{+203}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 62.3% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;\ell \leq -1.2 \cdot 10^{-24}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+157}:\\ \;\;\;\;d \cdot \left(t\_0 \cdot \left(1 + -0.5 \cdot \left({\left(\frac{M\_m \cdot \left(D \cdot 0.5\right)}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)))
   (if (<= l -1.2e-24)
     (* (- d) t_0)
     (if (<= l -1e-310)
       (* d (sqrt (/ 1.0 0.0)))
       (if (<= l 1.45e+157)
         (*
          d
          (*
           t_0
           (+ 1.0 (* -0.5 (* (pow (/ (* M_m (* D 0.5)) d) 2.0) (/ h l))))))
         (/ d (* (sqrt l) (sqrt h))))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = pow((l * h), -0.5);
	double tmp;
	if (l <= -1.2e-24) {
		tmp = -d * t_0;
	} else if (l <= -1e-310) {
		tmp = d * sqrt((1.0 / 0.0));
	} else if (l <= 1.45e+157) {
		tmp = d * (t_0 * (1.0 + (-0.5 * (pow(((M_m * (D * 0.5)) / d), 2.0) * (h / l)))));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    if (l <= (-1.2d-24)) then
        tmp = -d * t_0
    else if (l <= (-1d-310)) then
        tmp = d * sqrt((1.0d0 / 0.0d0))
    else if (l <= 1.45d+157) then
        tmp = d * (t_0 * (1.0d0 + ((-0.5d0) * ((((m_m * (d_1 * 0.5d0)) / d) ** 2.0d0) * (h / l)))))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.pow((l * h), -0.5);
	double tmp;
	if (l <= -1.2e-24) {
		tmp = -d * t_0;
	} else if (l <= -1e-310) {
		tmp = d * Math.sqrt((1.0 / 0.0));
	} else if (l <= 1.45e+157) {
		tmp = d * (t_0 * (1.0 + (-0.5 * (Math.pow(((M_m * (D * 0.5)) / d), 2.0) * (h / l)))));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.pow((l * h), -0.5)
	tmp = 0
	if l <= -1.2e-24:
		tmp = -d * t_0
	elif l <= -1e-310:
		tmp = d * math.sqrt((1.0 / 0.0))
	elif l <= 1.45e+157:
		tmp = d * (t_0 * (1.0 + (-0.5 * (math.pow(((M_m * (D * 0.5)) / d), 2.0) * (h / l)))))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (l <= -1.2e-24)
		tmp = Float64(Float64(-d) * t_0);
	elseif (l <= -1e-310)
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	elseif (l <= 1.45e+157)
		tmp = Float64(d * Float64(t_0 * Float64(1.0 + Float64(-0.5 * Float64((Float64(Float64(M_m * Float64(D * 0.5)) / d) ^ 2.0) * Float64(h / l))))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (l <= -1.2e-24)
		tmp = -d * t_0;
	elseif (l <= -1e-310)
		tmp = d * sqrt((1.0 / 0.0));
	elseif (l <= 1.45e+157)
		tmp = d * (t_0 * (1.0 + (-0.5 * ((((M_m * (D * 0.5)) / d) ^ 2.0) * (h / l)))));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -1.2e-24], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.45e+157], N[(d * N[(t$95$0 * N[(1.0 + N[(-0.5 * N[(N[Power[N[(N[(M$95$m * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{-24}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\

\mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+157}:\\
\;\;\;\;d \cdot \left(t\_0 \cdot \left(1 + -0.5 \cdot \left({\left(\frac{M\_m \cdot \left(D \cdot 0.5\right)}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.1999999999999999e-24

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -1.1999999999999999e-24 < l < -9.999999999999969e-311

    1. Initial program 74.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. Simplified74.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 24.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod52.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]

    if -9.999999999999969e-311 < l < 1.44999999999999994e157

    1. Initial program 78.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified77.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative77.4%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div77.7%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div84.0%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times84.0%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt84.2%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv84.1%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative84.1%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval84.1%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod78.8%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div78.8%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative78.8%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow78.8%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow178.9%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval78.9%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr78.9%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. pow178.9%

        \[\leadsto \color{blue}{{\left(\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
    9. Applied egg-rr78.9%

      \[\leadsto \color{blue}{{\left(\left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right) \cdot \left(1 + -0.5 \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)}^{1}} \]
    10. Step-by-step derivation
      1. unpow178.9%

        \[\leadsto \color{blue}{\left(d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right) \cdot \left(1 + -0.5 \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      2. associate-*l*81.1%

        \[\leadsto \color{blue}{d \cdot \left({\left(h \cdot \ell\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \left({\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} \]
      3. *-commutative81.1%

        \[\leadsto d \cdot \left({\left(h \cdot \ell\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}\right)}\right)\right) \]
      4. associate-*r/82.8%

        \[\leadsto d \cdot \left({\left(h \cdot \ell\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\color{blue}{\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d}\right)}}^{2}\right)\right)\right) \]
      5. associate-*l*82.8%

        \[\leadsto d \cdot \left({\left(h \cdot \ell\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{\color{blue}{M \cdot \left(0.5 \cdot D\right)}}{d}\right)}^{2}\right)\right)\right) \]
    11. Simplified82.8%

      \[\leadsto \color{blue}{d \cdot \left({\left(h \cdot \ell\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M \cdot \left(0.5 \cdot D\right)}{d}\right)}^{2}\right)\right)\right)} \]

    if 1.44999999999999994e157 < l

    1. Initial program 53.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. Simplified53.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 55.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div55.7%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval55.7%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod70.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative70.4%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv70.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*67.7%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr67.7%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/70.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative70.6%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified70.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.2 \cdot 10^{-24}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 1.45 \cdot 10^{+157}:\\ \;\;\;\;d \cdot \left({\left(\ell \cdot h\right)}^{-0.5} \cdot \left(1 + -0.5 \cdot \left({\left(\frac{M \cdot \left(D \cdot 0.5\right)}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.4% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2.8 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+144}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -2.8e-25)
   (* (- d) (pow (* l h) -0.5))
   (if (<= l -1e-310)
     (* d (sqrt (/ 1.0 0.0)))
     (if (<= l 6.6e+144)
       (*
        (- 1.0 (* 0.5 (* (pow (* (/ M_m 2.0) (/ D d)) 2.0) (/ h l))))
        (/ d (sqrt (* l h))))
       (/ d (* (sqrt l) (sqrt h)))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -2.8e-25) {
		tmp = -d * pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * sqrt((1.0 / 0.0));
	} else if (l <= 6.6e+144) {
		tmp = (1.0 - (0.5 * (pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * (d / sqrt((l * h)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-2.8d-25)) then
        tmp = -d * ((l * h) ** (-0.5d0))
    else if (l <= (-1d-310)) then
        tmp = d * sqrt((1.0d0 / 0.0d0))
    else if (l <= 6.6d+144) then
        tmp = (1.0d0 - (0.5d0 * ((((m_m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * (d / sqrt((l * h)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -2.8e-25) {
		tmp = -d * Math.pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * Math.sqrt((1.0 / 0.0));
	} else if (l <= 6.6e+144) {
		tmp = (1.0 - (0.5 * (Math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * (d / Math.sqrt((l * h)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -2.8e-25:
		tmp = -d * math.pow((l * h), -0.5)
	elif l <= -1e-310:
		tmp = d * math.sqrt((1.0 / 0.0))
	elif l <= 6.6e+144:
		tmp = (1.0 - (0.5 * (math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l)))) * (d / math.sqrt((l * h)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -2.8e-25)
		tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5));
	elseif (l <= -1e-310)
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	elseif (l <= 6.6e+144)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M_m / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * Float64(d / sqrt(Float64(l * h))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -2.8e-25)
		tmp = -d * ((l * h) ^ -0.5);
	elseif (l <= -1e-310)
		tmp = d * sqrt((1.0 / 0.0));
	elseif (l <= 6.6e+144)
		tmp = (1.0 - (0.5 * ((((M_m / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * (d / sqrt((l * h)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -2.8e-25], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.6e+144], N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{-25}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\

\mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+144}:\\
\;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -2.79999999999999988e-25

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -2.79999999999999988e-25 < l < -9.999999999999969e-311

    1. Initial program 74.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. Simplified74.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 24.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod52.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]

    if -9.999999999999969e-311 < l < 6.6e144

    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. Simplified77.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative77.7%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div78.0%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div83.5%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times83.5%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt83.7%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr83.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around 0 78.1%

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Step-by-step derivation
      1. associate-/r*78.1%

        \[\leadsto \left(d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. unpow1/278.1%

        \[\leadsto \left(d \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. associate-/r*78.1%

        \[\leadsto \left(d \cdot {\color{blue}{\left(\frac{1}{h \cdot \ell}\right)}}^{0.5}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. rem-exp-log76.3%

        \[\leadsto \left(d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. exp-neg76.3%

        \[\leadsto \left(d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. exp-prod76.3%

        \[\leadsto \left(d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. distribute-lft-neg-out76.3%

        \[\leadsto \left(d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. exp-neg76.3%

        \[\leadsto \left(d \cdot \color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. exp-to-pow78.1%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      10. unpow1/278.1%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      11. associate-/l*78.2%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{\sqrt{h \cdot \ell}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      12. associate-*l/78.2%

        \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h \cdot \ell}} \cdot 1\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      13. *-rgt-identity78.2%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Simplified78.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if 6.6e144 < l

    1. Initial program 54.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. Simplified54.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 59.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div59.6%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval59.6%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod73.0%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative73.0%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv73.1%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*70.4%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr70.4%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/73.1%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative73.1%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified73.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.8 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+144}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 73.3% accurate, 1.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -8.2 \cdot 10^{+126}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{-0.25 \cdot \frac{D \cdot M\_m}{\ell \cdot d}}{d}\right)\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= h -8.2e+126)
   (*
    (sqrt (/ d l))
    (*
     (sqrt (/ d h))
     (+
      1.0
      (* h (* (* 0.5 (* D M_m)) (/ (* -0.25 (/ (* D M_m) (* l d))) d))))))
   (if (<= h -5e-310)
     (*
      (* d (sqrt (/ 1.0 (* l h))))
      (+ (* 0.5 (* (pow (* (/ M_m 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
     (*
      (* d (pow (* l h) -0.5))
      (- 1.0 (* 0.5 (/ (* h (pow (* M_m (* 0.5 (/ D d))) 2.0)) l)))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (h <= -8.2e+126) {
		tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * ((-0.25 * ((D * M_m) / (l * d))) / d)))));
	} else if (h <= -5e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * (pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (d * pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (h <= (-8.2d+126)) then
        tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + (h * ((0.5d0 * (d_1 * m_m)) * (((-0.25d0) * ((d_1 * m_m) / (l * d))) / d)))))
    else if (h <= (-5d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((0.5d0 * ((((m_m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else
        tmp = (d * ((l * h) ** (-0.5d0))) * (1.0d0 - (0.5d0 * ((h * ((m_m * (0.5d0 * (d_1 / d))) ** 2.0d0)) / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (h <= -8.2e+126) {
		tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * ((-0.25 * ((D * M_m) / (l * d))) / d)))));
	} else if (h <= -5e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * ((0.5 * (Math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (d * Math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * Math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if h <= -8.2e+126:
		tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * ((-0.25 * ((D * M_m) / (l * d))) / d)))))
	elif h <= -5e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * ((0.5 * (math.pow(((M_m / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	else:
		tmp = (d * math.pow((l * h), -0.5)) * (1.0 - (0.5 * ((h * math.pow((M_m * (0.5 * (D / d))), 2.0)) / l)))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (h <= -8.2e+126)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64(Float64(0.5 * Float64(D * M_m)) * Float64(Float64(-0.25 * Float64(Float64(D * M_m) / Float64(l * d))) / d))))));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M_m / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	else
		tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(M_m * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l))));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (h <= -8.2e+126)
		tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + (h * ((0.5 * (D * M_m)) * ((-0.25 * ((D * M_m) / (l * d))) / d)))));
	elseif (h <= -5e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * ((0.5 * ((((M_m / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	else
		tmp = (d * ((l * h) ^ -0.5)) * (1.0 - (0.5 * ((h * ((M_m * (0.5 * (D / d))) ^ 2.0)) / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -8.2e+126], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(N[(0.5 * N[(D * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(D * M$95$m), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(M$95$m * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -8.2 \cdot 10^{+126}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\_m\right)\right) \cdot \frac{-0.25 \cdot \frac{D \cdot M\_m}{\ell \cdot d}}{d}\right)\right)\right)\\

\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M\_m}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M\_m \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -8.2000000000000001e126

    1. Initial program 60.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified58.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\frac{h \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)}{\ell}}\right)\right) \]
      2. *-commutative60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \color{blue}{\left(-0.5 \cdot {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}\right)}}{\ell}\right)\right) \]
      3. associate-*r/60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      4. *-un-lft-identity60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{1 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      5. times-frac60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D}{1} \cdot \frac{\frac{M}{2}}{d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      6. associate-/l/60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{1} \cdot \color{blue}{\frac{M}{d \cdot 2}}\right)}^{2}\right)}{\ell}\right)\right) \]
      7. *-commutative60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      8. times-frac60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(\frac{D \cdot M}{1 \cdot \left(2 \cdot d\right)}\right)}}^{2}\right)}{\ell}\right)\right) \]
      9. *-un-lft-identity60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2}\right)}{\ell}\right)\right) \]
      10. *-commutative60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right)}{\ell}\right)\right) \]
      11. associate-/l*60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2}\right)}{\ell}\right)\right) \]
      12. *-un-lft-identity60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2}\right)}{\ell}\right)\right) \]
      13. times-frac60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2}\right)}{\ell}\right)\right) \]
      14. metadata-eval60.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\right) \]
    5. Applied egg-rr60.8%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}}\right)\right) \]
    6. Step-by-step derivation
      1. associate-/l*69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{h \cdot \frac{-0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}}\right)\right) \]
      2. *-commutative69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\color{blue}{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot -0.5}}{\ell}\right)\right) \]
      3. associate-/l*69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)}\right)\right) \]
      4. *-commutative69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. metadata-eval69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      6. times-frac69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      7. *-rgt-identity69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      8. associate-/l*69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      9. *-commutative69.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      10. associate-/l*67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      11. *-commutative67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    7. Simplified67.5%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{h \cdot \left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)}\right)\right) \]
    8. Step-by-step derivation
      1. unpow-prod-down54.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left({D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      2. add-sqr-sqrt54.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      3. unpow-prod-down54.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\sqrt{\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      4. sqrt-pow147.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. metadata-eval47.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\color{blue}{1}} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      6. pow147.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)} \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      7. associate-/r*47.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      8. div-inv47.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{\color{blue}{M \cdot \frac{1}{2}}}{d}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      9. metadata-eval47.7%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot \color{blue}{0.5}}{d}\right) \cdot \sqrt{{D}^{2} \cdot {\left(\frac{M}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      10. unpow-prod-down54.3%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \sqrt{\color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      11. sqrt-pow167.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      12. metadata-eval67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{\color{blue}{1}}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      13. pow167.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      14. associate-/r*67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      15. div-inv67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{\color{blue}{M \cdot \frac{1}{2}}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      16. metadata-eval67.5%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot \color{blue}{0.5}}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    9. Applied egg-rr67.5%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right)} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    10. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}\right)\right) \]
      2. associate-*r/0.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\frac{D \cdot \left(M \cdot 0.5\right)}{d}} \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)\right)\right) \]
      3. associate-*l/0.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}}\right)\right) \]
      4. associate-*l*0.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \color{blue}{\left(D \cdot \left(\frac{M \cdot 0.5}{d} \cdot \frac{-0.5}{\ell}\right)\right)}}{d}\right)\right) \]
      5. associate-/l*0.0%

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\color{blue}{\left(M \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}\right)\right)}{d}\right)\right) \]
    11. Applied egg-rr63.3%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\frac{\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \left(D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)\right)}{d}}\right)\right) \]
    12. Step-by-step derivation
      1. associate-/l*63.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(D \cdot \left(M \cdot 0.5\right)\right) \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)}\right)\right) \]
      2. associate-*r*63.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\color{blue}{\left(\left(D \cdot M\right) \cdot 0.5\right)} \cdot \frac{D \cdot \left(\left(M \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}\right)}{d}\right)\right)\right) \]
      3. associate-*r*67.4%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}}}{d}\right)\right)\right) \]
      4. associate-*r*69.6%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right)} \cdot \frac{-0.5}{\ell}}{d}\right)\right)\right) \]
    13. Simplified69.6%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \color{blue}{\left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \frac{-0.5}{\ell}}{d}\right)}\right)\right) \]
    14. Taylor expanded in D around 0 69.6%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot M\right) \cdot 0.5\right) \cdot \frac{\color{blue}{-0.25 \cdot \frac{D \cdot M}{d \cdot \ell}}}{d}\right)\right)\right) \]

    if -8.2000000000000001e126 < h < -4.999999999999985e-310

    1. Initial program 73.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. Simplified74.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg72.8%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      2. sqrt-div81.2%

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(1 + h \cdot \left(\left(\left(D \cdot \frac{M \cdot 0.5}{d}\right) \cdot \left(D \cdot \frac{M \cdot 0.5}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
    5. Applied egg-rr82.7%

      \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 85.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if -4.999999999999985e-310 < h

    1. Initial program 72.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. Simplified71.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative71.3%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-div74.5%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. sqrt-div80.8%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. frac-times80.8%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. add-sqr-sqrt80.9%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr80.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Step-by-step derivation
      1. div-inv80.9%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. *-commutative80.9%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      3. metadata-eval80.9%

        \[\leadsto \left(d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h} \cdot \sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      4. sqrt-unprod71.4%

        \[\leadsto \left(d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      5. sqrt-div71.5%

        \[\leadsto \left(d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      6. *-commutative71.5%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      7. inv-pow71.5%

        \[\leadsto \left(\sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      8. sqrt-pow171.5%

        \[\leadsto \left(\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      9. metadata-eval71.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    7. Applied egg-rr71.5%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/75.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times76.8%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. associate-/l*75.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity75.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{\color{blue}{1 \cdot D}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac75.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right)}^{2} \cdot h}{\ell}\right) \]
      6. metadata-eval75.5%

        \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right) \]
    9. Applied egg-rr75.5%

      \[\leadsto \left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -8.2 \cdot 10^{+126}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left(\left(0.5 \cdot \left(D \cdot M\right)\right) \cdot \frac{-0.25 \cdot \frac{D \cdot M}{\ell \cdot d}}{d}\right)\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 49.9% accurate, 1.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -3.25 \cdot 10^{-24}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -3.25e-24)
   (* (- d) (pow (* l h) -0.5))
   (if (<= l -1e-310) (* d (sqrt (/ 1.0 0.0))) (/ d (* (sqrt l) (sqrt h))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -3.25e-24) {
		tmp = -d * pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * sqrt((1.0 / 0.0));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-3.25d-24)) then
        tmp = -d * ((l * h) ** (-0.5d0))
    else if (l <= (-1d-310)) then
        tmp = d * sqrt((1.0d0 / 0.0d0))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -3.25e-24) {
		tmp = -d * Math.pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * Math.sqrt((1.0 / 0.0));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -3.25e-24:
		tmp = -d * math.pow((l * h), -0.5)
	elif l <= -1e-310:
		tmp = d * math.sqrt((1.0 / 0.0))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -3.25e-24)
		tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5));
	elseif (l <= -1e-310)
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -3.25e-24)
		tmp = -d * ((l * h) ^ -0.5);
	elseif (l <= -1e-310)
		tmp = d * sqrt((1.0 / 0.0));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -3.25e-24], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.25 \cdot 10^{-24}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -3.25e-24

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -3.25e-24 < l < -9.999999999999969e-311

    1. Initial program 74.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. Simplified74.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 24.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod52.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]

    if -9.999999999999969e-311 < l

    1. Initial program 72.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. Simplified71.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div47.2%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval47.2%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      3. sqrt-unprod53.3%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative53.3%

        \[\leadsto d \cdot \frac{1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      5. div-inv53.4%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      6. associate-/r*52.7%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    6. Applied egg-rr52.7%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/53.4%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      2. *-commutative53.4%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    8. Simplified53.4%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.25 \cdot 10^{-24}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 43.1% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 1.4 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= M_m 1.4e-26)
   (* (sqrt (/ d h)) (sqrt (/ d l)))
   (* d (sqrt (/ 1.0 0.0)))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (M_m <= 1.4e-26) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = d * sqrt((1.0 / 0.0));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (m_m <= 1.4d-26) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = d * sqrt((1.0d0 / 0.0d0))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (M_m <= 1.4e-26) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = d * Math.sqrt((1.0 / 0.0));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if M_m <= 1.4e-26:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = d * math.sqrt((1.0 / 0.0))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (M_m <= 1.4e-26)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (M_m <= 1.4e-26)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = d * sqrt((1.0 / 0.0));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[M$95$m, 1.4e-26], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 1.4 \cdot 10^{-26}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.4000000000000001e-26

    1. Initial program 70.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified70.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 50.3%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]

    if 1.4000000000000001e-26 < M

    1. Initial program 70.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. Simplified69.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 20.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp21.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative21.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod28.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr28.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 33.0%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.4 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 45.6% accurate, 2.9× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -4.8e-25)
   (* (- d) (pow (* l h) -0.5))
   (if (<= l -1e-310) (* d (sqrt (/ 1.0 0.0))) (/ d (sqrt (* l h))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -4.8e-25) {
		tmp = -d * pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * sqrt((1.0 / 0.0));
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-4.8d-25)) then
        tmp = -d * ((l * h) ** (-0.5d0))
    else if (l <= (-1d-310)) then
        tmp = d * sqrt((1.0d0 / 0.0d0))
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -4.8e-25) {
		tmp = -d * Math.pow((l * h), -0.5);
	} else if (l <= -1e-310) {
		tmp = d * Math.sqrt((1.0 / 0.0));
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -4.8e-25:
		tmp = -d * math.pow((l * h), -0.5)
	elif l <= -1e-310:
		tmp = d * math.sqrt((1.0 / 0.0))
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -4.8e-25)
		tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5));
	elseif (l <= -1e-310)
		tmp = Float64(d * sqrt(Float64(1.0 / 0.0)));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -4.8e-25)
		tmp = -d * ((l * h) ^ -0.5);
	elseif (l <= -1e-310)
		tmp = d * sqrt((1.0 / 0.0));
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -4.8e-25], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1e-310], N[(d * N[Sqrt[N[(1.0 / 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-25}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -4.80000000000000018e-25

    1. Initial program 64.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg53.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified53.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -4.80000000000000018e-25 < l < -9.999999999999969e-311

    1. Initial program 74.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. Simplified74.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 24.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-log-exp38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left(e^{h \cdot \ell}\right)}}} \]
      2. *-commutative38.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \left(e^{\color{blue}{\ell \cdot h}}\right)}} \]
      3. exp-prod52.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{\left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. Taylor expanded in l around 0 52.1%

      \[\leadsto d \cdot \sqrt{\frac{1}{\log \color{blue}{1}}} \]

    if -9.999999999999969e-311 < l

    1. Initial program 72.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. Simplified71.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. pow171.3%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\right)}^{1}} \]
    5. Applied egg-rr80.9%

      \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)\right)}^{1}} \]
    6. Step-by-step derivation
      1. unpow180.9%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)} \]
      2. associate-*l/83.3%

        \[\leadsto \color{blue}{\frac{d \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/l*83.3%

        \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative83.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      5. metadata-eval83.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      6. times-frac83.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      7. *-rgt-identity83.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      8. associate-/l*84.5%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      9. *-commutative84.5%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      10. associate-/l*82.9%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      11. *-commutative82.9%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      12. *-commutative82.9%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{\color{blue}{h \cdot -0.5}}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    7. Simplified82.9%

      \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    8. Taylor expanded in D around 0 47.2%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-147.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval47.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr47.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square47.3%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt47.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr47.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt47.3%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified47.3%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. metadata-eval47.3%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}} \]
      2. sqrt-pow147.2%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-1}}} \]
      3. add-log-exp16.5%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \color{blue}{\log \left(e^{\ell}\right)}\right)}^{-1}} \]
      4. log-pow15.1%

        \[\leadsto d \cdot \sqrt{{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}^{-1}} \]
      5. inv-pow15.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      6. sqrt-div15.1%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      7. metadata-eval15.1%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}} \]
      8. un-div-inv15.1%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      9. log-pow16.5%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \log \left(e^{\ell}\right)}}} \]
      10. add-log-exp47.3%

        \[\leadsto \frac{d}{\sqrt{h \cdot \color{blue}{\ell}}} \]
    12. Applied egg-rr47.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{-25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 42.1% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-192}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -1.55e-192)
   (* (- d) (pow (* l h) -0.5))
   (* d (sqrt (/ (/ 1.0 l) h)))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -1.55e-192) {
		tmp = -d * pow((l * h), -0.5);
	} else {
		tmp = d * sqrt(((1.0 / l) / h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-1.55d-192)) then
        tmp = -d * ((l * h) ** (-0.5d0))
    else
        tmp = d * sqrt(((1.0d0 / l) / h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -1.55e-192) {
		tmp = -d * Math.pow((l * h), -0.5);
	} else {
		tmp = d * Math.sqrt(((1.0 / l) / h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -1.55e-192:
		tmp = -d * math.pow((l * h), -0.5)
	else:
		tmp = d * math.sqrt(((1.0 / l) / h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -1.55e-192)
		tmp = Float64(Float64(-d) * (Float64(l * h) ^ -0.5));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -1.55e-192)
		tmp = -d * ((l * h) ^ -0.5);
	else
		tmp = d * sqrt(((1.0 / l) / h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.55e-192], N[((-d) * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.55 \cdot 10^{-192}:\\
\;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.55e-192

    1. Initial program 68.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified69.0%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow-10.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. metadata-eval0.0%

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. pow-sqr0.0%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. rem-sqrt-square0.0%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. rem-square-sqrt0.0%

        \[\leadsto \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. fabs-sqr0.0%

        \[\leadsto \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. rem-square-sqrt0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      10. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      11. rem-square-sqrt49.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      12. mul-1-neg49.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    7. Simplified49.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -1.55e-192 < l

    1. Initial program 72.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. Simplified71.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 47.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-exp-log45.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{e^{\log \left(\frac{1}{h \cdot \ell}\right)}}} \]
      2. log-rec45.5%

        \[\leadsto d \cdot \sqrt{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}} \]
    6. Applied egg-rr45.5%

      \[\leadsto d \cdot \sqrt{\color{blue}{e^{-\log \left(h \cdot \ell\right)}}} \]
    7. Step-by-step derivation
      1. exp-neg45.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right)}}}} \]
      2. add-exp-log47.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. *-commutative47.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      4. associate-/r*47.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    8. Applied egg-rr47.2%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-192}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 42.1% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.32 \cdot 10^{-192}:\\ \;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -1.32e-192) (/ (- d) (sqrt (* l h))) (* d (sqrt (/ (/ 1.0 l) h)))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -1.32e-192) {
		tmp = -d / sqrt((l * h));
	} else {
		tmp = d * sqrt(((1.0 / l) / h));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-1.32d-192)) then
        tmp = -d / sqrt((l * h))
    else
        tmp = d * sqrt(((1.0d0 / l) / h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -1.32e-192) {
		tmp = -d / Math.sqrt((l * h));
	} else {
		tmp = d * Math.sqrt(((1.0 / l) / h));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -1.32e-192:
		tmp = -d / math.sqrt((l * h))
	else:
		tmp = d * math.sqrt(((1.0 / l) / h))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -1.32e-192)
		tmp = Float64(Float64(-d) / sqrt(Float64(l * h)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -1.32e-192)
		tmp = -d / sqrt((l * h));
	else
		tmp = d * sqrt(((1.0 / l) / h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -1.32e-192], N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.32 \cdot 10^{-192}:\\
\;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.32e-192

    1. Initial program 68.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified69.0%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 11.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt49.2%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. mul-1-neg49.2%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. distribute-rgt-neg-in49.2%

        \[\leadsto \color{blue}{-d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative49.2%

        \[\leadsto -\color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
      7. associate-/r*49.1%

        \[\leadsto -\sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. unpow1/249.1%

        \[\leadsto -\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}} \cdot d \]
      9. associate-/r*49.2%

        \[\leadsto -{\color{blue}{\left(\frac{1}{h \cdot \ell}\right)}}^{0.5} \cdot d \]
      10. rem-exp-log46.4%

        \[\leadsto -{\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot d \]
      11. exp-neg46.4%

        \[\leadsto -{\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot d \]
      12. exp-prod46.4%

        \[\leadsto -\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot d \]
      13. distribute-lft-neg-out46.4%

        \[\leadsto -e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot d \]
      14. exp-neg46.4%

        \[\leadsto -\color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \cdot d \]
      15. exp-to-pow49.1%

        \[\leadsto -\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \cdot d \]
      16. unpow1/249.1%

        \[\leadsto -\frac{1}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot d \]
      17. unpow-149.1%

        \[\leadsto -\color{blue}{{\left(\sqrt{h \cdot \ell}\right)}^{-1}} \cdot d \]
      18. unpow-149.1%

        \[\leadsto -\color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \cdot d \]
      19. associate-*l/49.1%

        \[\leadsto -\color{blue}{\frac{1 \cdot d}{\sqrt{h \cdot \ell}}} \]
    7. Simplified49.1%

      \[\leadsto \color{blue}{\frac{d}{-\sqrt{h \cdot \ell}}} \]

    if -1.32e-192 < l

    1. Initial program 72.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. Simplified71.5%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 47.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. add-exp-log45.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{e^{\log \left(\frac{1}{h \cdot \ell}\right)}}} \]
      2. log-rec45.5%

        \[\leadsto d \cdot \sqrt{e^{\color{blue}{-\log \left(h \cdot \ell\right)}}} \]
    6. Applied egg-rr45.5%

      \[\leadsto d \cdot \sqrt{\color{blue}{e^{-\log \left(h \cdot \ell\right)}}} \]
    7. Step-by-step derivation
      1. exp-neg45.5%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right)}}}} \]
      2. add-exp-log47.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. *-commutative47.1%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      4. associate-/r*47.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    8. Applied egg-rr47.2%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.32 \cdot 10^{-192}:\\ \;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 42.3% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;\ell \leq -3.4 \cdot 10^{-224}:\\ \;\;\;\;\frac{-d}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{t\_0}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (sqrt (* l h)))) (if (<= l -3.4e-224) (/ (- d) t_0) (/ d t_0))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = sqrt((l * h));
	double tmp;
	if (l <= -3.4e-224) {
		tmp = -d / t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((l * h))
    if (l <= (-3.4d-224)) then
        tmp = -d / t_0
    else
        tmp = d / t_0
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.sqrt((l * h));
	double tmp;
	if (l <= -3.4e-224) {
		tmp = -d / t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.sqrt((l * h))
	tmp = 0
	if l <= -3.4e-224:
		tmp = -d / t_0
	else:
		tmp = d / t_0
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = sqrt(Float64(l * h))
	tmp = 0.0
	if (l <= -3.4e-224)
		tmp = Float64(Float64(-d) / t_0);
	else
		tmp = Float64(d / t_0);
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = sqrt((l * h));
	tmp = 0.0;
	if (l <= -3.4e-224)
		tmp = -d / t_0;
	else
		tmp = d / t_0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -3.4e-224], N[((-d) / t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{-224}:\\
\;\;\;\;\frac{-d}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -3.39999999999999992e-224

    1. Initial program 68.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified68.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 13.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Taylor expanded in h around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. unpow20.0%

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      3. rem-square-sqrt48.4%

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. mul-1-neg48.4%

        \[\leadsto d \cdot \color{blue}{\left(-\sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. distribute-rgt-neg-in48.4%

        \[\leadsto \color{blue}{-d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      6. *-commutative48.4%

        \[\leadsto -\color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
      7. associate-/r*48.3%

        \[\leadsto -\sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. unpow1/248.3%

        \[\leadsto -\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}} \cdot d \]
      9. associate-/r*48.4%

        \[\leadsto -{\color{blue}{\left(\frac{1}{h \cdot \ell}\right)}}^{0.5} \cdot d \]
      10. rem-exp-log45.7%

        \[\leadsto -{\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot d \]
      11. exp-neg45.7%

        \[\leadsto -{\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot d \]
      12. exp-prod45.7%

        \[\leadsto -\color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot d \]
      13. distribute-lft-neg-out45.7%

        \[\leadsto -e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot d \]
      14. exp-neg45.7%

        \[\leadsto -\color{blue}{\frac{1}{e^{\log \left(h \cdot \ell\right) \cdot 0.5}}} \cdot d \]
      15. exp-to-pow48.3%

        \[\leadsto -\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{0.5}}} \cdot d \]
      16. unpow1/248.3%

        \[\leadsto -\frac{1}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot d \]
      17. unpow-148.3%

        \[\leadsto -\color{blue}{{\left(\sqrt{h \cdot \ell}\right)}^{-1}} \cdot d \]
      18. unpow-148.3%

        \[\leadsto -\color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \cdot d \]
      19. associate-*l/48.3%

        \[\leadsto -\color{blue}{\frac{1 \cdot d}{\sqrt{h \cdot \ell}}} \]
    7. Simplified48.3%

      \[\leadsto \color{blue}{\frac{d}{-\sqrt{h \cdot \ell}}} \]

    if -3.39999999999999992e-224 < l

    1. Initial program 72.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. Simplified71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. pow171.7%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\right)}^{1}} \]
    5. Applied egg-rr71.6%

      \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)\right)}^{1}} \]
    6. Step-by-step derivation
      1. unpow171.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)} \]
      2. associate-*l/73.7%

        \[\leadsto \color{blue}{\frac{d \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/l*73.6%

        \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      4. *-commutative73.6%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      5. metadata-eval73.6%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      6. times-frac73.6%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      7. *-rgt-identity73.6%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      8. associate-/l*74.7%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      9. *-commutative74.7%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      10. associate-/l*73.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      11. *-commutative73.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
      12. *-commutative73.3%

        \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{\color{blue}{h \cdot -0.5}}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    7. Simplified73.3%

      \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    8. Taylor expanded in D around 0 47.7%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-147.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval47.7%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr47.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square47.7%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt47.6%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr47.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt47.7%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified47.7%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. metadata-eval47.7%

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}} \]
      2. sqrt-pow147.7%

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-1}}} \]
      3. add-log-exp14.6%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \color{blue}{\log \left(e^{\ell}\right)}\right)}^{-1}} \]
      4. log-pow22.1%

        \[\leadsto d \cdot \sqrt{{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}^{-1}} \]
      5. inv-pow22.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      6. sqrt-div22.1%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      7. metadata-eval22.1%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}} \]
      8. un-div-inv22.1%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
      9. log-pow16.1%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \log \left(e^{\ell}\right)}}} \]
      10. add-log-exp47.8%

        \[\leadsto \frac{d}{\sqrt{h \cdot \color{blue}{\ell}}} \]
    12. Applied egg-rr47.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.4 \cdot 10^{-224}:\\ \;\;\;\;\frac{-d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 26.6% accurate, 3.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (/ d (sqrt (* l h))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d / sqrt((l * h));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d / sqrt((l * h))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d / Math.sqrt((l * h));
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d / math.sqrt((l * h))
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d / sqrt(Float64(l * h)))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d / sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Derivation
  1. Initial program 70.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. Simplified70.4%

    \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. pow170.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\right)}^{1}} \]
  5. Applied egg-rr38.6%

    \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)\right)}^{1}} \]
  6. Step-by-step derivation
    1. unpow138.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)} \]
    2. associate-*l/39.7%

      \[\leadsto \color{blue}{\frac{d \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    3. associate-/l*39.7%

      \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    4. *-commutative39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    5. metadata-eval39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    6. times-frac39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    7. *-rgt-identity39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    8. associate-/l*40.3%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    9. *-commutative40.3%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    10. associate-/l*39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    11. *-commutative39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    12. *-commutative39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{\color{blue}{h \cdot -0.5}}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
  7. Simplified39.5%

    \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
  8. Taylor expanded in D around 0 31.7%

    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
  9. Step-by-step derivation
    1. unpow-131.7%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
    2. metadata-eval31.7%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr31.7%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square31.4%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. rem-square-sqrt31.3%

      \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
    6. fabs-sqr31.3%

      \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
    7. rem-square-sqrt31.4%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  10. Simplified31.4%

    \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  11. Step-by-step derivation
    1. metadata-eval31.4%

      \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}} \]
    2. sqrt-pow131.7%

      \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-1}}} \]
    3. add-log-exp11.1%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \color{blue}{\log \left(e^{\ell}\right)}\right)}^{-1}} \]
    4. log-pow23.4%

      \[\leadsto d \cdot \sqrt{{\color{blue}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}^{-1}} \]
    5. inv-pow23.4%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    6. sqrt-div23.4%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    7. metadata-eval23.4%

      \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}} \]
    8. un-div-inv23.4%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\log \left({\left(e^{\ell}\right)}^{h}\right)}}} \]
    9. log-pow13.8%

      \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \log \left(e^{\ell}\right)}}} \]
    10. add-log-exp31.4%

      \[\leadsto \frac{d}{\sqrt{h \cdot \color{blue}{\ell}}} \]
  12. Applied egg-rr31.4%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  13. Final simplification31.4%

    \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
  14. Add Preprocessing

Alternative 22: 4.0% accurate, 3.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ d \cdot \sqrt{\ell \cdot h} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (* d (sqrt (* l h))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d * sqrt((l * h));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d * sqrt((l * h))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d * Math.sqrt((l * h));
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d * math.sqrt((l * h))
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d * sqrt(Float64(l * h)))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d * sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d * N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
d \cdot \sqrt{\ell \cdot h}
\end{array}
Derivation
  1. Initial program 70.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. Simplified70.4%

    \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. pow170.4%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\right)}^{1}} \]
  5. Applied egg-rr38.6%

    \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)\right)}^{1}} \]
  6. Step-by-step derivation
    1. unpow138.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)} \]
    2. associate-*l/39.7%

      \[\leadsto \color{blue}{\frac{d \cdot \mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    3. associate-/l*39.7%

      \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
    4. *-commutative39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    5. metadata-eval39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    6. times-frac39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \color{blue}{\frac{D \cdot 1}{d \cdot 2}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    7. *-rgt-identity39.7%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(M \cdot \frac{\color{blue}{D}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    8. associate-/l*40.3%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(\frac{M \cdot D}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    9. *-commutative40.3%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(\frac{\color{blue}{D \cdot M}}{d \cdot 2}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    10. associate-/l*39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    11. *-commutative39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}, \frac{-0.5 \cdot h}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
    12. *-commutative39.5%

      \[\leadsto d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{\color{blue}{h \cdot -0.5}}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}} \]
  7. Simplified39.5%

    \[\leadsto \color{blue}{d \cdot \frac{\mathsf{fma}\left({\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}, \frac{h \cdot -0.5}{\ell}, 1\right)}{\sqrt{h} \cdot \sqrt{\ell}}} \]
  8. Taylor expanded in D around 0 31.7%

    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
  9. Step-by-step derivation
    1. unpow-131.7%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
    2. metadata-eval31.7%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr31.7%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square31.4%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. rem-square-sqrt31.3%

      \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
    6. fabs-sqr31.3%

      \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
    7. rem-square-sqrt31.4%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  10. Simplified31.4%

    \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  11. Step-by-step derivation
    1. metadata-eval31.4%

      \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(-1 \cdot 0.5\right)}} \]
    2. pow-pow31.7%

      \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{-1}\right)}^{0.5}} \]
    3. inv-pow31.7%

      \[\leadsto d \cdot {\color{blue}{\left(\frac{1}{h \cdot \ell}\right)}}^{0.5} \]
    4. associate-/r*31.7%

      \[\leadsto d \cdot {\color{blue}{\left(\frac{\frac{1}{h}}{\ell}\right)}}^{0.5} \]
    5. metadata-eval31.7%

      \[\leadsto d \cdot {\left(\frac{\frac{1}{h}}{\ell}\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}} \]
    6. pow-pow29.4%

      \[\leadsto d \cdot \color{blue}{{\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    7. pow1/330.3%

      \[\leadsto d \cdot \color{blue}{\sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}} \]
    8. pow130.3%

      \[\leadsto \color{blue}{{\left(d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\right)}^{1}} \]
  12. Applied egg-rr3.1%

    \[\leadsto \color{blue}{{\left(d \cdot \sqrt{h \cdot \ell}\right)}^{1}} \]
  13. Step-by-step derivation
    1. unpow13.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{h \cdot \ell}} \]
  14. Simplified3.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{h \cdot \ell}} \]
  15. Final simplification3.1%

    \[\leadsto d \cdot \sqrt{\ell \cdot h} \]
  16. Add Preprocessing

Reproduce

?
herbie shell --seed 2024136 
(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)))))