Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.9% → 76.3%
Time: 30.0s
Alternatives: 31
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 31 alternatives:

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

Initial Program: 66.9% accurate, 1.0× speedup?

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

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

Alternative 1: 76.3% accurate, 1.3× speedup?

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

\mathbf{elif}\;d \leq -1.15 \cdot 10^{-267}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\

\mathbf{elif}\;d \leq 5 \cdot 10^{-279}:\\
\;\;\;\;\frac{\frac{{\left(\frac{h}{\ell}\right)}^{0.5}}{\ell} \cdot \left(D\_m \cdot \left(D\_m \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right)\right) + \left(d \cdot d\right) \cdot t\_2}{d}\\

\mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -5.8e175

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6493.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified93.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -5.8e175 < d < -1.15000000000000003e-267

    1. Initial program 78.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr82.2%

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000003e-267 < d < 4.99999999999999969e-279

    1. Initial program 22.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. Simplified22.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999969e-279 < d < 8.49999999999999997e-140 or 8.00000000000000026e139 < d

    1. Initial program 47.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr55.1%

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

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

    if 8.49999999999999997e-140 < d < 8.00000000000000026e139

    1. Initial program 66.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. 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. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \frac{M \cdot D}{d}}{4}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{1}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(\left(\frac{h \cdot \frac{D}{d}}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\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(\left(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{\frac{M \cdot \left(M \cdot D\right)}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \left(M \cdot D\right)} \cdot d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\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, \mathsf{*.f64}\left(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{D}{d}\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \left(M \cdot \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{d}\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(\mathsf{/.f64}\left(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6470.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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.8 \cdot 10^{+175}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq -1.15 \cdot 10^{-267}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-279}:\\ \;\;\;\;\frac{\frac{{\left(\frac{h}{\ell}\right)}^{0.5}}{\ell} \cdot \left(D \cdot \left(D \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right)\right) + \left(d \cdot d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}{d}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+139}:\\ \;\;\;\;\frac{d \cdot {h}^{-0.5}}{\sqrt{\ell}} \cdot \left(\frac{-0.5}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 76.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;d \leq -6.1 \cdot 10^{-260}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\

\mathbf{elif}\;d \leq 4.8 \cdot 10^{-266}:\\
\;\;\;\;\frac{\frac{{\left(\frac{h}{\ell}\right)}^{0.5}}{\ell} \cdot \left(D\_m \cdot \left(D\_m \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right)\right) + \left(d \cdot d\right) \cdot t\_1}{d}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.9500000000000001e176

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6493.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified93.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -1.9500000000000001e176 < d < -6.1000000000000003e-260

    1. Initial program 78.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr82.2%

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

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

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

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

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

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

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

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

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

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

    if -6.1000000000000003e-260 < d < 4.7999999999999999e-266

    1. Initial program 22.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified22.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.7999999999999999e-266 < d

    1. Initial program 57.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr64.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.95 \cdot 10^{+176}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq -6.1 \cdot 10^{-260}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;d \leq 4.8 \cdot 10^{-266}:\\ \;\;\;\;\frac{\frac{{\left(\frac{h}{\ell}\right)}^{0.5}}{\ell} \cdot \left(D \cdot \left(D \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right)\right) + \left(d \cdot d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}{d}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{h}{d}\right)}^{-0.5} \cdot \left(\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 75.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr80.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\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, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{*.f64}\left(\left(\frac{\sqrt{\mathsf{neg}\left(d\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, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \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(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \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(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \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(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \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(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \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(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(4, d\right)\right), h\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, -2\right)\right), \ell\right)\right)\right)\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

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

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

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

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

    if -2.3000000000000001e-268 < d < 3.70000000000000018e-268

    1. Initial program 22.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified22.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000018e-268 < d

    1. Initial program 57.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr64.5%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 75.3% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\
\;\;\;\;t\_2\\

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

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -3.7999999999999998e177

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6493.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified93.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -3.7999999999999998e177 < d < -2.8e-91

    1. Initial program 92.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e-91 < d < 6.2000000000000004e-295

    1. Initial program 55.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. Simplified59.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified57.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      12. --lowering--.f6470.7%

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

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

    if 6.2000000000000004e-295 < d < 8.49999999999999997e-140 or 7.1999999999999999e140 < d

    1. Initial program 48.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr54.9%

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

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

    if 8.49999999999999997e-140 < d < 7.1999999999999999e140

    1. Initial program 66.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. 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. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \frac{M \cdot D}{d}}{4}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{1}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(\left(\frac{h \cdot \frac{D}{d}}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\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(\left(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{\frac{M \cdot \left(M \cdot D\right)}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \left(M \cdot D\right)} \cdot d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\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, \mathsf{*.f64}\left(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{D}{d}\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \left(M \cdot \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{d}\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(\mathsf{/.f64}\left(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6470.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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.8 \cdot 10^{+177}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq -2.8 \cdot 10^{-91}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell} \cdot \left(h \cdot \left(\frac{D}{d} \cdot \frac{M}{4}\right)\right) + 1\right)\right)\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{-295}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - \left(D \cdot D\right) \cdot \frac{h \cdot \frac{-0.125 \cdot \frac{M \cdot M}{d}}{d}}{\ell}\right)\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+140}:\\ \;\;\;\;\frac{d \cdot {h}^{-0.5}}{\sqrt{\ell}} \cdot \left(\frac{-0.5}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.5% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\
\;\;\;\;t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.35e175

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6493.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified93.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -1.35e175 < d < -4.1999999999999998e-90

    1. Initial program 92.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. Simplified84.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified69.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. Step-by-step derivation
      1. 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(D \cdot \color{blue}{\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\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, \left(\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}\right) \cdot \color{blue}{D}\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(\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}\right), \color{blue}{D}\right)\right)\right) \]
      4. 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(\left(D \cdot \left(\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot \frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      5. 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(D \cdot \frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right) \cdot \frac{h}{\ell}\right), D\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(\left(D \cdot \frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right), \left(\frac{h}{\ell}\right)\right), D\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, \left(\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right)\right), \left(\frac{h}{\ell}\right)\right), D\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, \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{M \cdot M}{d}\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      9. 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(D, \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left(M \cdot M\right)}{d}\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      10. /-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      11. *-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(M \cdot M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      12. *-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      13. /-lowering-/.f6478.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right), D\right)\right)\right) \]
    8. Applied egg-rr78.3%

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

    if -4.1999999999999998e-90 < d < 6.2000000000000004e-295

    1. Initial program 55.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. Simplified59.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified57.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      12. --lowering--.f6470.7%

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

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

    if 6.2000000000000004e-295 < d < 8.49999999999999997e-140 or 5.40000000000000036e140 < d

    1. Initial program 48.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr54.9%

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

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

    if 8.49999999999999997e-140 < d < 5.40000000000000036e140

    1. Initial program 66.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. 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. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \frac{M \cdot D}{d}}{4}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{1}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(\left(\frac{h \cdot \frac{D}{d}}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\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(\left(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{\frac{M \cdot \left(M \cdot D\right)}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \left(M \cdot D\right)} \cdot d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\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, \mathsf{*.f64}\left(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{D}{d}\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \left(M \cdot \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{d}\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(\mathsf{/.f64}\left(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6470.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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.35 \cdot 10^{+175}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq -4.2 \cdot 10^{-90}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(D \cdot \left(\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{-0.125 \cdot \left(M \cdot M\right)}{d}}{d}\right)\right) + 1\right)\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{-295}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - \left(D \cdot D\right) \cdot \frac{h \cdot \frac{-0.125 \cdot \frac{M \cdot M}{d}}{d}}{\ell}\right)\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{-140}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \mathbf{elif}\;d \leq 5.4 \cdot 10^{+140}:\\ \;\;\;\;\frac{d \cdot {h}^{-0.5}}{\sqrt{\ell}} \cdot \left(\frac{-0.5}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.2% accurate, 1.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.36e175

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6493.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified93.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -1.36e175 < d < -6.4999999999999996e-90

    1. Initial program 92.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. Simplified84.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified69.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. Step-by-step derivation
      1. 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(D \cdot \color{blue}{\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\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, \left(\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}\right) \cdot \color{blue}{D}\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(\left(D \cdot \frac{\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}\right), \color{blue}{D}\right)\right)\right) \]
      4. 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(\left(D \cdot \left(\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d} \cdot \frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      5. 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(D \cdot \frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right) \cdot \frac{h}{\ell}\right), D\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(\left(D \cdot \frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right), \left(\frac{h}{\ell}\right)\right), D\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, \left(\frac{\frac{-1}{8} \cdot \frac{M \cdot M}{d}}{d}\right)\right), \left(\frac{h}{\ell}\right)\right), D\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, \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{M \cdot M}{d}\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      9. 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(D, \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left(M \cdot M\right)}{d}\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      10. /-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      11. *-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(M \cdot M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      12. *-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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right), \left(\frac{h}{\ell}\right)\right), D\right)\right)\right) \]
      13. /-lowering-/.f6478.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right), \mathsf{/.f64}\left(h, \ell\right)\right), D\right)\right)\right) \]
    8. Applied egg-rr78.3%

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

    if -6.4999999999999996e-90 < d < 6.5e-285

    1. Initial program 56.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. Simplified60.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified58.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      12. --lowering--.f6471.3%

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

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

    if 6.5e-285 < d < 2.2500000000000001e98

    1. Initial program 54.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified54.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-rr49.2%

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

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

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

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

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

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

    if 2.2500000000000001e98 < d

    1. Initial program 58.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr65.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.36 \cdot 10^{+175}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{-90}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(D \cdot \left(\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{-0.125 \cdot \left(M \cdot M\right)}{d}}{d}\right)\right) + 1\right)\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-285}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - \left(D \cdot D\right) \cdot \frac{h \cdot \frac{-0.125 \cdot \frac{M \cdot M}{d}}{d}}{\ell}\right)\\ \mathbf{elif}\;d \leq 2.25 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(h \cdot D\right)\right)}{d \cdot d} \cdot \frac{-0.125}{\ell} + 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 72.8% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 72.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. Simplified72.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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6476.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified76.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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.5e-285 < d < 3.30000000000000028e98

    1. Initial program 54.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified54.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-rr49.2%

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

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

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

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

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

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

    if 3.30000000000000028e98 < d

    1. Initial program 58.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr65.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 6.5 \cdot 10^{-285}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;d \leq 3.3 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(h \cdot D\right)\right)}{d \cdot d} \cdot \frac{-0.125}{\ell} + 1\right)}{\sqrt{h}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.5% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 73.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6477.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified77.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -3.999999999999988e-310 < l < 3.40000000000000021e173

    1. Initial program 58.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr67.1%

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

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

    if 3.40000000000000021e173 < l

    1. Initial program 42.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. Simplified35.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6449.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified49.3%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(\left({\left(\frac{1}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(\left({\left({h}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right), \left(\sqrt{\ell}\right)\right)\right) \]
      6. pow-powN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(h, \frac{-1}{2}\right), \left(\sqrt{\color{blue}{\ell}}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f6463.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+173}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 74.9% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 73.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified73.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6477.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified77.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -3.999999999999988e-310 < l < 4.3e186

    1. Initial program 58.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr66.6%

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

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

    if 4.3e186 < l

    1. Initial program 41.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. Simplified32.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6440.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified40.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6437.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr37.1%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \frac{d}{{h}^{\frac{1}{2}} \cdot \color{blue}{{\ell}^{\frac{1}{2}}}} \]
      6. pow1/2N/A

        \[\leadsto \frac{d}{{h}^{\frac{1}{2}} \cdot \sqrt{\ell}} \]
      7. associate-/r*N/A

        \[\leadsto \frac{\frac{d}{{h}^{\frac{1}{2}}}}{\color{blue}{\sqrt{\ell}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{d}{{h}^{\frac{1}{2}}}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left({h}^{\frac{1}{2}}\right)\right), \left(\sqrt{\color{blue}{\ell}}\right)\right) \]
      10. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(\sqrt{h}\right)\right), \left(\sqrt{\ell}\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(h\right)\right), \left(\sqrt{\ell}\right)\right) \]
      12. sqrt-lowering-sqrt.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(h\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right) \]
    10. Applied egg-rr57.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{elif}\;\ell \leq 4.3 \cdot 10^{+186}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 63.7% accurate, 2.2× speedup?

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

\mathbf{elif}\;d \leq -2.2 \cdot 10^{-193}:\\
\;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{h \cdot \frac{-0.125 \cdot t\_0}{d}}{\ell} + 1\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -6.60000000000000061e73

    1. Initial program 75.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. Simplified75.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6476.8%

        \[\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) \]
    6. Simplified76.8%

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

    if -6.60000000000000061e73 < d < -2.19999999999999977e-193

    1. Initial program 80.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. Simplified80.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified75.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      3. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      4. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      5. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      6. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr61.8%

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

    if -2.19999999999999977e-193 < d < -9.999999999999969e-311

    1. Initial program 45.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. Simplified45.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if -9.999999999999969e-311 < d < 1.05999999999999998e-149

    1. Initial program 32.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. Simplified32.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. Applied egg-rr27.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05999999999999998e-149 < d

    1. Initial program 62.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 68.8% accurate, 2.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.3999999999999999e190

    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. Simplified76.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6487.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) \]
    6. Simplified87.4%

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

    if -2.3999999999999999e190 < d < -6.6e-90

    1. Initial program 89.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. Simplified82.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(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \frac{M \cdot D}{d}}{4}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{1}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(\left(\frac{h \cdot \frac{D}{d}}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\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(\left(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{\frac{M \cdot \left(M \cdot D\right)}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \left(M \cdot D\right)} \cdot d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\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, \mathsf{*.f64}\left(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{D}{d}\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \left(M \cdot \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{d}\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(\mathsf{/.f64}\left(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6484.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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr84.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right)} \cdot \frac{-0.5}{\ell}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. 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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. /-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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. /-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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f6473.2%

        \[\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Applied egg-rr73.2%

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

    if -6.6e-90 < d < 6.2000000000000004e-295

    1. Initial program 55.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. Simplified59.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified57.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \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, h\right), \ell\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      12. --lowering--.f6470.7%

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

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

    if 6.2000000000000004e-295 < d

    1. Initial program 56.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr63.3%

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

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

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

Alternative 12: 68.1% accurate, 2.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.79999999999999997e190

    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. Simplified76.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6487.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) \]
    6. Simplified87.4%

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

    if -2.79999999999999997e190 < d < -3.5999999999999999e-193

    1. Initial program 81.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. Simplified78.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(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \frac{M \cdot D}{d}}{4}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\right)\right)\right) \]
      2. 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(\left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{1}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(\left(\frac{h \cdot \frac{D}{d}}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\color{blue}{\frac{-1}{2}}, \ell\right)\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(\left(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \frac{M \cdot D}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{\frac{M \cdot \left(M \cdot D\right)}{d}}}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. 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(\frac{\frac{D}{d} \cdot h}{\frac{4}{M \cdot \left(M \cdot D\right)} \cdot d}\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\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, \mathsf{*.f64}\left(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}}\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\color{blue}{\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(\left(\frac{D}{d}\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \left(\frac{4}{M \cdot \left(M \cdot D\right)}\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \left(M \cdot \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{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(\mathsf{sqrt.f64}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \left(M \cdot D\right)\right)\right)\right), \left(\frac{h}{d}\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(\mathsf{/.f64}\left(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \left(\frac{h}{d}\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. /-lowering-/.f6480.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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Applied egg-rr80.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(\frac{\frac{D}{d}}{\frac{4}{M \cdot \left(M \cdot D\right)}} \cdot \frac{h}{d}\right)} \cdot \frac{-0.5}{\ell}\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. 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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. 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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. /-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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. /-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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. /-lowering-/.f6466.1%

        \[\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(D, d\right), \mathsf{/.f64}\left(4, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, D\right)\right)\right)\right), \mathsf{/.f64}\left(h, d\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    7. Applied egg-rr66.1%

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

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

    1. Initial program 45.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. Simplified45.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if -9.999999999999969e-311 < d

    1. Initial program 55.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr62.4%

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

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

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

Alternative 13: 67.2% accurate, 2.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -3.4499999999999999e59

    1. Initial program 76.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. Simplified75.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6474.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) \]
    6. Simplified74.4%

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

    if -3.4499999999999999e59 < d < -2.60000000000000008e-193

    1. Initial program 79.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. Simplified81.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. 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(\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. 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(\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. 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(\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{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(\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. /-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(\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-/.f6466.7%

        \[\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(\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-rr66.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{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) \]

    if -2.60000000000000008e-193 < d < -9.999999999999969e-311

    1. Initial program 45.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. Simplified45.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if -9.999999999999969e-311 < d

    1. Initial program 55.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr62.4%

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

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

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

Alternative 14: 65.2% accurate, 2.3× speedup?

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

\mathbf{elif}\;d \leq -6.2 \cdot 10^{-193}:\\
\;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{h \cdot \frac{-0.125 \cdot t\_0}{d}}{\ell} + 1\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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

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


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

    1. Initial program 75.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. Simplified75.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6476.8%

        \[\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) \]
    6. Simplified76.8%

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

    if -3.4999999999999998e75 < d < -6.2000000000000004e-193

    1. Initial program 80.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. Simplified80.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified75.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      3. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      4. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      5. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      6. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr61.8%

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

    if -6.2000000000000004e-193 < d < -9.999999999999969e-311

    1. Initial program 45.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. Simplified45.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if -9.999999999999969e-311 < d

    1. Initial program 55.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr62.4%

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

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

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

Alternative 15: 62.3% accurate, 2.4× speedup?

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

\mathbf{elif}\;d \leq -4.1 \cdot 10^{-193}:\\
\;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{h \cdot \frac{-0.125 \cdot t\_0}{d}}{\ell} + 1\right) \cdot \sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.2499999999999999e76

    1. Initial program 75.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. Simplified75.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6476.8%

        \[\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) \]
    6. Simplified76.8%

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

    if -2.2499999999999999e76 < d < -4.10000000000000003e-193

    1. Initial program 80.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. Simplified80.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified75.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      3. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      4. 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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      5. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      6. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
      7. /-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(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right), d\right), h\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr61.8%

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

    if -4.10000000000000003e-193 < d < -9.999999999999969e-311

    1. Initial program 45.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. Simplified45.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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if -9.999999999999969e-311 < d

    1. Initial program 55.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. Simplified55.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-rr54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 59.3% accurate, 2.5× speedup?

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

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

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -2e-140 < d < -9.999999999999969e-311

    1. Initial program 53.3%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified53.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{{M}^{2} \cdot \color{blue}{{\left(\sqrt{-1}\right)}^{2}}}{d}\right)\right)\right) \]
    9. Simplified51.0%

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

    if -9.999999999999969e-311 < d

    1. Initial program 55.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. Simplified55.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-rr54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 55.5% accurate, 2.5× speedup?

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

\mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0 - -0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -6.00000000000000037e-140 < d < 2.09999999999999988e-275

    1. Initial program 50.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. 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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified48.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if 2.09999999999999988e-275 < d

    1. Initial program 56.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.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-rr57.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\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), d\right), \left(\frac{h}{d}\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right) \]
      9. /-lowering-/.f6463.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\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), d\right), \mathsf{/.f64}\left(h, d\right)\right), \ell\right), \frac{-1}{8}\right), 1\right)\right) \]
    6. Applied egg-rr63.1%

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

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

Alternative 18: 53.1% accurate, 2.5× speedup?

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

\mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0 - -0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -4.60000000000000005e-142 < d < 2.09999999999999988e-275

    1. Initial program 50.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. 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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified48.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if 2.09999999999999988e-275 < d

    1. Initial program 56.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.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-rr57.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 46.0% accurate, 2.5× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -3.6 \cdot 10^{-140}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{-295}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0 - -0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\ \mathbf{elif}\;d \leq 1.92 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M D_m)
 :precision binary64
 (if (<= d -3.6e-140)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
   (if (<= d 6.2e-295)
     (*
      (sqrt (/ (/ h l) (* l l)))
      (* (/ (* M M) d) (- 0.0 (* -0.125 (* D_m D_m)))))
     (if (<= d 1.92e+59)
       (* (sqrt (/ h (* l (* l l)))) (* (* D_m (* D_m (* M M))) (/ -0.125 d)))
       (/ d (sqrt (* h l)))))))
D_m = fabs(D);
assert(d < h && h < l && l < M && M < D_m);
double code(double d, double h, double l, double M, double D_m) {
	double tmp;
	if (d <= -3.6e-140) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else if (d <= 6.2e-295) {
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * (0.0 - (-0.125 * (D_m * D_m))));
	} else if (d <= 1.92e+59) {
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * (M * M))) * (-0.125 / d));
	} else {
		tmp = d / sqrt((h * l));
	}
	return tmp;
}
D_m = abs(d)
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_m)
    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_m
    real(8) :: tmp
    if (d <= (-3.6d-140)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else if (d <= 6.2d-295) then
        tmp = sqrt(((h / l) / (l * l))) * (((m * m) / d) * (0.0d0 - ((-0.125d0) * (d_m * d_m))))
    else if (d <= 1.92d+59) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_m * (d_m * (m * m))) * ((-0.125d0) / d))
    else
        tmp = d / sqrt((h * l))
    end if
    code = tmp
end function
D_m = Math.abs(D);
assert d < h && h < l && l < M && M < D_m;
public static double code(double d, double h, double l, double M, double D_m) {
	double tmp;
	if (d <= -3.6e-140) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else if (d <= 6.2e-295) {
		tmp = Math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * (0.0 - (-0.125 * (D_m * D_m))));
	} else if (d <= 1.92e+59) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * (M * M))) * (-0.125 / d));
	} else {
		tmp = d / Math.sqrt((h * l));
	}
	return tmp;
}
D_m = math.fabs(D)
[d, h, l, M, D_m] = sort([d, h, l, M, D_m])
def code(d, h, l, M, D_m):
	tmp = 0
	if d <= -3.6e-140:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	elif d <= 6.2e-295:
		tmp = math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * (0.0 - (-0.125 * (D_m * D_m))))
	elif d <= 1.92e+59:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D_m * (D_m * (M * M))) * (-0.125 / d))
	else:
		tmp = d / math.sqrt((h * l))
	return tmp
D_m = abs(D)
d, h, l, M, D_m = sort([d, h, l, M, D_m])
function code(d, h, l, M, D_m)
	tmp = 0.0
	if (d <= -3.6e-140)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	elseif (d <= 6.2e-295)
		tmp = Float64(sqrt(Float64(Float64(h / l) / Float64(l * l))) * Float64(Float64(Float64(M * M) / d) * Float64(0.0 - Float64(-0.125 * Float64(D_m * D_m)))));
	elseif (d <= 1.92e+59)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D_m * Float64(D_m * Float64(M * M))) * Float64(-0.125 / d)));
	else
		tmp = Float64(d / sqrt(Float64(h * l)));
	end
	return tmp
end
D_m = abs(D);
d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
function tmp_2 = code(d, h, l, M, D_m)
	tmp = 0.0;
	if (d <= -3.6e-140)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	elseif (d <= 6.2e-295)
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * (0.0 - (-0.125 * (D_m * D_m))));
	elseif (d <= 1.92e+59)
		tmp = sqrt((h / (l * (l * l)))) * ((D_m * (D_m * (M * M))) * (-0.125 / d));
	else
		tmp = d / sqrt((h * l));
	end
	tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, -3.6e-140], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.2e-295], N[(N[Sqrt[N[(N[(h / l), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(0.0 - N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.92e+59], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D$95$m * N[(D$95$m * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.6 \cdot 10^{-140}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{elif}\;d \leq 6.2 \cdot 10^{-295}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0 - -0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\

\mathbf{elif}\;d \leq 1.92 \cdot 10^{+59}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -3.6e-140 < d < 6.2000000000000004e-295

    1. Initial program 50.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. 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 M around 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, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
    5. 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, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
      2. 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(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \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, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
      4. 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({D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \left(\mathsf{neg}\left(\frac{1}{8}\right)\right)\right)\right)\right)\right) \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)\right)\right)\right) \]
      6. *-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, \left({D}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\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(\left({D}^{2}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\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(D, D\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
      12. 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, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right)\right) \]
      13. 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(D, D\right), \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot \color{blue}{\frac{h}{\ell}}\right)\right)\right)\right) \]
      14. 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(D, D\right), \left(\frac{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h}{\color{blue}{\ell}}\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(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{{d}^{2}}\right) \cdot h\right), \color{blue}{\ell}\right)\right)\right)\right) \]
    6. Simplified50.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \frac{M \cdot M}{d}}{d} \cdot h}{\ell}}\right) \]
    7. 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)} \]
    8. 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. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\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. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\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(\left(\frac{h}{\ell}\right), \left({\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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\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) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      12. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\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) \]
      14. *-lowering-*.f64N/A

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

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

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

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

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

    if 6.2000000000000004e-295 < d < 1.92e59

    1. Initial program 55.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. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr60.3%

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

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

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

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

    if 1.92e59 < d

    1. Initial program 57.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6464.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified64.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6461.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr61.7%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr61.6%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6464.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr64.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.6 \cdot 10^{-140}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{-295}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0 - -0.125 \cdot \left(D \cdot D\right)\right)\right)\\ \mathbf{elif}\;d \leq 1.92 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 46.5% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;d \leq 2.9 \cdot 10^{+59}:\\
\;\;\;\;t\_0 \cdot \left(\left(D\_m \cdot t\_1\right) \cdot \frac{-0.125}{d}\right)\\

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


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

    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. Simplified80.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 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.0%

        \[\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) \]
    6. Simplified63.0%

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

    if -2.39999999999999994e-144 < d < -9.999999999999969e-311

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

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

    if -9.999999999999969e-311 < d < 2.89999999999999991e59

    1. Initial program 54.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr58.8%

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

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

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

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

    if 2.89999999999999991e59 < d

    1. Initial program 57.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6464.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified64.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6461.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr61.7%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr61.6%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6464.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr64.9%

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

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

Alternative 21: 43.5% accurate, 2.5× speedup?

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

\mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\
\;\;\;\;d \cdot {\left(t\_0 \cdot t\_0\right)}^{0.25}\\

\mathbf{elif}\;d \leq 1.92 \cdot 10^{+59}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D\_m \cdot \left(D\_m \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -4.9999999999999998e-144 < d < 2.09999999999999988e-275

    1. Initial program 50.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. 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 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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6416.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified16.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. pow1/2N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\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(\frac{\frac{1}{h}}{\ell}\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}{h}}{\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(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)} \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)}}\right)\right) \]
      6. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\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}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right), \color{blue}{\left(\frac{1}{4}\right)}\right)\right) \]
      8. rem-square-sqrtN/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\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(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{\color{blue}{1}}{4}\right)\right)\right) \]
      11. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\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(\left(\frac{1}{h}\right), \ell\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\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(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      17. metadata-eval28.0%

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

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

    if 2.09999999999999988e-275 < d < 1.92e59

    1. Initial program 55.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr60.8%

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

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

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

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

    if 1.92e59 < d

    1. Initial program 57.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6464.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified64.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6461.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr61.7%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr61.6%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6464.9%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr64.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5 \cdot 10^{-144}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\ \;\;\;\;d \cdot {\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right)}^{0.25}\\ \mathbf{elif}\;d \leq 1.92 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 44.0% accurate, 2.5× speedup?

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

\mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\
\;\;\;\;d \cdot {\left(t\_0 \cdot t\_0\right)}^{0.25}\\

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

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -9.8000000000000002e-144 < d < 2.09999999999999988e-275

    1. Initial program 50.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. 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 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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6416.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified16.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. pow1/2N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\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(\frac{\frac{1}{h}}{\ell}\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}{h}}{\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(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)} \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)}}\right)\right) \]
      6. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\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}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right), \color{blue}{\left(\frac{1}{4}\right)}\right)\right) \]
      8. rem-square-sqrtN/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\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(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{\color{blue}{1}}{4}\right)\right)\right) \]
      11. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\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(\left(\frac{1}{h}\right), \ell\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\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(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      17. metadata-eval28.0%

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

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

    if 2.09999999999999988e-275 < d < 1.27999999999999994e-42

    1. Initial program 44.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.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 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. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{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 {M}^{2}}{d}\right)\right) \]
      11. 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(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{\color{blue}{d}}\right)\right) \]
      12. *-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(\frac{\frac{-1}{8} \cdot \left({M}^{2} \cdot {D}^{2}\right)}{d}\right)\right) \]
      13. 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(\frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}{d}\right)\right) \]
      14. *-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(\frac{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}{d}\right)\right) \]
      15. 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({D}^{2} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right)\right) \]
      16. 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({D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. *-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), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right)\right) \]
      18. 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), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2}}{d}\right)\right)\right) \]
      19. *-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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2}}{d}\right)\right)\right) \]
      20. *-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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{M}^{2}}{d}\right)}\right)\right)\right) \]
      21. /-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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\left({M}^{2}\right), \color{blue}{d}\right)\right)\right)\right) \]
      22. 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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\left(M \cdot M\right), d\right)\right)\right)\right) \]
      23. *-lowering-*.f6427.8%

        \[\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), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), d\right)\right)\right)\right) \]
    6. Simplified27.8%

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

    if 1.27999999999999994e-42 < d

    1. Initial program 64.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6454.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified54.7%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6453.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr53.0%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6452.9%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr52.9%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6456.6%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr56.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -9.8 \cdot 10^{-144}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{-275}:\\ \;\;\;\;d \cdot {\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right)}^{0.25}\\ \mathbf{elif}\;d \leq 1.28 \cdot 10^{-42}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \left(-0.125 \cdot \frac{M \cdot M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 74.5% accurate, 2.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -3.2999999999999998e-308

    1. Initial program 73.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.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 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(\left({\left(\sqrt{-1}\right)}^{2} \cdot d\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\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) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(-1 \cdot d\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \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) \]
      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-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\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) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \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) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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), \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, h\right), \ell\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, h\right), \ell\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--.f6478.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\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. Simplified78.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \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 -3.2999999999999998e-308 < h

    1. Initial program 55.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      4. unpow2N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{1}{2}}{\frac{\ell}{h}}\right)\right)\right) \]
      5. associate-*l*N/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      6. div-invN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      7. times-fracN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right)\right)\right) \]
      8. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)}\right)\right)\right) \]
      9. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}}{\frac{1}{h}}\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      11. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(2 \cdot d\right)\right), \ell\right), \left(\frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      12. *-commutativeN/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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(d \cdot 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      13. *-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      14. /-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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(d, 2\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{1}{h}\right)}\right)\right)\right)\right) \]
    4. Applied egg-rr61.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -3.3 \cdot 10^{-308}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\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)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(h \cdot \frac{M \cdot D}{d \cdot 4}\right) \cdot \frac{\frac{M \cdot D}{d \cdot -2}}{\ell} + 1\right) \cdot \frac{d}{{\left(h \cdot \ell\right)}^{0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 43.2% accurate, 2.7× speedup?

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

\mathbf{elif}\;d \leq 6.5 \cdot 10^{-305}:\\
\;\;\;\;d \cdot {\left(t\_0 \cdot t\_0\right)}^{0.25}\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -1.7999999999999999e-143 < d < 6.49999999999999991e-305

    1. Initial program 51.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. 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. 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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6413.4%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified13.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    7. Step-by-step derivation
      1. pow1/2N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\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(\frac{\frac{1}{h}}{\ell}\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}{h}}{\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(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)} \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{\left(\frac{1}{4}\right)}}\right)\right) \]
      6. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\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}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right), \color{blue}{\left(\frac{1}{4}\right)}\right)\right) \]
      8. rem-square-sqrtN/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\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(\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{\color{blue}{1}}{4}\right)\right)\right) \]
      11. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\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(\left(\frac{1}{h}\right), \ell\right), \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\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(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\frac{1}{4}\right)\right)\right) \]
      17. metadata-eval26.4%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \frac{1}{4}\right)\right) \]
    8. Applied egg-rr26.4%

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

    if 6.49999999999999991e-305 < d

    1. Initial program 55.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. Simplified56.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6439.1%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified39.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6438.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr38.9%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6438.8%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr38.8%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6441.8%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr41.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.8 \cdot 10^{-143}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-305}:\\ \;\;\;\;d \cdot {\left(\frac{\frac{1}{h}}{\ell} \cdot \frac{\frac{1}{h}}{\ell}\right)}^{0.25}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 43.2% accurate, 2.8× speedup?

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

\mathbf{elif}\;d \leq 1.3 \cdot 10^{-308}:\\
\;\;\;\;d \cdot {\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}\\

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


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

    1. Initial program 80.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.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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6463.7%

        \[\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) \]
    6. Simplified63.7%

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

    if -9.2e-144 < d < 1.3e-308

    1. Initial program 53.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified56.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6413.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified13.7%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6413.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr13.7%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
    9. Step-by-step derivation
      1. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right), d\right) \]
      2. pow-prod-downN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \left(h \cdot \ell\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), d\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \mathsf{*.f64}\left(h, \ell\right)\right), \left(\frac{\frac{-1}{2}}{2}\right)\right), d\right) \]
      7. metadata-eval27.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \mathsf{*.f64}\left(h, \ell\right)\right), \frac{-1}{4}\right), d\right) \]
    10. Applied egg-rr27.0%

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

    if 1.3e-308 < d

    1. Initial program 55.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. Simplified55.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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6438.8%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified38.8%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6438.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr38.6%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6438.5%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
    10. Applied egg-rr38.5%

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6441.5%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr41.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -9.2 \cdot 10^{-144}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq 1.3 \cdot 10^{-308}:\\ \;\;\;\;d \cdot {\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 42.6% accurate, 2.9× speedup?

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

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


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

    1. Initial program 73.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. 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. 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 \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      2. unpow2N/A

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\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--.f6449.0%

        \[\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) \]
    6. Simplified49.0%

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

    if 5.79999999999999965e-296 < l

    1. Initial program 54.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. 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-/r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6440.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    6. Simplified40.3%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
      5. sqrt-pow1N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      9. *-lowering-*.f6440.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr40.1%

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

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
      3. pow-flipN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      7. *-lowering-*.f6440.0%

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

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

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      6. neg-sub0N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \left(0 - \sqrt{h \cdot \ell}\right)\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \left(\sqrt{h \cdot \ell}\right)\right)\right)\right) \]
      8. 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) \]
      9. *-lowering-*.f6442.4%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(d, \mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right)\right)\right) \]
    12. Applied egg-rr42.4%

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

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

Alternative 27: 38.1% accurate, 3.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < -3.94999999999999987e-205

    1. Initial program 78.8%

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

      \[\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \color{blue}{1}\right) \]
    4. Step-by-step derivation
      1. Simplified54.2%

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

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

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

          \[\leadsto {\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \]
        4. pow-prod-downN/A

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

          \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
        6. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
        7. clear-numN/A

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

          \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{1 \cdot \frac{d}{\ell}}{\frac{h}{d}}\right)\right) \]
        9. clear-numN/A

          \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{1 \cdot \frac{1}{\frac{\ell}{d}}}{\frac{h}{d}}\right)\right) \]
        10. div-invN/A

          \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{\ell}{d}}}{\frac{h}{d}}\right)\right) \]
        11. clear-numN/A

          \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{\ell}}{\frac{h}{d}}\right)\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{h}{d}\right)\right)\right) \]
        13. /-lowering-/.f64N/A

          \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{h}{d}\right)\right)\right) \]
        14. /-lowering-/.f6441.6%

          \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(h, d\right)\right)\right) \]
      3. Applied egg-rr41.6%

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

      if -3.94999999999999987e-205 < d

      1. Initial program 53.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.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-/r*N/A

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

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
        5. /-lowering-/.f6437.3%

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
      6. Simplified37.3%

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 28: 38.1% accurate, 3.0× speedup?

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

      1. Initial program 78.8%

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

        \[\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{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \color{blue}{1}\right) \]
      4. Step-by-step derivation
        1. Simplified54.2%

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

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

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

            \[\leadsto {\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \]
          4. pow-prod-downN/A

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

            \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
          6. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
          7. clear-numN/A

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

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{1 \cdot \frac{d}{\ell}}{\frac{h}{d}}\right)\right) \]
          9. clear-numN/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{1 \cdot \frac{1}{\frac{\ell}{d}}}{\frac{h}{d}}\right)\right) \]
          10. div-invN/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{\ell}{d}}}{\frac{h}{d}}\right)\right) \]
          11. clear-numN/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{\ell}}{\frac{h}{d}}\right)\right) \]
          12. /-lowering-/.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{h}{d}\right)\right)\right) \]
          13. /-lowering-/.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{h}{d}\right)\right)\right) \]
          14. /-lowering-/.f6441.6%

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(h, d\right)\right)\right) \]
        3. Applied egg-rr41.6%

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

        if -6.99999999999999979e-206 < d

        1. Initial program 53.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.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-/r*N/A

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

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
          5. /-lowering-/.f6437.3%

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
        6. Simplified37.3%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
          4. inv-powN/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
          5. sqrt-pow1N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
          9. *-lowering-*.f6437.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
        8. Applied egg-rr37.1%

          \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification39.1%

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

      Alternative 29: 38.1% accurate, 3.0× speedup?

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

        1. Initial program 78.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. Simplified78.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-/r*N/A

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

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
          5. /-lowering-/.f642.3%

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
        6. Simplified2.3%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
          4. inv-powN/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
          5. sqrt-pow1N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
          9. *-lowering-*.f642.3%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
        8. Applied egg-rr2.3%

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

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

            \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
          3. pow-flipN/A

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

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

            \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
          6. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
          7. *-lowering-*.f642.3%

            \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{1}{2}\right)\right) \]
        10. Applied egg-rr2.3%

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

            \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
          2. rem-square-sqrtN/A

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

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

            \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
          5. frac-timesN/A

            \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
          6. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)\right) \]
          7. clear-numN/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{h} \cdot \frac{1}{\frac{\ell}{d}}\right)\right) \]
          8. un-div-invN/A

            \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{\frac{d}{h}}{\frac{\ell}{d}}\right)\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{h}\right), \left(\frac{\ell}{d}\right)\right)\right) \]
          10. /-lowering-/.f64N/A

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{\ell}{d}\right)\right)\right) \]
          11. /-lowering-/.f6441.5%

            \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(\ell, d\right)\right)\right) \]
        12. Applied egg-rr41.5%

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

        if -4.10000000000000016e-206 < d

        1. Initial program 53.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.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-/r*N/A

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

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
          5. /-lowering-/.f6437.3%

            \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
        6. Simplified37.3%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
          4. inv-powN/A

            \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
          5. sqrt-pow1N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
          9. *-lowering-*.f6437.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
        8. Applied egg-rr37.1%

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

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

      Alternative 30: 26.6% accurate, 3.1× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ d \cdot {\left(h \cdot \ell\right)}^{-0.5} \end{array} \]
      D_m = (fabs.f64 D)
      NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M D_m) :precision binary64 (* d (pow (* h l) -0.5)))
      D_m = fabs(D);
      assert(d < h && h < l && l < M && M < D_m);
      double code(double d, double h, double l, double M, double D_m) {
      	return d * pow((h * l), -0.5);
      }
      
      D_m = abs(d)
      NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
      real(8) function code(d, h, l, m, d_m)
          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_m
          code = d * ((h * l) ** (-0.5d0))
      end function
      
      D_m = Math.abs(D);
      assert d < h && h < l && l < M && M < D_m;
      public static double code(double d, double h, double l, double M, double D_m) {
      	return d * Math.pow((h * l), -0.5);
      }
      
      D_m = math.fabs(D)
      [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
      def code(d, h, l, M, D_m):
      	return d * math.pow((h * l), -0.5)
      
      D_m = abs(D)
      d, h, l, M, D_m = sort([d, h, l, M, D_m])
      function code(d, h, l, M, D_m)
      	return Float64(d * (Float64(h * l) ^ -0.5))
      end
      
      D_m = abs(D);
      d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
      function tmp = code(d, h, l, M, D_m)
      	tmp = d * ((h * l) ^ -0.5);
      end
      
      D_m = N[Abs[D], $MachinePrecision]
      NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
      code[d_, h_, l_, M_, D$95$m_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
      \\
      d \cdot {\left(h \cdot \ell\right)}^{-0.5}
      \end{array}
      
      Derivation
      1. Initial program 64.3%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. 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-/r*N/A

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

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
        5. /-lowering-/.f6422.1%

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
      6. Simplified22.1%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
        4. inv-powN/A

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
        5. sqrt-pow1N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
        9. *-lowering-*.f6422.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
      8. Applied egg-rr22.0%

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

        \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]
      10. Add Preprocessing

      Alternative 31: 26.6% accurate, 3.2× speedup?

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

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. 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-/r*N/A

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

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
        5. /-lowering-/.f6422.1%

          \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
      6. Simplified22.1%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\ell \cdot h}}\right), d\right) \]
        4. inv-powN/A

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right), d\right) \]
        5. sqrt-pow1N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{-1}{2}\right), d\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
        9. *-lowering-*.f6422.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
      8. Applied egg-rr22.0%

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

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

          \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \]
        3. pow-flipN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)}\right) \]
        6. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
        7. *-lowering-*.f6422.0%

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

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

          \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{h \cdot \ell}\right)\right) \]
        2. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
        3. *-lowering-*.f6422.0%

          \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
      12. Applied egg-rr22.0%

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

      Reproduce

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