Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.5% → 81.1%
Time: 32.3s
Alternatives: 38
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 38 alternatives:

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

Initial Program: 65.5% accurate, 1.0× speedup?

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

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

Alternative 1: 81.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 48.4%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr55.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{M \cdot h}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{1}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(M \cdot h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6443.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr43.4%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. --lowering--.f6465.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr65.1%

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

    if -5.4999999999999996e83 < h < -6.50000000000000019e-149

    1. Initial program 81.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. Simplified77.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. --lowering--.f6492.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    6. Simplified92.5%

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

    if -6.50000000000000019e-149 < h < -4.999999999999985e-310

    1. Initial program 67.7%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr73.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. --lowering--.f6484.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr84.7%

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

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6480.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr80.9%

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

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

Alternative 2: 80.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 45.4%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      2. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \left(\sqrt{\frac{d}{\ell}}\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      3. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\left(\sqrt{\mathsf{neg}\left(d\right)}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\left(\frac{1}{2}\right)}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \left(\frac{1}{2}\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      9. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \left(\frac{1}{2}\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \left(\frac{1}{2}\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      12. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(\ell\right)\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(\ell\right)\right)}^{\left(\frac{1}{2}\right)}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      14. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right), \left(\frac{1}{2}\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - \ell\right), \left(\frac{1}{2}\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\frac{1}{2}\right)\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
      17. metadata-eval76.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \frac{1}{2}\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, 2\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(2, d\right)\right), 2\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right)\right)\right) \]
    4. Applied egg-rr76.1%

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

    if -3.0000000000000001e206 < l < -4.999999999999985e-310

    1. Initial program 71.7%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr73.7%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot 1}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(0 - d\right) \cdot 1}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(0 - d\right) \cdot 1}}{{\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\left(0 - d\right) \cdot 1}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\left(0 - d\right) \cdot 1\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\left(\mathsf{neg}\left(d\right)\right) \cdot 1\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. --lowering--.f6486.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr86.3%

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

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6480.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr80.9%

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

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

Alternative 3: 79.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 35.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. Simplified44.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr44.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{M \cdot h}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{1}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(M \cdot h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6431.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr31.6%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. --lowering--.f6469.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr69.4%

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

    if -3.50000000000000013e198 < h < -4.999999999999985e-310

    1. Initial program 74.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. Simplified73.3%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\color{blue}{d}, h\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\color{blue}{d}, h\right)\right)\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      7. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      9. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(\ell\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - \ell\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
      12. --lowering--.f6484.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right)\right) \]
    6. Applied egg-rr84.8%

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

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6480.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr80.9%

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

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

Alternative 4: 79.9% accurate, 1.0× speedup?

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

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

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


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

    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. Simplified70.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr70.6%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot 1}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(0 - d\right) \cdot 1}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\left(0 - d\right) \cdot 1}}{{\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\left(0 - d\right) \cdot 1}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\left(0 - d\right) \cdot 1\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\left(\mathsf{neg}\left(d\right)\right) \cdot 1\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. --lowering--.f6483.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr83.2%

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

    if -4.1999999999999998e-281 < d < 1.7999999999999999e-210

    1. Initial program 32.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. Simplified21.2%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6443.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr43.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified47.6%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \frac{D \cdot h}{d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{M \cdot D}{d}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{1}{\frac{d}{M \cdot D}}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{M \cdot D}\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \mathsf{*.f64}\left(4, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    10. Applied egg-rr47.2%

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

    if 1.7999999999999999e-210 < d

    1. Initial program 73.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. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr73.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6487.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr87.1%

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

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

Alternative 5: 80.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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. Simplified81.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr81.1%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(d\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(0 - d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. --lowering--.f6490.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, d\right), \frac{1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr90.7%

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

    if -6.19999999999999968e-44 < d < -9.999999999999969e-311

    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. Simplified53.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr53.5%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6465.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified65.8%

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

    if -9.999999999999969e-311 < d < 9.9999999999999995e-214

    1. Initial program 31.2%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6456.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr56.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6461.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified61.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \frac{D \cdot h}{d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{M \cdot D}{d}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{1}{\frac{d}{M \cdot D}}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{M \cdot D}\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6455.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \mathsf{*.f64}\left(4, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    10. Applied egg-rr55.7%

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

    if 9.9999999999999995e-214 < d

    1. Initial program 73.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. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr73.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6487.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr87.1%

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

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

Alternative 6: 77.9% accurate, 1.3× speedup?

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

\mathbf{elif}\;h \leq -2.4 \cdot 10^{-219}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(t\_1 \cdot \frac{D\_m}{d}\right)\right)\\

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

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


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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr46.9%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{M \cdot h}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{1}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(M \cdot h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6433.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr33.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)} \cdot \frac{d}{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(0 - d\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      14. --lowering--.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr57.2%

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

    if -1.15000000000000008e165 < h < -2.40000000000000014e-219

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(M \cdot \left(\frac{\frac{M \cdot D}{d}}{4} \cdot h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{d}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{D}\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6474.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr74.7%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. --lowering--.f6485.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified85.5%

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

    if -2.40000000000000014e-219 < h < -4.999999999999985e-310

    1. Initial program 71.3%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-unprodN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{d}{h} \cdot \left(\mathsf{neg}\left(d\right)\right)}{\mathsf{neg}\left(\ell\right)}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{\frac{d}{h} \cdot \left(\mathsf{neg}\left(d\right)\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \left(\mathsf{neg}\left(d\right)\right)}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \left(\mathsf{neg}\left(d\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{h}\right), \left(\mathsf{neg}\left(d\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\mathsf{neg}\left(d\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(0 - d\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \left({\left(\mathsf{neg}\left(\ell\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \left({\left(\mathsf{neg}\left(\ell\right)\right)}^{\left(\frac{1}{2}\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right), \left(\frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \mathsf{pow.f64}\left(\left(0 - \ell\right), \left(\frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      15. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \left(\frac{1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      16. metadata-eval79.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{\_.f64}\left(0, d\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \ell\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr79.7%

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

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6480.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr80.9%

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

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

Alternative 7: 77.7% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 77.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. Simplified79.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr81.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr83.4%

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

    if -1.35e-107 < d < -9.999999999999969e-311

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr46.8%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6467.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified67.3%

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

    if -9.999999999999969e-311 < d < 3.5999999999999999e-210

    1. Initial program 31.2%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6456.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr56.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6461.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified61.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \frac{D \cdot h}{d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{M \cdot D}{d}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{1}{\frac{d}{M \cdot D}}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{M \cdot D}\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6455.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \mathsf{*.f64}\left(4, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    10. Applied egg-rr55.7%

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

    if 3.5999999999999999e-210 < d

    1. Initial program 73.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. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr73.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6487.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr87.1%

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

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

Alternative 8: 76.0% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 77.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. Simplified79.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr81.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr83.4%

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

    if -1.3999999999999999e-107 < d < -9.999999999999969e-311

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr46.8%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6467.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified67.3%

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

    if -9.999999999999969e-311 < d < 4.20000000000000032e-210

    1. Initial program 31.2%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6456.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr56.4%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6461.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified61.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \frac{D \cdot h}{d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{M \cdot D}{d}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot \frac{1}{\frac{d}{M \cdot D}}\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{M \cdot D}\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \left(D \cdot h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \left(4 \cdot d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6455.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{*.f64}\left(D, h\right)\right), \mathsf{*.f64}\left(4, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    10. Applied egg-rr55.7%

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

    if 4.20000000000000032e-210 < d

    1. Initial program 73.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. Simplified71.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr75.2%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6477.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr77.1%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{{h}^{\frac{1}{2}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. frac-timesN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left({h}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left({h}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. sqrt-lowering-sqrt.f6489.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr89.1%

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

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

Alternative 9: 78.9% accurate, 1.4× speedup?

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

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

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


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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr46.9%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{M \cdot h}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{1}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(M \cdot h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6433.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr33.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)} \cdot \frac{d}{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{neg}\left(d\right)\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(0 - d\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \left(\frac{d}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \left({\left(\mathsf{neg}\left(h\right)\right)}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(h\right)\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(0 - h\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      14. --lowering--.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, d\right), \mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, h\right), \frac{1}{2}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr57.2%

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

    if -6.8000000000000002e164 < h < -4.999999999999985e-310

    1. Initial program 75.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. Simplified74.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(M \cdot \left(\frac{\frac{M \cdot D}{d}}{4} \cdot h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{d}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{D}\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6475.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr75.9%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. --lowering--.f6482.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified82.0%

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

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6480.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr80.9%

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

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

Alternative 10: 76.6% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -4.999999999999985e-310

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr68.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6472.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified72.2%

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

    if -4.999999999999985e-310 < h < 3.0999999999999998e68

    1. Initial program 71.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. Simplified69.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr69.4%

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

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

    if 3.0999999999999998e68 < h

    1. Initial program 60.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. Simplified54.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr58.8%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr63.6%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{{h}^{\frac{1}{2}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. frac-timesN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left({h}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left({h}^{\frac{1}{2}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. sqrt-lowering-sqrt.f6485.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr85.6%

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

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

Alternative 11: 75.0% accurate, 1.5× speedup?

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

\mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+134}:\\
\;\;\;\;\frac{1 + \frac{\frac{-0.5}{\ell} \cdot \frac{\frac{h}{d} \cdot \frac{M\_m}{\frac{1}{D\_m}}}{\frac{d}{M\_m \cdot D\_m}}}{4}}{\frac{\sqrt{\ell \cdot h}}{d}}\\

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


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

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr68.0%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6472.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified72.2%

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

    if -4.999999999999985e-310 < l < 5.4999999999999999e134

    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. Simplified69.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6483.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr83.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6483.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified83.0%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(D \cdot \frac{h}{d}\right)\right) \cdot \frac{\frac{-1}{2}}{\ell}\right), \color{blue}{\left(\frac{\sqrt{\ell \cdot h}}{d}\right)}\right) \]
    10. Applied egg-rr85.3%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\left(\frac{h \cdot M}{\frac{d}{D}}\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d \cdot \frac{1}{D}}\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      3. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\left(\frac{h}{d} \cdot \frac{M}{\frac{1}{D}}\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(\frac{M}{\frac{1}{D}}\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(\frac{M}{\frac{1}{D}}\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{/.f64}\left(M, \left(\frac{1}{D}\right)\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      7. /-lowering-/.f6488.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{/.f64}\left(M, \mathsf{/.f64}\left(1, D\right)\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
    12. Applied egg-rr88.7%

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

    if 5.4999999999999999e134 < l

    1. Initial program 57.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. Simplified53.3%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6450.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified50.8%

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

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

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

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

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

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
      6. associate-/r*N/A

        \[\leadsto \frac{\frac{d}{\sqrt{\ell}}}{\color{blue}{\sqrt{h}}} \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{d}{\sqrt{\ell}}\right), \color{blue}{\left(\sqrt{h}\right)}\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell}\right)\right), \left(\sqrt{\color{blue}{h}}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \left(\sqrt{h}\right)\right) \]
      10. sqrt-lowering-sqrt.f6464.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\ell\right)\right), \mathsf{sqrt.f64}\left(h\right)\right) \]
    8. Applied egg-rr64.4%

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

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

Alternative 12: 66.9% accurate, 2.4× speedup?

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

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -4.24999999999999998e40 < l < -4.999999999999985e-310

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr76.8%

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. /-lowering-/.f6461.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr61.8%

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

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. clear-numN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr72.5%

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

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

Alternative 13: 46.5% accurate, 2.4× speedup?

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

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

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

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


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

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

    if -8.8000000000000005e-178 < l < -4.999999999999985e-310

    1. Initial program 85.7%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr85.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr85.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right), \color{blue}{\left(\frac{{D}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
    10. Simplified66.7%

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

    if -4.999999999999985e-310 < l < 4.3999999999999998e-81

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6484.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr84.9%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6484.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified84.8%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(D \cdot \frac{h}{d}\right)\right) \cdot \frac{\frac{-1}{2}}{\ell}\right), \color{blue}{\left(\frac{\sqrt{\ell \cdot h}}{d}\right)}\right) \]
    10. Applied egg-rr89.2%

      \[\leadsto \color{blue}{\frac{1 + \frac{\frac{-0.5}{\ell} \cdot \frac{\frac{M \cdot h}{\frac{d}{D}}}{\frac{d}{M \cdot D}}}{4}}{\frac{\sqrt{\ell \cdot h}}{d}}} \]
    11. Taylor expanded in l around 0

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right), \ell\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)}, d\right)\right) \]
    13. Simplified56.3%

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

    if 4.3999999999999998e-81 < l

    1. Initial program 67.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr47.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -8.8 \cdot 10^{-178}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.125 \cdot \left(\left(M \cdot M\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{D \cdot D}{0 - d}\right)\right)\\ \mathbf{elif}\;\ell \leq 4.4 \cdot 10^{-81}:\\ \;\;\;\;\frac{\frac{\frac{\frac{-0.125 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d}}{d}}{\ell}}{\frac{\sqrt{\ell \cdot h}}{d}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 66.6% accurate, 2.4× speedup?

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

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

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


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -5.2000000000000001e40 < l < -4.999999999999985e-310

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6480.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr80.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. /-lowering-/.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr65.4%

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

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. clear-numN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr72.5%

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

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

Alternative 15: 65.2% accurate, 2.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{\frac{-0.5}{\ell} \cdot \frac{\frac{M\_m \cdot D\_m}{\frac{d}{h}}}{\frac{d}{M\_m \cdot D\_m}}}{4}}{\frac{\sqrt{\ell \cdot h}}{d}}\\


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -7.4e40 < l < 1.65e-307

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6480.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr80.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. /-lowering-/.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr65.4%

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

    if 1.65e-307 < l

    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. Simplified63.9%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell} \cdot \sqrt{h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\ell \cdot h}\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f6470.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr70.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \color{blue}{\left(\frac{D \cdot h}{d}\right)}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \left(D \cdot \frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \left(\frac{h}{d}\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. /-lowering-/.f6470.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(h, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified70.8%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(D \cdot \frac{h}{d}\right)\right) \cdot \frac{\frac{-1}{2}}{\ell}\right), \color{blue}{\left(\frac{\sqrt{\ell \cdot h}}{d}\right)}\right) \]
    10. Applied egg-rr73.1%

      \[\leadsto \color{blue}{\frac{1 + \frac{\frac{-0.5}{\ell} \cdot \frac{\frac{M \cdot h}{\frac{d}{D}}}{\frac{d}{M \cdot D}}}{4}}{\frac{\sqrt{\ell \cdot h}}{d}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\left(\left(M \cdot D\right) \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\left(\left(M \cdot D\right) \cdot \frac{1}{\frac{d}{h}}\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      7. un-div-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(\frac{d}{h}\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
      10. /-lowering-/.f6475.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{/.f64}\left(d, h\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), 4\right)\right), \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right), d\right)\right) \]
    12. Applied egg-rr75.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -7.4 \cdot 10^{+40}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq 1.65 \cdot 10^{-307}:\\ \;\;\;\;\left(1 + -0.125 \cdot \frac{\frac{M}{\frac{d}{D}} \cdot \left(\left(M \cdot D\right) \cdot \frac{h}{d}\right)}{\ell}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \frac{\frac{-0.5}{\ell} \cdot \frac{\frac{M \cdot D}{\frac{d}{h}}}{\frac{d}{M \cdot D}}}{4}}{\frac{\sqrt{\ell \cdot h}}{d}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 66.3% accurate, 2.4× speedup?

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

\mathbf{elif}\;\ell \leq 3 \cdot 10^{-309}:\\
\;\;\;\;\left(1 + -0.125 \cdot \frac{t\_0 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \frac{h}{d}\right)}{\ell}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -7.69999999999999964e40 < l < 3.000000000000001e-309

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6480.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr80.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. /-lowering-/.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr65.4%

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

    if 3.000000000000001e-309 < l

    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. Simplified63.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(M \cdot \left(\frac{\frac{M \cdot D}{d}}{4} \cdot h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{d}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{D}\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6466.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr66.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)\right)\right)} \cdot \frac{-0.5}{\ell}\right) \]
    6. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. *-lowering-*.f6473.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Applied egg-rr73.1%

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

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

Alternative 17: 66.2% accurate, 2.4× speedup?

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

\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-305}:\\
\;\;\;\;\left(1 + -0.125 \cdot \frac{t\_0 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \frac{h}{d}\right)}{\ell}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -5.80000000000000035e40 < l < 2.19999999999999997e-305

    1. Initial program 78.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. Simplified79.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr78.2%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr80.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      13. /-lowering-/.f6465.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr65.8%

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

    if 2.19999999999999997e-305 < l

    1. Initial program 67.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. Simplified63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.8 \cdot 10^{+40}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-305}:\\ \;\;\;\;\left(1 + -0.125 \cdot \frac{\frac{M}{\frac{d}{D}} \cdot \left(\left(M \cdot D\right) \cdot \frac{h}{d}\right)}{\ell}\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{-0.125}{\frac{\frac{\ell}{\frac{M}{\frac{d}{D}}}}{\frac{h \cdot M}{\frac{d}{D}}}}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 64.6% accurate, 2.4× speedup?

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

\mathbf{elif}\;\ell \leq 6 \cdot 10^{-274}:\\
\;\;\;\;\left(1 + -0.125 \cdot \frac{t\_0 \cdot \left(M\_m \cdot \frac{h}{\frac{d}{D\_m}}\right)}{\ell}\right) \cdot \sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\

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


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

    1. Initial program 51.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. Simplified50.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6458.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified58.6%

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

    if -6.79999999999999977e40 < l < 5.99999999999999954e-274

    1. Initial program 78.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. Simplified79.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr78.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{\frac{M}{\frac{d}{D}} \cdot \left(M \cdot \frac{h}{\frac{d}{D}}\right)}{\ell} \cdot -0.125}\right) \]
    6. Step-by-step derivation
      1. sqrt-unprodN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d \cdot \frac{d}{\ell}}{h}\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \frac{d}{\ell}\right), h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(\frac{d}{\ell}\right)\right), h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6460.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \ell\right)\right), h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, D\right)\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr60.4%

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

    if 5.99999999999999954e-274 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.8 \cdot 10^{+40}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq 6 \cdot 10^{-274}:\\ \;\;\;\;\left(1 + -0.125 \cdot \frac{\frac{M}{\frac{d}{D}} \cdot \left(M \cdot \frac{h}{\frac{d}{D}}\right)}{\ell}\right) \cdot \sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{-0.125}{\frac{\frac{\ell}{\frac{M}{\frac{d}{D}}}}{\frac{h \cdot M}{\frac{d}{D}}}}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 60.7% accurate, 2.5× speedup?

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

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

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


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

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

    if -7.19999999999999965e-177 < l < -4.999999999999985e-310

    1. Initial program 85.7%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr85.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr85.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right), \color{blue}{\left(\frac{{D}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
    10. Simplified66.7%

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

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 59.0% accurate, 2.5× speedup?

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

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

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


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

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

    if -6.00000000000000015e-177 < l < -4.999999999999985e-310

    1. Initial program 85.7%

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr85.6%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr85.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right), \color{blue}{\left(\frac{{D}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
    10. Simplified66.7%

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

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr67.7%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(D \cdot M\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6469.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr69.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Step-by-step derivation
      1. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d \cdot d}{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. *-lowering-*.f6474.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}{\ell} \cdot -0.125\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6 \cdot 10^{-177}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.125 \cdot \left(\left(M \cdot M\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{D \cdot D}{0 - d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.125 \cdot \frac{\frac{M}{\frac{d}{D}} \cdot \left(\left(M \cdot D\right) \cdot \frac{h}{d}\right)}{\ell}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 46.6% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{-176}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \left(t\_0 \cdot \frac{D\_m \cdot D\_m}{0 - d}\right)\right)\\ \mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-81}:\\ \;\;\;\;\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot \left(-0.125 \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ h (* l (* l l))))))
   (if (<= l -1e-176)
     (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
     (if (<= l -5e-310)
       (* -0.125 (* (* M_m M_m) (* t_0 (/ (* D_m D_m) (- 0.0 d)))))
       (if (<= l 6.2e-81)
         (* (* D_m (* D_m (/ (* M_m M_m) d))) (* -0.125 t_0))
         (* d (sqrt (/ (/ 1.0 h) l))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((h / (l * (l * l))));
	double tmp;
	if (l <= -1e-176) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = -0.125 * ((M_m * M_m) * (t_0 * ((D_m * D_m) / (0.0 - d))));
	} else if (l <= 6.2e-81) {
		tmp = (D_m * (D_m * ((M_m * M_m) / d))) * (-0.125 * t_0);
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((h / (l * (l * l))))
    if (l <= (-1d-176)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-5d-310)) then
        tmp = (-0.125d0) * ((m_m * m_m) * (t_0 * ((d_m * d_m) / (0.0d0 - d))))
    else if (l <= 6.2d-81) then
        tmp = (d_m * (d_m * ((m_m * m_m) / d))) * ((-0.125d0) * t_0)
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((h / (l * (l * l))));
	double tmp;
	if (l <= -1e-176) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = -0.125 * ((M_m * M_m) * (t_0 * ((D_m * D_m) / (0.0 - d))));
	} else if (l <= 6.2e-81) {
		tmp = (D_m * (D_m * ((M_m * M_m) / d))) * (-0.125 * t_0);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((h / (l * (l * l))))
	tmp = 0
	if l <= -1e-176:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -5e-310:
		tmp = -0.125 * ((M_m * M_m) * (t_0 * ((D_m * D_m) / (0.0 - d))))
	elif l <= 6.2e-81:
		tmp = (D_m * (D_m * ((M_m * M_m) / d))) * (-0.125 * t_0)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
	tmp = 0.0
	if (l <= -1e-176)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -5e-310)
		tmp = Float64(-0.125 * Float64(Float64(M_m * M_m) * Float64(t_0 * Float64(Float64(D_m * D_m) / Float64(0.0 - d)))));
	elseif (l <= 6.2e-81)
		tmp = Float64(Float64(D_m * Float64(D_m * Float64(Float64(M_m * M_m) / d))) * Float64(-0.125 * t_0));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((h / (l * (l * l))));
	tmp = 0.0;
	if (l <= -1e-176)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -5e-310)
		tmp = -0.125 * ((M_m * M_m) * (t_0 * ((D_m * D_m) / (0.0 - d))));
	elseif (l <= 6.2e-81)
		tmp = (D_m * (D_m * ((M_m * M_m) / d))) * (-0.125 * t_0);
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e-176], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(-0.125 * N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(t$95$0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] / N[(0.0 - d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.2e-81], N[(N[(D$95$m * N[(D$95$m * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-176}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \left(t\_0 \cdot \frac{D\_m \cdot D\_m}{0 - d}\right)\right)\\

\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-81}:\\
\;\;\;\;\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot \left(-0.125 \cdot t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1e-176

    1. Initial program 63.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -1e-176 < l < -4.999999999999985e-310

    1. Initial program 85.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified90.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \color{blue}{\frac{\frac{1}{4}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{\frac{1}{4}}{\mathsf{neg}\left(\color{blue}{2}\right)}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{\frac{1}{4}}{-2}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\frac{1}{2}}^{\color{blue}{3}}\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr85.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{\frac{M}{\frac{d}{D}} \cdot \left(M \cdot \frac{h}{\frac{d}{D}}\right)}{\ell} \cdot -0.125}\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{\frac{d}{D}} \cdot M\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(\frac{h}{d} \cdot D\right) \cdot M\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(D \cdot M\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(\frac{h}{d}\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \left(M \cdot D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, d\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr85.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot D\right)\right)}}{\ell} \cdot -0.125\right) \]
    8. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\frac{\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{\color{blue}{d}}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\frac{\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot {D}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{d}\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\frac{\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}{d}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\frac{\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{d}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \color{blue}{\frac{\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}}{d}}\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\frac{{D}^{2}}{d}}\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \left(\frac{{D}^{2}}{d} \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right), \color{blue}{\left(\frac{{D}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
    10. Simplified66.7%

      \[\leadsto \color{blue}{-0.125 \cdot \left(\left(0 - M \cdot M\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{D \cdot D}{d}\right)\right)} \]

    if -4.999999999999985e-310 < l < 6.19999999999999976e-81

    1. Initial program 67.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. Simplified63.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-*l*N/A

        \[\leadsto \frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{D}^{2} \cdot {M}^{2}}{d}\right), \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\left(D \cdot D\right) \cdot {M}^{2}}{d}\right), \left(\sqrt{\frac{\color{blue}{h}}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{D \cdot \left(D \cdot {M}^{2}\right)}{d}\right), \left(\sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(D \cdot \frac{D \cdot {M}^{2}}{d}\right), \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\frac{D \cdot {M}^{2}}{d}\right)\right), \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \frac{{M}^{2}}{d}\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(\frac{{M}^{2}}{d}\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left({M}^{2}\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left(M \cdot M\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \left(\frac{-1}{8} \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}}\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right)\right)\right) \]
      17. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right)\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right)\right)\right) \]
      20. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right)\right)\right) \]
      21. *-lowering-*.f6458.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right) \]
    6. Simplified58.0%

      \[\leadsto \color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)} \]

    if 6.19999999999999976e-81 < l

    1. Initial program 67.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr47.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-176}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.125 \cdot \left(\left(M \cdot M\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{D \cdot D}{0 - d}\right)\right)\\ \mathbf{elif}\;\ell \leq 6.2 \cdot 10^{-81}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 45.6% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_1 := D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-180}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot 0.125\right)\\ \mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-81}:\\ \;\;\;\;t\_1 \cdot \left(-0.125 \cdot t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ h (* l (* l l)))))
        (t_1 (* D_m (* D_m (/ (* M_m M_m) d)))))
   (if (<= l -5e-180)
     (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
     (if (<= l -2.25e-285)
       (* t_0 (* t_1 0.125))
       (if (<= l 6.8e-81)
         (* t_1 (* -0.125 t_0))
         (* d (sqrt (/ (/ 1.0 h) l))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((h / (l * (l * l))));
	double t_1 = D_m * (D_m * ((M_m * M_m) / d));
	double tmp;
	if (l <= -5e-180) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -2.25e-285) {
		tmp = t_0 * (t_1 * 0.125);
	} else if (l <= 6.8e-81) {
		tmp = t_1 * (-0.125 * t_0);
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt((h / (l * (l * l))))
    t_1 = d_m * (d_m * ((m_m * m_m) / d))
    if (l <= (-5d-180)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-2.25d-285)) then
        tmp = t_0 * (t_1 * 0.125d0)
    else if (l <= 6.8d-81) then
        tmp = t_1 * ((-0.125d0) * t_0)
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((h / (l * (l * l))));
	double t_1 = D_m * (D_m * ((M_m * M_m) / d));
	double tmp;
	if (l <= -5e-180) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -2.25e-285) {
		tmp = t_0 * (t_1 * 0.125);
	} else if (l <= 6.8e-81) {
		tmp = t_1 * (-0.125 * t_0);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((h / (l * (l * l))))
	t_1 = D_m * (D_m * ((M_m * M_m) / d))
	tmp = 0
	if l <= -5e-180:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -2.25e-285:
		tmp = t_0 * (t_1 * 0.125)
	elif l <= 6.8e-81:
		tmp = t_1 * (-0.125 * t_0)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
	t_1 = Float64(D_m * Float64(D_m * Float64(Float64(M_m * M_m) / d)))
	tmp = 0.0
	if (l <= -5e-180)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -2.25e-285)
		tmp = Float64(t_0 * Float64(t_1 * 0.125));
	elseif (l <= 6.8e-81)
		tmp = Float64(t_1 * Float64(-0.125 * t_0));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((h / (l * (l * l))));
	t_1 = D_m * (D_m * ((M_m * M_m) / d));
	tmp = 0.0;
	if (l <= -5e-180)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -2.25e-285)
		tmp = t_0 * (t_1 * 0.125);
	elseif (l <= 6.8e-81)
		tmp = t_1 * (-0.125 * t_0);
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(D$95$m * N[(D$95$m * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e-180], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.25e-285], N[(t$95$0 * N[(t$95$1 * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.8e-81], N[(t$95$1 * N[(-0.125 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-180}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot 0.125\right)\\

\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-81}:\\
\;\;\;\;t\_1 \cdot \left(-0.125 \cdot t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.0000000000000001e-180

    1. Initial program 63.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -5.0000000000000001e-180 < l < -2.2500000000000001e-285

    1. Initial program 85.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. Simplified89.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    6. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)} \]

    if -2.2500000000000001e-285 < l < 6.7999999999999997e-81

    1. Initial program 67.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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-*l*N/A

        \[\leadsto \frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{D}^{2} \cdot {M}^{2}}{d}\right), \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)}\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\left(D \cdot D\right) \cdot {M}^{2}}{d}\right), \left(\sqrt{\frac{\color{blue}{h}}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{D \cdot \left(D \cdot {M}^{2}\right)}{d}\right), \left(\sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(D \cdot \frac{D \cdot {M}^{2}}{d}\right), \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\frac{D \cdot {M}^{2}}{d}\right)\right), \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \frac{-1}{8}\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \frac{{M}^{2}}{d}\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(\frac{{M}^{2}}{d}\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left({M}^{2}\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left(M \cdot M\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-1}{8}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \left(\frac{-1}{8} \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}}\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}}\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right)\right)\right) \]
      17. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right)\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right)\right)\right) \]
      20. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right)\right)\right) \]
      21. *-lowering-*.f6456.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right) \]
    6. Simplified56.7%

      \[\leadsto \color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)} \]

    if 6.7999999999999997e-81 < l

    1. Initial program 67.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr47.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-180}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{elif}\;\ell \leq 6.8 \cdot 10^{-81}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 45.7% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -3.4 \cdot 10^{-177}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{elif}\;\ell \leq 2.35 \cdot 10^{-81}:\\ \;\;\;\;\left(D\_m \cdot D\_m\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \frac{-0.125 \cdot \left(M\_m \cdot M\_m\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -3.4e-177)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
   (if (<= l -2.25e-285)
     (* (sqrt (/ h (* l (* l l)))) (* (* D_m (* D_m (/ (* M_m M_m) d))) 0.125))
     (if (<= l 2.35e-81)
       (*
        (* D_m D_m)
        (* (sqrt (/ (/ h (* l l)) l)) (/ (* -0.125 (* M_m M_m)) d)))
       (* d (sqrt (/ (/ 1.0 h) l)))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -3.4e-177) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -2.25e-285) {
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	} else if (l <= 2.35e-81) {
		tmp = (D_m * D_m) * (sqrt(((h / (l * l)) / l)) * ((-0.125 * (M_m * M_m)) / d));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-3.4d-177)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-2.25d-285)) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_m * (d_m * ((m_m * m_m) / d))) * 0.125d0)
    else if (l <= 2.35d-81) then
        tmp = (d_m * d_m) * (sqrt(((h / (l * l)) / l)) * (((-0.125d0) * (m_m * m_m)) / d))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -3.4e-177) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -2.25e-285) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	} else if (l <= 2.35e-81) {
		tmp = (D_m * D_m) * (Math.sqrt(((h / (l * l)) / l)) * ((-0.125 * (M_m * M_m)) / d));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -3.4e-177:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -2.25e-285:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125)
	elif l <= 2.35e-81:
		tmp = (D_m * D_m) * (math.sqrt(((h / (l * l)) / l)) * ((-0.125 * (M_m * M_m)) / d))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -3.4e-177)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -2.25e-285)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D_m * Float64(D_m * Float64(Float64(M_m * M_m) / d))) * 0.125));
	elseif (l <= 2.35e-81)
		tmp = Float64(Float64(D_m * D_m) * Float64(sqrt(Float64(Float64(h / Float64(l * l)) / l)) * Float64(Float64(-0.125 * Float64(M_m * M_m)) / d)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -3.4e-177)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -2.25e-285)
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	elseif (l <= 2.35e-81)
		tmp = (D_m * D_m) * (sqrt(((h / (l * l)) / l)) * ((-0.125 * (M_m * M_m)) / d));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -3.4e-177], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.25e-285], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D$95$m * N[(D$95$m * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.35e-81], N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[Sqrt[N[(N[(h / N[(l * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{-177}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\

\mathbf{elif}\;\ell \leq 2.35 \cdot 10^{-81}:\\
\;\;\;\;\left(D\_m \cdot D\_m\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \frac{-0.125 \cdot \left(M\_m \cdot M\_m\right)}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -3.4000000000000001e-177

    1. Initial program 63.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -3.4000000000000001e-177 < l < -2.2500000000000001e-285

    1. Initial program 85.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. Simplified89.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    6. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)} \]

    if -2.2500000000000001e-285 < l < 2.35000000000000014e-81

    1. Initial program 67.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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr66.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)}\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}}\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right)\right) \]
    8. Simplified52.2%

      \[\leadsto \color{blue}{\left(D \cdot D\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)} \]

    if 2.35000000000000014e-81 < l

    1. Initial program 67.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr47.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.4 \cdot 10^{-177}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-285}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{elif}\;\ell \leq 2.35 \cdot 10^{-81}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 75.1% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D\_m}}}{4}\right)}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + t\_0\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (* (/ (* M_m (* h (/ (/ M_m (/ d D_m)) 4.0))) l) (/ (/ D_m d) -2.0))))
   (if (<= h -5e-310)
     (* (* d (sqrt (/ 1.0 (* l h)))) (- -1.0 t_0))
     (* (+ 1.0 t_0) (* d (pow (* l h) -0.5))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = ((M_m * (h * ((M_m / (d / D_m)) / 4.0))) / l) * ((D_m / d) / -2.0);
	double tmp;
	if (h <= -5e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - t_0);
	} else {
		tmp = (1.0 + t_0) * (d * pow((l * h), -0.5));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((m_m * (h * ((m_m / (d / d_m)) / 4.0d0))) / l) * ((d_m / d) / (-2.0d0))
    if (h <= (-5d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((-1.0d0) - t_0)
    else
        tmp = (1.0d0 + t_0) * (d * ((l * h) ** (-0.5d0)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = ((M_m * (h * ((M_m / (d / D_m)) / 4.0))) / l) * ((D_m / d) / -2.0);
	double tmp;
	if (h <= -5e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * (-1.0 - t_0);
	} else {
		tmp = (1.0 + t_0) * (d * Math.pow((l * h), -0.5));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = ((M_m * (h * ((M_m / (d / D_m)) / 4.0))) / l) * ((D_m / d) / -2.0)
	tmp = 0
	if h <= -5e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * (-1.0 - t_0)
	else:
		tmp = (1.0 + t_0) * (d * math.pow((l * h), -0.5))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64(Float64(M_m * Float64(h * Float64(Float64(M_m / Float64(d / D_m)) / 4.0))) / l) * Float64(Float64(D_m / d) / -2.0))
	tmp = 0.0
	if (h <= -5e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(-1.0 - t_0));
	else
		tmp = Float64(Float64(1.0 + t_0) * Float64(d * (Float64(l * h) ^ -0.5)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = ((M_m * (h * ((M_m / (d / D_m)) / 4.0))) / l) * ((D_m / d) / -2.0);
	tmp = 0.0;
	if (h <= -5e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - t_0);
	else
		tmp = (1.0 + t_0) * (d * ((l * h) ^ -0.5));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * N[(h * N[(N[(M$95$m / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$0), $MachinePrecision] * N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D\_m}}}{4}\right)}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -4.999999999999985e-310

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr68.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Taylor expanded in h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. --lowering--.f6472.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified72.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}} \cdot d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 74.7% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D\_m}}}{4}\right)\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(t\_0 \cdot \frac{D\_m}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{t\_0}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (* h (/ (/ M_m (/ d D_m)) 4.0)))))
   (if (<= h -5e-310)
     (* (* d (sqrt (/ 1.0 (* l h)))) (- -1.0 (* (/ -0.5 l) (* t_0 (/ D_m d)))))
     (* (+ 1.0 (* (/ t_0 l) (/ (/ D_m d) -2.0))) (* d (pow (* l h) -0.5))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (h * ((M_m / (d / D_m)) / 4.0));
	double tmp;
	if (h <= -5e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - ((-0.5 / l) * (t_0 * (D_m / d))));
	} else {
		tmp = (1.0 + ((t_0 / l) * ((D_m / d) / -2.0))) * (d * pow((l * h), -0.5));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = m_m * (h * ((m_m / (d / d_m)) / 4.0d0))
    if (h <= (-5d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((-1.0d0) - (((-0.5d0) / l) * (t_0 * (d_m / d))))
    else
        tmp = (1.0d0 + ((t_0 / l) * ((d_m / d) / (-2.0d0)))) * (d * ((l * h) ** (-0.5d0)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (h * ((M_m / (d / D_m)) / 4.0));
	double tmp;
	if (h <= -5e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * (-1.0 - ((-0.5 / l) * (t_0 * (D_m / d))));
	} else {
		tmp = (1.0 + ((t_0 / l) * ((D_m / d) / -2.0))) * (d * Math.pow((l * h), -0.5));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = M_m * (h * ((M_m / (d / D_m)) / 4.0))
	tmp = 0
	if h <= -5e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * (-1.0 - ((-0.5 / l) * (t_0 * (D_m / d))))
	else:
		tmp = (1.0 + ((t_0 / l) * ((D_m / d) / -2.0))) * (d * math.pow((l * h), -0.5))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(M_m * Float64(h * Float64(Float64(M_m / Float64(d / D_m)) / 4.0)))
	tmp = 0.0
	if (h <= -5e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(-1.0 - Float64(Float64(-0.5 / l) * Float64(t_0 * Float64(D_m / d)))));
	else
		tmp = Float64(Float64(1.0 + Float64(Float64(t_0 / l) * Float64(Float64(D_m / d) / -2.0))) * Float64(d * (Float64(l * h) ^ -0.5)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = M_m * (h * ((M_m / (d / D_m)) / 4.0));
	tmp = 0.0;
	if (h <= -5e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - ((-0.5 / l) * (t_0 * (D_m / d))));
	else
		tmp = (1.0 + ((t_0 / l) * ((D_m / d) / -2.0))) * (d * ((l * h) ^ -0.5));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(M$95$m * N[(h * N[(N[(M$95$m / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(N[(-0.5 / l), $MachinePrecision] * N[(t$95$0 * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(t$95$0 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D\_m}}}{4}\right)\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(t\_0 \cdot \frac{D\_m}{d}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{t\_0}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -4.999999999999985e-310

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{D}{d} \cdot \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right)\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{D}{d}\right), \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right)\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(\left(M \cdot \frac{\frac{M \cdot D}{d}}{4}\right) \cdot h\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(M \cdot \left(\frac{\frac{M \cdot D}{d}}{4} \cdot h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \left(\frac{\frac{M \cdot D}{d}}{4} \cdot h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{d}}{4}\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{d}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{d}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{d}{D}}\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{d}{D}\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6469.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr69.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)\right)\right)} \cdot \frac{-0.5}{\ell}\right) \]
    6. Taylor expanded in h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. --lowering--.f6473.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Simplified73.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)\right)} \cdot \left(1 + \left(\frac{D}{d} \cdot \left(M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)\right)\right) \cdot \frac{-0.5}{\ell}\right) \]

    if -4.999999999999985e-310 < 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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}} \cdot d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\left(M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)\right) \cdot \frac{D}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 74.1% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m}{\frac{d}{D\_m}}\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{t\_0 \cdot \left(\frac{D\_m}{d} \cdot \left(h \cdot M\_m\right)\right)}{\ell} \cdot -0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{M\_m \cdot \left(h \cdot \frac{t\_0}{4}\right)}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (/ M_m (/ d D_m))))
   (if (<= l -5e-310)
     (*
      (* d (sqrt (/ 1.0 (* l h))))
      (- -1.0 (* (/ (* t_0 (* (/ D_m d) (* h M_m))) l) -0.125)))
     (*
      (+ 1.0 (* (/ (* M_m (* h (/ t_0 4.0))) l) (/ (/ D_m d) -2.0)))
      (* d (pow (* l h) -0.5))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m / (d / D_m);
	double tmp;
	if (l <= -5e-310) {
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - (((t_0 * ((D_m / d) * (h * M_m))) / l) * -0.125));
	} else {
		tmp = (1.0 + (((M_m * (h * (t_0 / 4.0))) / l) * ((D_m / d) / -2.0))) * (d * pow((l * h), -0.5));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = m_m / (d / d_m)
    if (l <= (-5d-310)) then
        tmp = (d * sqrt((1.0d0 / (l * h)))) * ((-1.0d0) - (((t_0 * ((d_m / d) * (h * m_m))) / l) * (-0.125d0)))
    else
        tmp = (1.0d0 + (((m_m * (h * (t_0 / 4.0d0))) / l) * ((d_m / d) / (-2.0d0)))) * (d * ((l * h) ** (-0.5d0)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m / (d / D_m);
	double tmp;
	if (l <= -5e-310) {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * (-1.0 - (((t_0 * ((D_m / d) * (h * M_m))) / l) * -0.125));
	} else {
		tmp = (1.0 + (((M_m * (h * (t_0 / 4.0))) / l) * ((D_m / d) / -2.0))) * (d * Math.pow((l * h), -0.5));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = M_m / (d / D_m)
	tmp = 0
	if l <= -5e-310:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * (-1.0 - (((t_0 * ((D_m / d) * (h * M_m))) / l) * -0.125))
	else:
		tmp = (1.0 + (((M_m * (h * (t_0 / 4.0))) / l) * ((D_m / d) / -2.0))) * (d * math.pow((l * h), -0.5))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(M_m / Float64(d / D_m))
	tmp = 0.0
	if (l <= -5e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(-1.0 - Float64(Float64(Float64(t_0 * Float64(Float64(D_m / d) * Float64(h * M_m))) / l) * -0.125)));
	else
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M_m * Float64(h * Float64(t_0 / 4.0))) / l) * Float64(Float64(D_m / d) / -2.0))) * Float64(d * (Float64(l * h) ^ -0.5)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = M_m / (d / D_m);
	tmp = 0.0;
	if (l <= -5e-310)
		tmp = (d * sqrt((1.0 / (l * h)))) * (-1.0 - (((t_0 * ((D_m / d) * (h * M_m))) / l) * -0.125));
	else
		tmp = (1.0 + (((M_m * (h * (t_0 / 4.0))) / l) * ((D_m / d) / -2.0))) * (d * ((l * h) ^ -0.5));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(M$95$m / N[(d / D$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(N[(N[(t$95$0 * N[(N[(D$95$m / d), $MachinePrecision] * N[(h * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[(M$95$m * N[(h * N[(t$95$0 / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{M\_m}{\frac{d}{D\_m}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{t\_0 \cdot \left(\frac{D\_m}{d} \cdot \left(h \cdot M\_m\right)\right)}{\ell} \cdot -0.125\right)\\

\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{M\_m \cdot \left(h \cdot \frac{t\_0}{4}\right)}{\ell} \cdot \frac{\frac{D\_m}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.999999999999985e-310

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot -2}\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{4}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      8. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \color{blue}{\frac{\frac{1}{4}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{\frac{1}{4}}{\mathsf{neg}\left(\color{blue}{2}\right)}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{\frac{1}{4}}{-2}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \frac{-1}{8}\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot \color{blue}{\frac{1}{8}}\right)\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\frac{1}{2}}^{\color{blue}{3}}\right)\right)\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell} \cdot \left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\left(M \cdot \frac{M \cdot D}{d}\right) \cdot \left(h \cdot \frac{D}{d}\right)}{\ell}\right), \color{blue}{\left(-1 \cdot {\left(\frac{1}{2}\right)}^{3}\right)}\right)\right)\right) \]
    5. Applied egg-rr68.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{\frac{M}{\frac{d}{D}} \cdot \left(M \cdot \frac{h}{\frac{d}{D}}\right)}{\ell} \cdot -0.125}\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\frac{M \cdot h}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{1}{\frac{d}{D}}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\left(M \cdot h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \left(\frac{D}{d}\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. /-lowering-/.f6464.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    7. Applied egg-rr64.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \color{blue}{\left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)}}{\ell} \cdot -0.125\right) \]
    8. Taylor expanded in h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
      11. --lowering--.f6471.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(D, d\right)\right)\right), \ell\right), \frac{-1}{8}\right)\right)\right) \]
    10. Simplified71.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)\right)} \cdot \left(1 + \frac{\frac{M}{\frac{d}{D}} \cdot \left(\left(M \cdot h\right) \cdot \frac{D}{d}\right)}{\ell} \cdot -0.125\right) \]

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr65.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{h \cdot \ell}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{\sqrt{\ell \cdot h}}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}} \cdot d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), d\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      10. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      11. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      15. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{-0.5} \cdot d\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(-1 - \frac{\frac{M}{\frac{d}{D}} \cdot \left(\frac{D}{d} \cdot \left(h \cdot M\right)\right)}{\ell} \cdot -0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \cdot \left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 44.2% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -3.8 \cdot 10^{-179}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -3.8e-179)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
   (if (<= l -5.9e-282)
     (* (sqrt (/ h (* l (* l l)))) (* (* D_m (* D_m (/ (* M_m M_m) d))) 0.125))
     (/ d (sqrt (* l h))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -3.8e-179) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -5.9e-282) {
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-3.8d-179)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-5.9d-282)) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_m * (d_m * ((m_m * m_m) / d))) * 0.125d0)
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -3.8e-179) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -5.9e-282) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -3.8e-179:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -5.9e-282:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125)
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -3.8e-179)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -5.9e-282)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D_m * Float64(D_m * Float64(Float64(M_m * M_m) / d))) * 0.125));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -3.8e-179)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -5.9e-282)
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * ((M_m * M_m) / d))) * 0.125);
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -3.8e-179], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.9e-282], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D$95$m * N[(D$95$m * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-179}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -3.79999999999999974e-179

    1. Initial program 63.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -3.79999999999999974e-179 < l < -5.8999999999999997e-282

    1. Initial program 85.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. Simplified89.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    6. Simplified65.5%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)} \]

    if -5.8999999999999997e-282 < l

    1. Initial program 67.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. Simplified64.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6438.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified38.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6437.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr37.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6442.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr42.1%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.8 \cdot 10^{-179}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 28: 43.7% accurate, 2.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{1}{\ell \cdot h}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{-179}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(t\_0 \cdot t\_0\right)}^{0.25}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* l h))))
   (if (<= l -1e-179)
     (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
     (if (<= l -5e-310) (* d (pow (* t_0 t_0) 0.25)) (/ d (sqrt (* l h)))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = 1.0 / (l * h);
	double tmp;
	if (l <= -1e-179) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = d * pow((t_0 * t_0), 0.25);
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / (l * h)
    if (l <= (-1d-179)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-5d-310)) then
        tmp = d * ((t_0 * t_0) ** 0.25d0)
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = 1.0 / (l * h);
	double tmp;
	if (l <= -1e-179) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = d * Math.pow((t_0 * t_0), 0.25);
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = 1.0 / (l * h)
	tmp = 0
	if l <= -1e-179:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -5e-310:
		tmp = d * math.pow((t_0 * t_0), 0.25)
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(1.0 / Float64(l * h))
	tmp = 0.0
	if (l <= -1e-179)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -5e-310)
		tmp = Float64(d * (Float64(t_0 * t_0) ^ 0.25));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = 1.0 / (l * h);
	tmp = 0.0;
	if (l <= -1e-179)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -5e-310)
		tmp = d * ((t_0 * t_0) ^ 0.25);
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e-179], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-179}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(t\_0 \cdot t\_0\right)}^{0.25}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1e-179

    1. Initial program 63.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -1e-179 < l < -4.999999999999985e-310

    1. Initial program 85.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified90.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6439.9%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified39.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\left(\frac{1}{4} + \color{blue}{\frac{1}{4}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\left(\frac{1}{4} + \frac{1}{4}\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\left(\frac{1}{4} + \frac{1}{\color{blue}{4}}\right)}\right)\right) \]
      5. pow-prod-upN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\left(\frac{1}{4}\right)} \cdot \color{blue}{{\left(\frac{\frac{1}{\ell}}{h}\right)}^{\left(\frac{1}{4}\right)}}\right)\right) \]
      6. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h} \cdot \frac{\frac{1}{\ell}}{h}\right)}^{\color{blue}{\left(\frac{1}{4}\right)}}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(\frac{\frac{1}{\ell}}{h} \cdot \frac{\frac{1}{\ell}}{h}\right), \color{blue}{\left(\frac{1}{4}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right), \left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(\frac{\color{blue}{1}}{4}\right)\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{\ell \cdot h}\right), \left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(\ell \cdot h\right)\right), \left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right), \left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      13. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \left(\frac{1}{\ell \cdot h}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \mathsf{/.f64}\left(1, \left(\ell \cdot h\right)\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      17. metadata-eval53.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right), \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \frac{1}{4}\right)\right) \]
    8. Applied egg-rr53.5%

      \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right)}^{0.25}} \]

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6438.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified38.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6437.8%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr37.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6442.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr42.3%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-179}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right)}^{0.25}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 29: 43.3% accurate, 2.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -3 \cdot 10^{+85}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{elif}\;h \leq 1.6 \cdot 10^{-305}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{elif}\;h \leq 4.8 \cdot 10^{+136}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= h -3e+85)
   (sqrt (/ (/ d h) (/ l d)))
   (if (<= h 1.6e-305)
     (* (- 0.0 d) (sqrt (/ 1.0 (* l h))))
     (if (<= h 4.8e+136) (/ d (sqrt (* l h))) (sqrt (/ (* d (/ d l)) h))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (h <= -3e+85) {
		tmp = sqrt(((d / h) / (l / d)));
	} else if (h <= 1.6e-305) {
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	} else if (h <= 4.8e+136) {
		tmp = d / sqrt((l * h));
	} else {
		tmp = sqrt(((d * (d / l)) / h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (h <= (-3d+85)) then
        tmp = sqrt(((d / h) / (l / d)))
    else if (h <= 1.6d-305) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (l * h)))
    else if (h <= 4.8d+136) then
        tmp = d / sqrt((l * h))
    else
        tmp = sqrt(((d * (d / l)) / h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (h <= -3e+85) {
		tmp = Math.sqrt(((d / h) / (l / d)));
	} else if (h <= 1.6e-305) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (l * h)));
	} else if (h <= 4.8e+136) {
		tmp = d / Math.sqrt((l * h));
	} else {
		tmp = Math.sqrt(((d * (d / l)) / h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if h <= -3e+85:
		tmp = math.sqrt(((d / h) / (l / d)))
	elif h <= 1.6e-305:
		tmp = (0.0 - d) * math.sqrt((1.0 / (l * h)))
	elif h <= 4.8e+136:
		tmp = d / math.sqrt((l * h))
	else:
		tmp = math.sqrt(((d * (d / l)) / h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (h <= -3e+85)
		tmp = sqrt(Float64(Float64(d / h) / Float64(l / d)));
	elseif (h <= 1.6e-305)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(l * h))));
	elseif (h <= 4.8e+136)
		tmp = Float64(d / sqrt(Float64(l * h)));
	else
		tmp = sqrt(Float64(Float64(d * Float64(d / l)) / h));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (h <= -3e+85)
		tmp = sqrt(((d / h) / (l / d)));
	elseif (h <= 1.6e-305)
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	elseif (h <= 4.8e+136)
		tmp = d / sqrt((l * h));
	else
		tmp = sqrt(((d * (d / l)) / h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -3e+85], N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[h, 1.6e-305], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.8e+136], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d * N[(d / l), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -3 \cdot 10^{+85}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

\mathbf{elif}\;h \leq 1.6 \cdot 10^{-305}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\

\mathbf{elif}\;h \leq 4.8 \cdot 10^{+136}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -3e85

    1. Initial program 48.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified55.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f645.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified5.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
      7. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}} \]
      10. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      12. rem-square-sqrtN/A

        \[\leadsto \sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      13. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      14. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      16. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      17. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right) \]
    8. Applied egg-rr32.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \]

    if -3e85 < h < 1.60000000000000004e-305

    1. Initial program 76.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. Simplified74.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr76.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6450.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    8. Simplified50.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if 1.60000000000000004e-305 < h < 4.8000000000000001e136

    1. Initial program 69.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6446.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified46.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6445.8%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr45.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6453.0%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr53.0%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]

    if 4.8000000000000001e136 < h

    1. Initial program 59.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. Simplified54.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6415.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified15.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6412.7%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr12.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-unprodN/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
      4. frac-timesN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d \cdot \frac{d}{\ell}}{h}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \frac{d}{\ell}\right), h\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(\frac{d}{\ell}\right)\right), h\right)\right) \]
      9. /-lowering-/.f6430.3%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \ell\right)\right), h\right)\right) \]
    10. Applied egg-rr30.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification43.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -3 \cdot 10^{+85}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{elif}\;h \leq 1.6 \cdot 10^{-305}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{elif}\;h \leq 4.8 \cdot 10^{+136}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 30: 43.7% accurate, 2.8× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -9 \cdot 10^{-188}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{{\left(\left(\ell \cdot h\right) \cdot \left(\ell \cdot h\right)\right)}^{0.25}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -9e-188)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
   (if (<= l -5e-310)
     (/ d (pow (* (* l h) (* l h)) 0.25))
     (/ d (sqrt (* l h))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -9e-188) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = d / pow(((l * h) * (l * h)), 0.25);
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-9d-188)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-5d-310)) then
        tmp = d / (((l * h) * (l * h)) ** 0.25d0)
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -9e-188) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -5e-310) {
		tmp = d / Math.pow(((l * h) * (l * h)), 0.25);
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -9e-188:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -5e-310:
		tmp = d / math.pow(((l * h) * (l * h)), 0.25)
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -9e-188)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -5e-310)
		tmp = Float64(d / (Float64(Float64(l * h) * Float64(l * h)) ^ 0.25));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -9e-188)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -5e-310)
		tmp = d / (((l * h) * (l * h)) ^ 0.25);
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -9e-188], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d / N[Power[N[(N[(l * h), $MachinePrecision] * N[(l * h), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9 \cdot 10^{-188}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{{\left(\left(\ell \cdot h\right) \cdot \left(\ell \cdot h\right)\right)}^{0.25}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -8.99999999999999986e-188

    1. Initial program 64.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.5%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -8.99999999999999986e-188 < l < -4.999999999999985e-310

    1. Initial program 83.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. Simplified88.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6446.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified46.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6440.8%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr40.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(\frac{1}{4} + \color{blue}{\frac{1}{4}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(\frac{1}{4} + \frac{1}{4}\right)}\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(\frac{1}{4} + \frac{1}{\color{blue}{4}}\right)}\right)\right) \]
      5. pow-prod-upN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(\frac{1}{4}\right)} \cdot \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{4}\right)}}\right)\right) \]
      6. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{\color{blue}{\left(\frac{1}{4}\right)}}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right), \color{blue}{\left(\frac{1}{4}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(h \cdot \ell\right), \left(h \cdot \ell\right)\right), \left(\frac{\color{blue}{1}}{4}\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\ell \cdot h\right), \left(h \cdot \ell\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \left(h \cdot \ell\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \left(\ell \cdot h\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \mathsf{*.f64}\left(\ell, h\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      13. metadata-eval56.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \mathsf{*.f64}\left(\ell, h\right)\right), \frac{1}{4}\right)\right) \]
    10. Applied egg-rr56.6%

      \[\leadsto \frac{d}{\color{blue}{{\left(\left(\ell \cdot h\right) \cdot \left(\ell \cdot h\right)\right)}^{0.25}}} \]

    if -4.999999999999985e-310 < l

    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. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6438.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified38.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6437.8%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr37.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6442.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr42.3%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -9 \cdot 10^{-188}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{{\left(\left(\ell \cdot h\right) \cdot \left(\ell \cdot h\right)\right)}^{0.25}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 31: 42.6% accurate, 2.8× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -9.6 \cdot 10^{-189}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -9.6e-189)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 l) h)))
   (if (<= l -5.9e-282) (* d (sqrt (/ (/ 1.0 h) l))) (/ d (sqrt (* l h))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -9.6e-189) {
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	} else if (l <= -5.9e-282) {
		tmp = d * sqrt(((1.0 / h) / l));
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-9.6d-189)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / l) / h))
    else if (l <= (-5.9d-282)) then
        tmp = d * sqrt(((1.0d0 / h) / l))
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -9.6e-189) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / l) / h));
	} else if (l <= -5.9e-282) {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -9.6e-189:
		tmp = (0.0 - d) * math.sqrt(((1.0 / l) / h))
	elif l <= -5.9e-282:
		tmp = d * math.sqrt(((1.0 / h) / l))
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -9.6e-189)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / l) / h)));
	elseif (l <= -5.9e-282)
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -9.6e-189)
		tmp = (0.0 - d) * sqrt(((1.0 / l) / h));
	elseif (l <= -5.9e-282)
		tmp = d * sqrt(((1.0 / h) / l));
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -9.6e-189], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.9e-282], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.6 \cdot 10^{-189}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\

\mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -9.5999999999999994e-189

    1. Initial program 64.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified47.5%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -9.5999999999999994e-189 < l < -5.8999999999999997e-282

    1. Initial program 82.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. Simplified88.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified48.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr48.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]

    if -5.8999999999999997e-282 < l

    1. Initial program 67.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. Simplified64.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6438.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified38.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6437.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr37.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6442.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr42.1%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -9.6 \cdot 10^{-189}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -5.9 \cdot 10^{-282}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 32: 42.6% accurate, 2.8× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{if}\;\ell \leq -7.5 \cdot 10^{-189}:\\ \;\;\;\;\left(0 - d\right) \cdot t\_0\\ \mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-285}:\\ \;\;\;\;d \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ (/ 1.0 h) l))))
   (if (<= l -7.5e-189)
     (* (- 0.0 d) t_0)
     (if (<= l -2.4e-285) (* d t_0) (/ d (sqrt (* l h)))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt(((1.0 / h) / l));
	double tmp;
	if (l <= -7.5e-189) {
		tmp = (0.0 - d) * t_0;
	} else if (l <= -2.4e-285) {
		tmp = d * t_0;
	} else {
		tmp = d / sqrt((l * h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((1.0d0 / h) / l))
    if (l <= (-7.5d-189)) then
        tmp = (0.0d0 - d) * t_0
    else if (l <= (-2.4d-285)) then
        tmp = d * t_0
    else
        tmp = d / sqrt((l * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt(((1.0 / h) / l));
	double tmp;
	if (l <= -7.5e-189) {
		tmp = (0.0 - d) * t_0;
	} else if (l <= -2.4e-285) {
		tmp = d * t_0;
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt(((1.0 / h) / l))
	tmp = 0
	if l <= -7.5e-189:
		tmp = (0.0 - d) * t_0
	elif l <= -2.4e-285:
		tmp = d * t_0
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(Float64(1.0 / h) / l))
	tmp = 0.0
	if (l <= -7.5e-189)
		tmp = Float64(Float64(0.0 - d) * t_0);
	elseif (l <= -2.4e-285)
		tmp = Float64(d * t_0);
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt(((1.0 / h) / l));
	tmp = 0.0;
	if (l <= -7.5e-189)
		tmp = (0.0 - d) * t_0;
	elseif (l <= -2.4e-285)
		tmp = d * t_0;
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -7.5e-189], N[(N[(0.0 - d), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, -2.4e-285], N[(d * t$95$0), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{if}\;\ell \leq -7.5 \cdot 10^{-189}:\\
\;\;\;\;\left(0 - d\right) \cdot t\_0\\

\mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-285}:\\
\;\;\;\;d \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -7.50000000000000042e-189

    1. Initial program 64.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Applied egg-rr66.4%

      \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(\frac{\frac{M}{\frac{d}{D}} \cdot \left(M \cdot \frac{h}{\frac{d}{D}}\right)}{\ell} \cdot -0.125 + 1\right)\right) \cdot \sqrt{\frac{d}{h}}} \]
    5. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6447.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    7. Simplified47.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(0 - d\right)} \]

    if -7.50000000000000042e-189 < l < -2.4e-285

    1. Initial program 82.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. Simplified88.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified48.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr48.3%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]

    if -2.4e-285 < l

    1. Initial program 67.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. Simplified64.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6438.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified38.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6437.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr37.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6442.1%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr42.1%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -7.5 \cdot 10^{-189}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-285}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 33: 37.3% accurate, 2.8× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq 2.7 \cdot 10^{-275}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{elif}\;h \leq 1.85 \cdot 10^{+135}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= h 2.7e-275)
   (sqrt (/ (/ d h) (/ l d)))
   (if (<= h 1.85e+135) (/ d (sqrt (* l h))) (sqrt (/ (* d (/ d l)) h)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (h <= 2.7e-275) {
		tmp = sqrt(((d / h) / (l / d)));
	} else if (h <= 1.85e+135) {
		tmp = d / sqrt((l * h));
	} else {
		tmp = sqrt(((d * (d / l)) / h));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (h <= 2.7d-275) then
        tmp = sqrt(((d / h) / (l / d)))
    else if (h <= 1.85d+135) then
        tmp = d / sqrt((l * h))
    else
        tmp = sqrt(((d * (d / l)) / h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (h <= 2.7e-275) {
		tmp = Math.sqrt(((d / h) / (l / d)));
	} else if (h <= 1.85e+135) {
		tmp = d / Math.sqrt((l * h));
	} else {
		tmp = Math.sqrt(((d * (d / l)) / h));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if h <= 2.7e-275:
		tmp = math.sqrt(((d / h) / (l / d)))
	elif h <= 1.85e+135:
		tmp = d / math.sqrt((l * h))
	else:
		tmp = math.sqrt(((d * (d / l)) / h))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (h <= 2.7e-275)
		tmp = sqrt(Float64(Float64(d / h) / Float64(l / d)));
	elseif (h <= 1.85e+135)
		tmp = Float64(d / sqrt(Float64(l * h)));
	else
		tmp = sqrt(Float64(Float64(d * Float64(d / l)) / h));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (h <= 2.7e-275)
		tmp = sqrt(((d / h) / (l / d)));
	elseif (h <= 1.85e+135)
		tmp = d / sqrt((l * h));
	else
		tmp = sqrt(((d * (d / l)) / h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, 2.7e-275], N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[h, 1.85e+135], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(d * N[(d / l), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq 2.7 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

\mathbf{elif}\;h \leq 1.85 \cdot 10^{+135}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < 2.69999999999999993e-275

    1. Initial program 66.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. Simplified67.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6413.9%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified13.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
      7. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}} \]
      10. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      12. rem-square-sqrtN/A

        \[\leadsto \sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      13. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      14. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      16. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      17. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right) \]
    8. Applied egg-rr31.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \]

    if 2.69999999999999993e-275 < h < 1.84999999999999999e135

    1. Initial program 71.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. Simplified67.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6447.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified47.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6446.5%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr46.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{\ell \cdot h}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{\ell \cdot h}\right)\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right)\right)\right) \]
    10. Applied egg-rr54.3%

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{\ell \cdot h}}} \]

    if 1.84999999999999999e135 < h

    1. Initial program 59.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. Simplified54.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6415.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified15.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f6412.7%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr12.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-unprodN/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
      4. frac-timesN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d \cdot \frac{d}{\ell}}{h}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \frac{d}{\ell}\right), h\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(\frac{d}{\ell}\right)\right), h\right)\right) \]
      9. /-lowering-/.f6430.3%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \ell\right)\right), h\right)\right) \]
    10. Applied egg-rr30.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq 2.7 \cdot 10^{-275}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{elif}\;h \leq 1.85 \cdot 10^{+135}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 34: 38.0% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.05 \cdot 10^{-188}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -1.05e-188)
   (sqrt (/ (/ d h) (/ l d)))
   (* d (sqrt (/ (/ 1.0 h) l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -1.05e-188) {
		tmp = sqrt(((d / h) / (l / d)));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-1.05d-188)) then
        tmp = sqrt(((d / h) / (l / d)))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -1.05e-188) {
		tmp = Math.sqrt(((d / h) / (l / d)));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -1.05e-188:
		tmp = math.sqrt(((d / h) / (l / d)))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -1.05e-188)
		tmp = sqrt(Float64(Float64(d / h) / Float64(l / d)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -1.05e-188)
		tmp = sqrt(((d / h) / (l / d)));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1.05e-188], N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.05 \cdot 10^{-188}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.05e-188

    1. Initial program 64.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified64.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f646.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified6.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
      7. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}} \]
      10. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      12. rem-square-sqrtN/A

        \[\leadsto \sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      13. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      14. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      16. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      17. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right) \]
    8. Applied egg-rr32.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \]

    if -1.05e-188 < l

    1. Initial program 69.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. Simplified66.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6439.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified39.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6439.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    8. Applied egg-rr39.7%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 35: 38.0% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-209}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -1e-209) (sqrt (/ (/ d h) (/ l d))) (* d (pow (* l h) -0.5))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -1e-209) {
		tmp = sqrt(((d / h) / (l / d)));
	} else {
		tmp = d * pow((l * h), -0.5);
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-1d-209)) then
        tmp = sqrt(((d / h) / (l / d)))
    else
        tmp = d * ((l * h) ** (-0.5d0))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -1e-209) {
		tmp = Math.sqrt(((d / h) / (l / d)));
	} else {
		tmp = d * Math.pow((l * h), -0.5);
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -1e-209:
		tmp = math.sqrt(((d / h) / (l / d)))
	else:
		tmp = d * math.pow((l * h), -0.5)
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -1e-209)
		tmp = sqrt(Float64(Float64(d / h) / Float64(l / d)));
	else
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -1e-209)
		tmp = sqrt(((d / h) / (l / d)));
	else
		tmp = d * ((l * h) ^ -0.5);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1e-209], N[Sqrt[N[(N[(d / h), $MachinePrecision] / N[(l / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-209}:\\
\;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1e-209

    1. Initial program 65.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. Simplified65.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f647.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified7.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
      7. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}} \]
      10. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      12. rem-square-sqrtN/A

        \[\leadsto \sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      13. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      14. sqrt-unprodN/A

        \[\leadsto \sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      16. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right) \]
      17. sqrt-unprodN/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right)\right) \]
    8. Applied egg-rr32.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}} \]

    if -1e-209 < l

    1. Initial program 68.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. Simplified66.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6439.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified39.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
      2. associate-/r*N/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      3. sqrt-divN/A

        \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
      4. metadata-evalN/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), \color{blue}{d}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right) \]
      7. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      11. *-lowering-*.f6439.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr39.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-209}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 36: 36.4% accurate, 3.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.7 \cdot 10^{-209}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= l -4.7e-209) (sqrt (/ (* d (/ d l)) h)) (* d (pow (* l h) -0.5))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -4.7e-209) {
		tmp = sqrt(((d * (d / l)) / h));
	} else {
		tmp = d * pow((l * h), -0.5);
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: tmp
    if (l <= (-4.7d-209)) then
        tmp = sqrt(((d * (d / l)) / h))
    else
        tmp = d * ((l * h) ** (-0.5d0))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (l <= -4.7e-209) {
		tmp = Math.sqrt(((d * (d / l)) / h));
	} else {
		tmp = d * Math.pow((l * h), -0.5);
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	tmp = 0
	if l <= -4.7e-209:
		tmp = math.sqrt(((d * (d / l)) / h))
	else:
		tmp = d * math.pow((l * h), -0.5)
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (l <= -4.7e-209)
		tmp = sqrt(Float64(Float64(d * Float64(d / l)) / h));
	else
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	tmp = 0.0;
	if (l <= -4.7e-209)
		tmp = sqrt(((d * (d / l)) / h));
	else
		tmp = d * ((l * h) ^ -0.5);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -4.7e-209], N[Sqrt[N[(N[(d * N[(d / l), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.7 \cdot 10^{-209}:\\
\;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.7000000000000001e-209

    1. Initial program 65.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. Simplified65.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f647.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified7.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      8. *-lowering-*.f646.4%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    8. Applied egg-rr6.4%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-unprodN/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
      4. frac-timesN/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d \cdot \frac{d}{\ell}}{h}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \frac{d}{\ell}\right), h\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(\frac{d}{\ell}\right)\right), h\right)\right) \]
      9. /-lowering-/.f6430.9%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \ell\right)\right), h\right)\right) \]
    10. Applied egg-rr30.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}} \]

    if -4.7000000000000001e-209 < l

    1. Initial program 68.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. Simplified66.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6439.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified39.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
      2. associate-/r*N/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      3. sqrt-divN/A

        \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
      4. metadata-evalN/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), \color{blue}{d}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right) \]
      7. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right) \]
      9. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      11. *-lowering-*.f6439.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr39.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.7 \cdot 10^{-209}:\\ \;\;\;\;\sqrt{\frac{d \cdot \frac{d}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 37: 26.0% accurate, 3.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ d \cdot {\left(\ell \cdot h\right)}^{-0.5} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m) :precision binary64 (* d (pow (* l h) -0.5)))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	return d * pow((l * h), -0.5);
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    code = d * ((l * h) ** (-0.5d0))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	return d * Math.pow((l * h), -0.5);
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	return d * math.pow((l * h), -0.5)
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	return Float64(d * (Float64(l * h) ^ -0.5))
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp = code(d, h, l, M_m, D_m)
	tmp = d * ((l * h) ^ -0.5);
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Derivation
  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. Simplified65.9%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6425.7%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified25.7%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
    2. associate-/r*N/A

      \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
    3. sqrt-divN/A

      \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
    4. metadata-evalN/A

      \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{\ell \cdot h}}\right), \color{blue}{d}\right) \]
    6. pow1/2N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{{\left(\ell \cdot h\right)}^{\frac{1}{2}}}\right), d\right) \]
    7. pow-flipN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot h\right)}^{\frac{-1}{2}}\right), d\right) \]
    9. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
    10. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
    11. *-lowering-*.f6424.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
  8. Applied egg-rr24.9%

    \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  9. Final simplification24.9%

    \[\leadsto d \cdot {\left(\ell \cdot h\right)}^{-0.5} \]
  10. Add Preprocessing

Alternative 38: 26.0% accurate, 3.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m) :precision binary64 (/ d (sqrt (* l h))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	return d / sqrt((l * h));
}
M_m = abs(m)
D_m = abs(d)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    code = d / sqrt((l * h))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	return d / Math.sqrt((l * h));
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	return d / math.sqrt((l * h))
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	return Float64(d / sqrt(Float64(l * h)))
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp = code(d, h, l, M_m, D_m)
	tmp = d / sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Derivation
  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. Simplified65.9%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6425.7%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified25.7%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. associate-/r*N/A

      \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
    2. sqrt-divN/A

      \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\ell \cdot h}}} \]
    3. metadata-evalN/A

      \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{\ell \cdot h}}} \]
    4. div-invN/A

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
    8. *-lowering-*.f6424.8%

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
  8. Applied egg-rr24.8%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  9. Final simplification24.8%

    \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2024163 
(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)))))