Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.3% → 78.0%
Time: 24.6s
Alternatives: 24
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 24 alternatives:

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

Initial Program: 66.3% accurate, 1.0× speedup?

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

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

Alternative 1: 78.0% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -2.4999999999999998e-130

    1. Initial program 54.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. Simplified54.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(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999998e-130 < l < -9.999999999999969e-311

    1. Initial program 75.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. 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. associate-/r*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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{M \cdot D}{2}}{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) \]
      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(\left(\frac{M \cdot D}{2}\right), 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) \]
      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(\left(\frac{D \cdot M}{2}\right), d\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) \]
      13. 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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\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) \]
      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(D, \left(\frac{M}{2}\right)\right), d\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) \]
      15. /-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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot \color{blue}{D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\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.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{D \cdot \frac{M}{2}}{d}}{\ell} \cdot \frac{\frac{D \cdot \frac{M}{2}}{d} \cdot 0.5}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l < 6.0000000000000003e131

    1. Initial program 62.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. Simplified65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.0000000000000003e131 < l

    1. Initial program 51.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. associate-/r*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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{M \cdot D}{2}}{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) \]
      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(\left(\frac{M \cdot D}{2}\right), 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) \]
      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(\left(\frac{D \cdot M}{2}\right), d\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) \]
      13. 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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\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) \]
      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(D, \left(\frac{M}{2}\right)\right), d\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) \]
      15. /-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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot \color{blue}{D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\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-rr51.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{D \cdot \frac{M}{2}}{d}}{\ell} \cdot \frac{\frac{D \cdot \frac{M}{2}}{d} \cdot 0.5}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

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

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

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

Alternative 2: 78.7% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -3.3000000000000001e-125

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000001e-125 < l < -9.999999999999969e-311

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\ell}\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, \ell\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, h\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. Applied egg-rr92.8%

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

    if -9.999999999999969e-311 < l < 3.60000000000000031e131

    1. Initial program 62.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. Simplified65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.60000000000000031e131 < l

    1. Initial program 51.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. associate-/r*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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{M \cdot D}{2}}{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) \]
      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(\left(\frac{M \cdot D}{2}\right), 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) \]
      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(\left(\frac{D \cdot M}{2}\right), d\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) \]
      13. 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, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\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) \]
      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(D, \left(\frac{M}{2}\right)\right), d\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) \]
      15. /-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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot \color{blue}{D}}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{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(D, \mathsf{/.f64}\left(M, 2\right)\right), d\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-rr51.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{D \cdot \frac{M}{2}}{d}}{\ell} \cdot \frac{\frac{D \cdot \frac{M}{2}}{d} \cdot 0.5}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

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

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

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

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

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

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

Alternative 3: 76.4% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.55000000000000008e-53

    1. Initial program 59.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. Simplified57.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000008e-53 < h < -5.00000000000023e-311

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\frac{1}{\ell}\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(1\right)}{\ell}\right)\right), \left(\sqrt{\mathsf{neg}\left(h\right)}\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(-1, \ell\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, h\right)\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. Applied egg-rr91.7%

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

    if -5.00000000000023e-311 < h

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l < 2.15000000000000013e173

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15000000000000013e173 < l

    1. Initial program 51.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. Simplified50.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 \mathsf{*.f64}\left(\color{blue}{\left(d \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. *-lowering-*.f64N/A

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

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

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

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

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

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\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) \]
    7. Taylor expanded in M around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\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) \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 60.0% accurate, 2.4× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.5%

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

    if -4.7999999999999999e-168 < d < -4.999999999999985e-310

    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. Simplified51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < d

    1. Initial program 59.4%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(d \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. *-lowering-*.f64N/A

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

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

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

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

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

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\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) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

Alternative 6: 60.6% accurate, 2.5× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.5%

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

    if -2.15000000000000003e-165 < d < -4.999999999999985e-310

    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. Simplified51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < d

    1. Initial program 59.4%

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

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

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

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

Alternative 7: 47.7% accurate, 2.5× speedup?

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

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.5%

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

    if -6.0000000000000005e-166 < d < -2.89999999999999994e-302

    1. Initial program 52.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. Simplified49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.89999999999999994e-302 < d < 4.00000000000000031e-43

    1. Initial program 50.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. Simplified51.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000031e-43 < d

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6 \cdot 10^{-166}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-302}:\\ \;\;\;\;\left(\left(M \cdot M\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \left(0 - D \cdot D\right)\right)\right) \cdot \frac{-0.125}{d}\\ \mathbf{elif}\;d \leq 4 \cdot 10^{-43}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 47.5% accurate, 2.5× speedup?

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

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.5%

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

    if -1.4e-165 < d < -2.89999999999999994e-302

    1. Initial program 52.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. Simplified49.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{8}, \mathsf{*.f64}\left(D, D\right)\right), d\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right)\right)\right) \]
      17. unpow3N/A

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

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

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

    if -2.89999999999999994e-302 < d < 1.60000000000000006e-41

    1. Initial program 50.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. Simplified51.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000006e-41 < d

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.4 \cdot 10^{-165}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-302}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.125}{d} \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}}\right)\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-41}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 46.8% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;d \leq 130000000:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(\sqrt{\frac{\frac{h}{\ell \cdot \ell}}{\ell}} \cdot \frac{-0.125 \cdot \left(M\_m \cdot M\_m\right)}{d}\right)\\

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


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

    1. Initial program 64.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. Simplified66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.0%

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

    if -5.5000000000000004e-172 < d < 2.90000000000000002e-291

    1. Initial program 47.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. Simplified44.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 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. Simplified43.8%

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

    if 2.90000000000000002e-291 < d < 1.3e8

    1. Initial program 56.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. Simplified58.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. Step-by-step derivation
      1. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e8 < d

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.6% accurate, 2.5× speedup?

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

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


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

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 75.3% accurate, 2.5× speedup?

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

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


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

    1. Initial program 61.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified62.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. Step-by-step derivation
      1. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 74.9% accurate, 2.5× speedup?

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

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


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

    1. Initial program 60.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. Simplified61.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(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2999999999999999e-308 < d

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 74.1% accurate, 2.5× speedup?

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

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


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

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. *-lowering-*.f6480.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified80.7%

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{\frac{M \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)}{4 \cdot \frac{d}{D}}}{\frac{\ell}{-0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(1 + \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 73.5% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{M\_m \cdot \frac{M\_m \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(1 + \frac{M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= h -5e-311)
   (*
    (* d (pow (* l h) -0.5))
    (- -1.0 (* (/ -0.5 l) (* (/ (* M_m (/ (* M_m D) d)) 4.0) (* h (/ D d))))))
   (*
    (* d (sqrt (/ 1.0 (* l h))))
    (+ 1.0 (* (/ (* M_m (* h (/ (/ M_m (/ d D)) 4.0))) l) (/ (/ D d) -2.0))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (h <= -5e-311) {
		tmp = (d * pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * (((M_m * ((M_m * D) / d)) / 4.0) * (h * (D / d)))));
	} else {
		tmp = (d * sqrt((1.0 / (l * h)))) * (1.0 + (((M_m * (h * ((M_m / (d / D)) / 4.0))) / l) * ((D / d) / -2.0)));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (h <= (-5d-311)) then
        tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - (((-0.5d0) / l) * (((m_m * ((m_m * d_1) / d)) / 4.0d0) * (h * (d_1 / d)))))
    else
        tmp = (d * sqrt((1.0d0 / (l * h)))) * (1.0d0 + (((m_m * (h * ((m_m / (d / d_1)) / 4.0d0))) / l) * ((d_1 / d) / (-2.0d0))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (h <= -5e-311) {
		tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * (((M_m * ((M_m * D) / d)) / 4.0) * (h * (D / d)))));
	} else {
		tmp = (d * Math.sqrt((1.0 / (l * h)))) * (1.0 + (((M_m * (h * ((M_m / (d / D)) / 4.0))) / l) * ((D / d) / -2.0)));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if h <= -5e-311:
		tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * (((M_m * ((M_m * D) / d)) / 4.0) * (h * (D / d)))))
	else:
		tmp = (d * math.sqrt((1.0 / (l * h)))) * (1.0 + (((M_m * (h * ((M_m / (d / D)) / 4.0))) / l) * ((D / d) / -2.0)))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (h <= -5e-311)
		tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(Float64(-0.5 / l) * Float64(Float64(Float64(M_m * Float64(Float64(M_m * D) / d)) / 4.0) * Float64(h * Float64(D / d))))));
	else
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(1.0 + Float64(Float64(Float64(M_m * Float64(h * Float64(Float64(M_m / Float64(d / D)) / 4.0))) / l) * Float64(Float64(D / d) / -2.0))));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (h <= -5e-311)
		tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - ((-0.5 / l) * (((M_m * ((M_m * D) / d)) / 4.0) * (h * (D / d)))));
	else
		tmp = (d * sqrt((1.0 / (l * h)))) * (1.0 + (((M_m * (h * ((M_m / (d / D)) / 4.0))) / l) * ((D / d) / -2.0)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[h, -5e-311], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(N[(-0.5 / l), $MachinePrecision] * N[(N[(N[(M$95$m * N[(N[(M$95$m * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision] * N[(h * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M$95$m * N[(h * N[(N[(M$95$m / N[(d / D), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{M\_m \cdot \frac{M\_m \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(1 + \frac{M\_m \cdot \left(h \cdot \frac{\frac{M\_m}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -5.00000000000023e-311

    1. Initial program 61.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified62.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 h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. --lowering--.f6477.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    6. Simplified77.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)\right)} \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right) \]
    7. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \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) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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{neg.f64}\left(\mathsf{*.f64}\left(d, \left(\sqrt{\frac{\frac{1}{\ell}}{h}}\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. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\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. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\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) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. *-lowering-*.f6477.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Applied egg-rr77.3%

      \[\leadsto \color{blue}{\left(-d \cdot {\left(h \cdot \ell\right)}^{-0.5}\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.00000000000023e-311 < h

    1. Initial program 59.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified60.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\ell}{\frac{-1}{2}}}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\frac{\color{blue}{\ell}}{\frac{-1}{2}}}\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \color{blue}{\frac{1}{\frac{-1}{2}}}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot -2}\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h\right) \cdot \frac{D}{d}}{\ell \cdot \left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell} \cdot \color{blue}{\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot h}{\ell}\right), \color{blue}{\left(\frac{\frac{D}{d}}{\mathsf{neg}\left(2\right)}\right)}\right)\right)\right) \]
    5. Applied egg-rr64.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{\frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}}\right) \]
    6. Taylor expanded in d around 0

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
      4. *-lowering-*.f6480.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, D\right)\right), 4\right), h\right)\right), \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, d\right), -2\right)\right)\right)\right) \]
    8. Simplified80.7%

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot \left(1 + \frac{M \cdot \left(\frac{\frac{M}{\frac{d}{D}}}{4} \cdot h\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(1 + \frac{M \cdot \left(h \cdot \frac{\frac{M}{\frac{d}{D}}}{4}\right)}{\ell} \cdot \frac{\frac{D}{d}}{-2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 72.4% accurate, 2.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{M\_m \cdot D}{d}\\ \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{t\_0}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\frac{h \cdot t\_0}{4} \cdot \left(-0.5 \cdot \frac{D}{d}\right)}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (* M_m (/ (* M_m D) d))))
   (if (<= h -5e-311)
     (*
      (* d (pow (* l h) -0.5))
      (- -1.0 (* (/ -0.5 l) (* (/ t_0 4.0) (* h (/ D d))))))
     (*
      (/ d (sqrt (* l h)))
      (+ 1.0 (/ (* (/ (* h t_0) 4.0) (* -0.5 (/ D d))) l))))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = M_m * ((M_m * D) / d);
	double tmp;
	if (h <= -5e-311) {
		tmp = (d * pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * ((t_0 / 4.0) * (h * (D / d)))));
	} else {
		tmp = (d / sqrt((l * h))) * (1.0 + ((((h * t_0) / 4.0) * (-0.5 * (D / d))) / l));
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = m_m * ((m_m * d_1) / d)
    if (h <= (-5d-311)) then
        tmp = (d * ((l * h) ** (-0.5d0))) * ((-1.0d0) - (((-0.5d0) / l) * ((t_0 / 4.0d0) * (h * (d_1 / d)))))
    else
        tmp = (d / sqrt((l * h))) * (1.0d0 + ((((h * t_0) / 4.0d0) * ((-0.5d0) * (d_1 / d))) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = M_m * ((M_m * D) / d);
	double tmp;
	if (h <= -5e-311) {
		tmp = (d * Math.pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * ((t_0 / 4.0) * (h * (D / d)))));
	} else {
		tmp = (d / Math.sqrt((l * h))) * (1.0 + ((((h * t_0) / 4.0) * (-0.5 * (D / d))) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = M_m * ((M_m * D) / d)
	tmp = 0
	if h <= -5e-311:
		tmp = (d * math.pow((l * h), -0.5)) * (-1.0 - ((-0.5 / l) * ((t_0 / 4.0) * (h * (D / d)))))
	else:
		tmp = (d / math.sqrt((l * h))) * (1.0 + ((((h * t_0) / 4.0) * (-0.5 * (D / d))) / l))
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = Float64(M_m * Float64(Float64(M_m * D) / d))
	tmp = 0.0
	if (h <= -5e-311)
		tmp = Float64(Float64(d * (Float64(l * h) ^ -0.5)) * Float64(-1.0 - Float64(Float64(-0.5 / l) * Float64(Float64(t_0 / 4.0) * Float64(h * Float64(D / d))))));
	else
		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(Float64(Float64(Float64(h * t_0) / 4.0) * Float64(-0.5 * Float64(D / d))) / l)));
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = M_m * ((M_m * D) / d);
	tmp = 0.0;
	if (h <= -5e-311)
		tmp = (d * ((l * h) ^ -0.5)) * (-1.0 - ((-0.5 / l) * ((t_0 / 4.0) * (h * (D / d)))));
	else
		tmp = (d / sqrt((l * h))) * (1.0 + ((((h * t_0) / 4.0) * (-0.5 * (D / d))) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[(M$95$m * N[(N[(M$95$m * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-311], N[(N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(N[(-0.5 / l), $MachinePrecision] * N[(N[(t$95$0 / 4.0), $MachinePrecision] * N[(h * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(N[(h * t$95$0), $MachinePrecision] / 4.0), $MachinePrecision] * N[(-0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{M\_m \cdot D}{d}\\
\mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{t\_0}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\frac{h \cdot t\_0}{4} \cdot \left(-0.5 \cdot \frac{D}{d}\right)}{\ell}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -5.00000000000023e-311

    1. Initial program 61.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified62.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 h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      12. --lowering--.f6477.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, d\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    6. Simplified77.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)\right)} \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right) \]
    7. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \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) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\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{neg.f64}\left(\mathsf{*.f64}\left(d, \left(\sqrt{\frac{\frac{1}{\ell}}{h}}\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. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      10. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\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. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\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) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      13. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      14. *-lowering-*.f6477.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
    8. Applied egg-rr77.3%

      \[\leadsto \color{blue}{\left(-d \cdot {\left(h \cdot \ell\right)}^{-0.5}\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.00000000000023e-311 < h

    1. Initial program 59.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified60.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 0

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(d \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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \left(\sqrt{\frac{1}{h \cdot \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) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\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) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\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. /-lowering-/.f6477.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\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. Simplified77.6%

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\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) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right), \color{blue}{\left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{\frac{-1}{2}}{\ell}\right)}\right) \]
    8. Applied egg-rr77.4%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + \frac{\frac{\left(M \cdot \frac{D \cdot M}{d}\right) \cdot h}{4} \cdot \left(\frac{D}{d} \cdot -0.5\right)}{\ell}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(d \cdot {\left(\ell \cdot h\right)}^{-0.5}\right) \cdot \left(-1 - \frac{-0.5}{\ell} \cdot \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\frac{h \cdot \left(M \cdot \frac{M \cdot D}{d}\right)}{4} \cdot \left(-0.5 \cdot \frac{D}{d}\right)}{\ell}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 44.9% accurate, 2.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -5.6 \cdot 10^{-172}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -1.66 \cdot 10^{-307}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= d -5.6e-172)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
   (if (<= d -1.66e-307)
     (* (sqrt (/ h (* l (* l l)))) (* (* D (* D (/ (* M_m M_m) d))) 0.125))
     (* (sqrt (/ (/ 1.0 l) h)) d))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (d <= -5.6e-172) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else if (d <= -1.66e-307) {
		tmp = sqrt((h / (l * (l * l)))) * ((D * (D * ((M_m * M_m) / d))) * 0.125);
	} else {
		tmp = sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (d <= (-5.6d-172)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else if (d <= (-1.66d-307)) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_1 * (d_1 * ((m_m * m_m) / d))) * 0.125d0)
    else
        tmp = sqrt(((1.0d0 / l) / h)) * d
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (d <= -5.6e-172) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else if (d <= -1.66e-307) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * (D * ((M_m * M_m) / d))) * 0.125);
	} else {
		tmp = Math.sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if d <= -5.6e-172:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	elif d <= -1.66e-307:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D * (D * ((M_m * M_m) / d))) * 0.125)
	else:
		tmp = math.sqrt(((1.0 / l) / h)) * d
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (d <= -5.6e-172)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	elseif (d <= -1.66e-307)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(Float64(M_m * M_m) / d))) * 0.125));
	else
		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (d <= -5.6e-172)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	elseif (d <= -1.66e-307)
		tmp = sqrt((h / (l * (l * l)))) * ((D * (D * ((M_m * M_m) / d))) * 0.125);
	else
		tmp = sqrt(((1.0 / l) / h)) * d;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[d, -5.6e-172], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.66e-307], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.6 \cdot 10^{-172}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{elif}\;d \leq -1.66 \cdot 10^{-307}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot 0.125\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -5.60000000000000023e-172

    1. Initial program 64.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. Simplified66.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f645.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified5.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}}\right), \color{blue}{d}\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right), d\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right), d\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right), d\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right), d\right) \]
      7. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      11. *-lowering-*.f644.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr4.5%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
    9. Taylor expanded in h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}, d\right) \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right), d\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\left(0 - \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right), d\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right), d\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right), d\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right), d\right) \]
      10. /-lowering-/.f6456.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified56.0%

      \[\leadsto \color{blue}{\left(0 - \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} \cdot d \]

    if -5.60000000000000023e-172 < d < -1.66000000000000007e-307

    1. Initial program 52.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. Simplified49.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 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. Simplified48.6%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)} \]

    if -1.66000000000000007e-307 < d

    1. Initial program 59.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified60.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6445.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified45.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.6 \cdot 10^{-172}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -1.66 \cdot 10^{-307}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot 0.125\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 42.9% accurate, 2.9× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7.2 \cdot 10^{-286}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -7.2e-286)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
   (* (sqrt (/ (/ 1.0 l) h)) d)))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -7.2e-286) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else {
		tmp = sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-7.2d-286)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else
        tmp = sqrt(((1.0d0 / l) / h)) * d
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -7.2e-286) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else {
		tmp = Math.sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -7.2e-286:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	else:
		tmp = math.sqrt(((1.0 / l) / h)) * d
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -7.2e-286)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	else
		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -7.2e-286)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	else
		tmp = sqrt(((1.0 / l) / h)) * d;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -7.2e-286], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.2 \cdot 10^{-286}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -7.20000000000000027e-286

    1. Initial program 60.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. Simplified61.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f647.9%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified7.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}}\right), \color{blue}{d}\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right), d\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right), d\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right), d\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right), d\right) \]
      7. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      11. *-lowering-*.f647.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    8. Applied egg-rr7.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
    9. Taylor expanded in h around -inf

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}, d\right) \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      3. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right), d\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\left(0 - \sqrt{\frac{1}{h \cdot \ell}}\right), d\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right), d\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right), d\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right), d\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right), d\right) \]
      10. /-lowering-/.f6449.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right), d\right) \]
    11. Simplified49.2%

      \[\leadsto \color{blue}{\left(0 - \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} \cdot d \]

    if -7.20000000000000027e-286 < l

    1. Initial program 60.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. Simplified61.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6444.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified44.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -7.2 \cdot 10^{-286}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 42.9% accurate, 2.9× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{if}\;\ell \leq -1.45 \cdot 10^{-285}:\\ \;\;\;\;t\_0 \cdot \left(0 - d\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot d\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (let* ((t_0 (sqrt (/ (/ 1.0 l) h))))
   (if (<= l -1.45e-285) (* t_0 (- 0.0 d)) (* t_0 d))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double t_0 = sqrt(((1.0 / l) / h));
	double tmp;
	if (l <= -1.45e-285) {
		tmp = t_0 * (0.0 - d);
	} else {
		tmp = t_0 * d;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((1.0d0 / l) / h))
    if (l <= (-1.45d-285)) then
        tmp = t_0 * (0.0d0 - d)
    else
        tmp = t_0 * d
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double t_0 = Math.sqrt(((1.0 / l) / h));
	double tmp;
	if (l <= -1.45e-285) {
		tmp = t_0 * (0.0 - d);
	} else {
		tmp = t_0 * d;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	t_0 = math.sqrt(((1.0 / l) / h))
	tmp = 0
	if l <= -1.45e-285:
		tmp = t_0 * (0.0 - d)
	else:
		tmp = t_0 * d
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	t_0 = sqrt(Float64(Float64(1.0 / l) / h))
	tmp = 0.0
	if (l <= -1.45e-285)
		tmp = Float64(t_0 * Float64(0.0 - d));
	else
		tmp = Float64(t_0 * d);
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	t_0 = sqrt(((1.0 / l) / h));
	tmp = 0.0;
	if (l <= -1.45e-285)
		tmp = t_0 * (0.0 - d);
	else
		tmp = t_0 * d;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.45e-285], N[(t$95$0 * N[(0.0 - d), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{-285}:\\
\;\;\;\;t\_0 \cdot \left(0 - d\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot d\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.45e-285

    1. Initial program 60.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. Simplified61.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 l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6449.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    6. Simplified49.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)} \]

    if -1.45e-285 < l

    1. Initial program 60.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. Simplified61.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6444.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified44.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.45 \cdot 10^{-285}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(0 - d\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 42.8% accurate, 2.9× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.2 \cdot 10^{-286}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D)
 :precision binary64
 (if (<= l -4.2e-286)
   (* (- 0.0 d) (sqrt (/ 1.0 (* l h))))
   (* (sqrt (/ (/ 1.0 l) h)) d)))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -4.2e-286) {
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	} else {
		tmp = sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-4.2d-286)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (l * h)))
    else
        tmp = sqrt(((1.0d0 / l) / h)) * d
    end if
    code = tmp
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	double tmp;
	if (l <= -4.2e-286) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (l * h)));
	} else {
		tmp = Math.sqrt(((1.0 / l) / h)) * d;
	}
	return tmp;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	tmp = 0
	if l <= -4.2e-286:
		tmp = (0.0 - d) * math.sqrt((1.0 / (l * h)))
	else:
		tmp = math.sqrt(((1.0 / l) / h)) * d
	return tmp
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	tmp = 0.0
	if (l <= -4.2e-286)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(l * h))));
	else
		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
	end
	return tmp
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp_2 = code(d, h, l, M_m, D)
	tmp = 0.0;
	if (l <= -4.2e-286)
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	else
		tmp = sqrt(((1.0 / l) / h)) * d;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -4.2e-286], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{-286}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.19999999999999977e-286

    1. Initial program 60.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. Simplified61.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 0

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(d \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. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \left(\sqrt{\frac{1}{h \cdot \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) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), d\right)\right), 4\right), \mathsf{*.f64}\left(h, \mathsf{/.f64}\left(D, d\right)\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, \ell\right)\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\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) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\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. /-lowering-/.f643.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\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. Simplified3.3%

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\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) \]
    7. Taylor expanded in M around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\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) \]
    8. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell}}{\color{blue}{{d}^{2}}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell}}{d \cdot \color{blue}{d}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell}}{d}}{\color{blue}{d}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell}}{d}\right), \color{blue}{d}\right)\right)\right) \]
    9. Simplified4.7%

      \[\leadsto \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(1 + \color{blue}{\frac{\frac{\frac{-0.125 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{\ell}}{d}}{d}}\right) \]
    10. 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}}} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6449.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    12. Simplified49.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if -4.19999999999999977e-286 < l

    1. Initial program 60.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. Simplified61.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      5. /-lowering-/.f6444.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    6. Simplified44.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.2 \cdot 10^{-286}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 26.5% accurate, 3.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (* (sqrt (/ (/ 1.0 l) h)) d))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return sqrt(((1.0 / l) / h)) * d;
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = sqrt(((1.0d0 / l) / h)) * d
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return Math.sqrt(((1.0 / l) / h)) * d;
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return math.sqrt(((1.0 / l) / h)) * d
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d)
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = sqrt(((1.0 / l) / h)) * d;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d
\end{array}
Derivation
  1. Initial program 60.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. Simplified61.5%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified26.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Final simplification26.1%

    \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
  8. Add Preprocessing

Alternative 21: 26.5% accurate, 3.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d * sqrt(((1.0 / h) / l));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d * sqrt(((1.0d0 / h) / l))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d * Math.sqrt(((1.0 / h) / l));
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d * math.sqrt(((1.0 / h) / l))
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d * sqrt(Float64(Float64(1.0 / h) / l)))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d * sqrt(((1.0 / h) / l));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Derivation
  1. Initial program 60.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. Simplified61.5%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified26.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    2. associate-/r*N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
    4. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
  8. Applied egg-rr26.1%

    \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  9. Add Preprocessing

Alternative 22: 26.3% accurate, 3.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ d \cdot \sqrt{\frac{1}{\ell \cdot h}} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (* d (sqrt (/ 1.0 (* l h)))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d * sqrt((1.0 / (l * h)));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d * sqrt((1.0d0 / (l * h)))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d * Math.sqrt((1.0 / (l * h)));
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d * math.sqrt((1.0 / (l * h)))
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d * sqrt(Float64(1.0 / Float64(l * h))))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d * sqrt((1.0 / (l * h)));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Derivation
  1. Initial program 60.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. Simplified61.5%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified26.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    2. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6425.8%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  8. Applied egg-rr25.8%

    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
  9. Final simplification25.8%

    \[\leadsto d \cdot \sqrt{\frac{1}{\ell \cdot h}} \]
  10. Add Preprocessing

Alternative 23: 26.2% accurate, 3.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ d \cdot {\left(\ell \cdot h\right)}^{-0.5} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (* d (pow (* l h) -0.5)))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d * pow((l * h), -0.5);
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d * ((l * h) ** (-0.5d0))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d * Math.pow((l * h), -0.5);
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d * math.pow((l * h), -0.5)
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d * (Float64(l * h) ^ -0.5))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d * ((l * h) ^ -0.5);
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 60.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. Simplified61.5%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified26.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}}\right), \color{blue}{d}\right) \]
    3. pow1/2N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right), d\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right), d\right) \]
    5. inv-powN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right), d\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right), d\right) \]
    7. pow-powN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
    10. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
    11. *-lowering-*.f6425.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
  8. Applied egg-rr25.4%

    \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  9. Final simplification25.4%

    \[\leadsto d \cdot {\left(\ell \cdot h\right)}^{-0.5} \]
  10. Add Preprocessing

Alternative 24: 26.2% accurate, 3.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D) :precision binary64 (/ d (sqrt (* l h))))
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D);
double code(double d, double h, double l, double M_m, double D) {
	return d / sqrt((l * h));
}
M_m = abs(m)
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_1
    code = d / sqrt((l * h))
end function
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D;
public static double code(double d, double h, double l, double M_m, double D) {
	return d / Math.sqrt((l * h));
}
M_m = math.fabs(M)
[d, h, l, M_m, D] = sort([d, h, l, M_m, D])
def code(d, h, l, M_m, D):
	return d / math.sqrt((l * h))
M_m = abs(M)
d, h, l, M_m, D = sort([d, h, l, M_m, D])
function code(d, h, l, M_m, D)
	return Float64(d / sqrt(Float64(l * h)))
end
M_m = abs(M);
d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
function tmp = code(d, h, l, M_m, D)
	tmp = d / sqrt((l * h));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Derivation
  1. Initial program 60.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. Simplified61.5%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{M \cdot \frac{M \cdot D}{d}}{4} \cdot \left(h \cdot \frac{D}{d}\right)\right) \cdot \frac{-0.5}{\ell}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
    5. /-lowering-/.f6426.1%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
  6. Simplified26.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{d} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}}\right), \color{blue}{d}\right) \]
    3. pow1/2N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{\frac{1}{\ell}}{h}\right)}^{\frac{1}{2}}\right), d\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{h \cdot \ell}\right)}^{\frac{1}{2}}\right), d\right) \]
    5. inv-powN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\frac{1}{2}}\right), d\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(h \cdot \ell\right)}^{-1}\right)}^{\left(\frac{1}{2}\right)}\right), d\right) \]
    7. pow-powN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), d\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
    10. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
    11. *-lowering-*.f6425.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
  8. Applied egg-rr25.4%

    \[\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(\frac{-1}{\color{blue}{2}}\right)} \]
    3. sqrt-pow1N/A

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{-1}} \]
    4. inv-powN/A

      \[\leadsto d \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
    5. associate-/l/N/A

      \[\leadsto d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}} \]
    6. frac-2negN/A

      \[\leadsto d \cdot \sqrt{\frac{\mathsf{neg}\left(\frac{1}{\ell}\right)}{\mathsf{neg}\left(h\right)}} \]
    7. sub0-negN/A

      \[\leadsto d \cdot \sqrt{\frac{\mathsf{neg}\left(\frac{1}{\ell}\right)}{0 - h}} \]
    8. sqrt-divN/A

      \[\leadsto d \cdot \frac{\sqrt{\mathsf{neg}\left(\frac{1}{\ell}\right)}}{\color{blue}{\sqrt{0 - h}}} \]
    9. neg-mul-1N/A

      \[\leadsto d \cdot \frac{\sqrt{-1 \cdot \frac{1}{\ell}}}{\sqrt{\color{blue}{0} - h}} \]
    10. div-invN/A

      \[\leadsto d \cdot \frac{\sqrt{\frac{-1}{\ell}}}{\sqrt{\color{blue}{0} - h}} \]
    11. clear-numN/A

      \[\leadsto d \cdot \frac{1}{\color{blue}{\frac{\sqrt{0 - h}}{\sqrt{\frac{-1}{\ell}}}}} \]
    12. un-div-invN/A

      \[\leadsto \frac{d}{\color{blue}{\frac{\sqrt{0 - h}}{\sqrt{\frac{-1}{\ell}}}}} \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\frac{\sqrt{0 - h}}{\sqrt{\frac{-1}{\ell}}}\right)}\right) \]
    14. sqrt-undivN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{0 - h}{\frac{-1}{\ell}}}\right)\right) \]
    15. sub0-negN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{\mathsf{neg}\left(h\right)}{\frac{-1}{\ell}}}\right)\right) \]
    16. div-invN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{\mathsf{neg}\left(h\right)}{-1 \cdot \frac{1}{\ell}}}\right)\right) \]
    17. neg-mul-1N/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{\mathsf{neg}\left(h\right)}{\mathsf{neg}\left(\frac{1}{\ell}\right)}}\right)\right) \]
    18. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{h}{\frac{1}{\ell}}}\right)\right) \]
    19. associate-/r/N/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\frac{h}{1} \cdot \ell}\right)\right) \]
    20. /-rgt-identityN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{h \cdot \ell}\right)\right) \]
    21. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
  10. Applied egg-rr25.4%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  11. Final simplification25.4%

    \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024161 
(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)))))