Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.5% → 80.2%
Time: 23.9s
Alternatives: 14
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 80.2% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1799999999999999e182 < l < -9.99999999999948e-312

    1. Initial program 70.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. Simplified70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999948e-312 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.2% accurate, 1.0× speedup?

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999948e-312 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.9% accurate, 1.0× speedup?

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.1% accurate, 1.0× speedup?

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999948e-312 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 58.7% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt60.1%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-160.1%

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

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

    if -6.2000000000000002e75 < l < 6.99999999999999989e-6

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999989e-6 < l

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 69.4% accurate, 1.4× speedup?

\[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \left(0.5 \cdot M\right) \cdot \frac{D}{d}\\ \left(1 - 0.5 \cdot \left(h \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \end{array} \end{array} \]
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* 0.5 M) (/ D d))))
   (*
    (- 1.0 (* 0.5 (* h (* t_0 (/ t_0 l)))))
    (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d)))))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = (0.5 * M) * (D / d);
	return (1.0 - (0.5 * (h * (t_0 * (t_0 / l))))) * (sqrt((d / l)) * (1.0 / sqrt((h / d))));
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    t_0 = (0.5d0 * m) * (d_1 / d)
    code = (1.0d0 - (0.5d0 * (h * (t_0 * (t_0 / l))))) * (sqrt((d / l)) * (1.0d0 / sqrt((h / d))))
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (0.5 * M) * (D / d);
	return (1.0 - (0.5 * (h * (t_0 * (t_0 / l))))) * (Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d))));
}
[d, h, l, M, D] = sort([d, h, l, M, D])
def code(d, h, l, M, D):
	t_0 = (0.5 * M) * (D / d)
	return (1.0 - (0.5 * (h * (t_0 * (t_0 / l))))) * (math.sqrt((d / l)) * (1.0 / math.sqrt((h / d))))
d, h, l, M, D = sort([d, h, l, M, D])
function code(d, h, l, M, D)
	t_0 = Float64(Float64(0.5 * M) * Float64(D / d))
	return Float64(Float64(1.0 - Float64(0.5 * Float64(h * Float64(t_0 * Float64(t_0 / l))))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d)))))
end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp = code(d, h, l, M, D)
	t_0 = (0.5 * M) * (D / d);
	tmp = (1.0 - (0.5 * (h * (t_0 * (t_0 / l))))) * (sqrt((d / l)) * (1.0 / sqrt((h / d))));
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 - N[(0.5 * N[(h * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := \left(0.5 \cdot M\right) \cdot \frac{D}{d}\\
\left(1 - 0.5 \cdot \left(h \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 68.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. Simplified67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(1 - 0.5 \cdot \left(h \cdot \left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{\left(0.5 \cdot M\right) \cdot \frac{D}{d}}{\ell}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \]
  13. Add Preprocessing

Alternative 7: 69.1% accurate, 1.4× speedup?

\[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{D \cdot \left(M \cdot \frac{0.5}{d}\right)}{\ell}\right)\right)\right) \end{array} \]
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (sqrt (/ d h)) (sqrt (/ d l)))
  (- 1.0 (* 0.5 (* h (* (* (* 0.5 M) (/ D d)) (/ (* D (* M (/ 0.5 d))) l)))))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
	return (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * (h * (((0.5 * M) * (D / d)) * ((D * (M * (0.5 / d))) / l)))));
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (sqrt((d / h)) * sqrt((d / l))) * (1.0d0 - (0.5d0 * (h * (((0.5d0 * m) * (d_1 / d)) * ((d_1 * (m * (0.5d0 / d))) / l)))))
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
	return (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.5 * (h * (((0.5 * M) * (D / d)) * ((D * (M * (0.5 / d))) / l)))));
}
[d, h, l, M, D] = sort([d, h, l, M, D])
def code(d, h, l, M, D):
	return (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.5 * (h * (((0.5 * M) * (D / d)) * ((D * (M * (0.5 / d))) / l)))))
d, h, l, M, D = sort([d, h, l, M, D])
function code(d, h, l, M, D)
	return Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(h * Float64(Float64(Float64(0.5 * M) * Float64(D / d)) * Float64(Float64(D * Float64(M * Float64(0.5 / d))) / l))))))
end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp = code(d, h, l, M, D)
	tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.5 * (h * (((0.5 * M) * (D / d)) * ((D * (M * (0.5 / d))) / l)))));
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(h * N[(N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{D \cdot \left(M \cdot \frac{0.5}{d}\right)}{\ell}\right)\right)\right)
\end{array}
Derivation
  1. Initial program 68.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. Simplified67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{D \cdot \left(M \cdot \frac{0.5}{d}\right)}{\ell}\right)\right)\right) \]
  14. Add Preprocessing

Alternative 8: 46.5% accurate, 1.6× speedup?

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt49.7%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-149.7%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left(-d\right)} \]
    8. Simplified49.7%

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

    if 2.8499999999999999e-257 < d

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
      2. sqrt-div58.9%

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

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

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

Alternative 9: 46.5% accurate, 1.6× speedup?

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt49.7%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-149.7%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left(-d\right)} \]
    8. Simplified49.7%

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

    if 1.9500000000000001e-257 < d

    1. Initial program 72.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around 0 47.0%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. unpow-147.0%

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr47.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square47.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt47.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr47.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt47.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Simplified47.0%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt47.0%

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

        \[\leadsto d \cdot \color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      3. pow-prod-up47.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(-0.5 + -0.5\right)}}} \]
      4. metadata-eval47.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{-1}}} \]
      5. inv-pow47.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      6. associate-/l/48.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
      7. sqrt-div58.9%

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

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{\ell}^{-1}}}}{\sqrt{h}} \]
      9. sqrt-pow158.9%

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

        \[\leadsto d \cdot \frac{{\ell}^{\color{blue}{-0.5}}}{\sqrt{h}} \]
    13. Applied egg-rr58.9%

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

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

Alternative 10: 42.6% accurate, 2.9× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      6. rem-square-sqrt51.5%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      7. neg-mul-151.5%

        \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \color{blue}{\left(-d\right)} \]
    8. Simplified51.5%

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

    if -5.89999999999999953e-274 < l

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

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

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

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

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

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

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

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

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

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

Alternative 11: 42.5% accurate, 3.0× speedup?

\[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{if}\;\ell \leq -4.3 \cdot 10^{-271}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot t\_0\\ \end{array} \end{array} \]
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (pow (* l h) -0.5)))
   (if (<= l -4.3e-271) (* (- d) t_0) (* d t_0))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
	double t_0 = pow((l * h), -0.5);
	double tmp;
	if (l <= -4.3e-271) {
		tmp = -d * t_0;
	} else {
		tmp = d * t_0;
	}
	return tmp;
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (l * h) ** (-0.5d0)
    if (l <= (-4.3d-271)) then
        tmp = -d * t_0
    else
        tmp = d * t_0
    end if
    code = tmp
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.pow((l * h), -0.5);
	double tmp;
	if (l <= -4.3e-271) {
		tmp = -d * t_0;
	} else {
		tmp = d * t_0;
	}
	return tmp;
}
[d, h, l, M, D] = sort([d, h, l, M, D])
def code(d, h, l, M, D):
	t_0 = math.pow((l * h), -0.5)
	tmp = 0
	if l <= -4.3e-271:
		tmp = -d * t_0
	else:
		tmp = d * t_0
	return tmp
d, h, l, M, D = sort([d, h, l, M, D])
function code(d, h, l, M, D)
	t_0 = Float64(l * h) ^ -0.5
	tmp = 0.0
	if (l <= -4.3e-271)
		tmp = Float64(Float64(-d) * t_0);
	else
		tmp = Float64(d * t_0);
	end
	return tmp
end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp_2 = code(d, h, l, M, D)
	t_0 = (l * h) ^ -0.5;
	tmp = 0.0;
	if (l <= -4.3e-271)
		tmp = -d * t_0;
	else
		tmp = d * t_0;
	end
	tmp_2 = tmp;
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[l, -4.3e-271], N[((-d) * t$95$0), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
t_0 := {\left(\ell \cdot h\right)}^{-0.5}\\
\mathbf{if}\;\ell \leq -4.3 \cdot 10^{-271}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\

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


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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around -inf 0.0%

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

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

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

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. unpow-151.2%

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

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

        \[\leadsto d \cdot \left(-1 \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      7. rem-sqrt-square51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      8. rem-square-sqrt51.1%

        \[\leadsto d \cdot \left(-1 \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      9. fabs-sqr51.1%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)}\right) \]
      10. rem-square-sqrt51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
      11. mul-1-neg51.2%

        \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]
    11. Simplified51.2%

      \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if -4.3e-271 < l

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around 0 46.4%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. unpow-146.4%

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr46.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square46.4%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt46.4%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr46.4%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt46.4%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Simplified46.4%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.3 \cdot 10^{-271}:\\ \;\;\;\;\left(-d\right) \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 42.5% accurate, 3.0× speedup?

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

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


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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around -inf 0.0%

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

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

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

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. unpow-151.2%

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

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

        \[\leadsto d \cdot \left(-1 \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      7. rem-sqrt-square51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      8. rem-square-sqrt51.1%

        \[\leadsto d \cdot \left(-1 \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      9. fabs-sqr51.1%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)}\right) \]
      10. rem-square-sqrt51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
      11. mul-1-neg51.2%

        \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]
    11. Simplified51.2%

      \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if -7.70000000000000023e-265 < l

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around 0 46.4%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. unpow-146.4%

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

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr46.4%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square46.4%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt46.4%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr46.4%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt46.4%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Simplified46.4%

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

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    13. Step-by-step derivation
      1. associate-/r*47.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    14. Simplified47.3%

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

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

Alternative 13: 42.5% accurate, 3.0× speedup?

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

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


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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    9. Taylor expanded in l around -inf 0.0%

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

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

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

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      4. unpow-151.2%

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

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

        \[\leadsto d \cdot \left(-1 \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}}\right) \]
      7. rem-sqrt-square51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|}\right) \]
      8. rem-square-sqrt51.1%

        \[\leadsto d \cdot \left(-1 \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right|\right) \]
      9. fabs-sqr51.1%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)}\right) \]
      10. rem-square-sqrt51.2%

        \[\leadsto d \cdot \left(-1 \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}}\right) \]
      11. mul-1-neg51.2%

        \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]
    11. Simplified51.2%

      \[\leadsto d \cdot \color{blue}{\left(-{\left(h \cdot \ell\right)}^{-0.5}\right)} \]

    if -2.30000000000000005e-267 < l

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

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

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

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

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

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

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

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

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

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

Alternative 14: 26.2% accurate, 3.1× speedup?

\[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ d \cdot {\left(\ell \cdot h\right)}^{-0.5} \end{array} \]
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
	return d * pow((l * h), -0.5);
}
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d * ((l * h) ** (-0.5d0))
end function
assert d < h && h < l && l < M && M < D;
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.pow((l * h), -0.5);
}
[d, h, l, M, D] = sort([d, h, l, M, D])
def code(d, h, l, M, D):
	return d * math.pow((l * h), -0.5)
d, h, l, M, D = sort([d, h, l, M, D])
function code(d, h, l, M, D)
	return Float64(d * (Float64(l * h) ^ -0.5))
end
d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
function tmp = code(d, h, l, M, D)
	tmp = d * ((l * h) ^ -0.5);
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 68.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. Simplified67.3%

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

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

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

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

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

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

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
  9. Taylor expanded in l around 0 28.2%

    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
  10. Step-by-step derivation
    1. unpow-128.2%

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

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr28.2%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square28.2%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. rem-square-sqrt28.2%

      \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
    6. fabs-sqr28.2%

      \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
    7. rem-square-sqrt28.2%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  11. Simplified28.2%

    \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  12. Final simplification28.2%

    \[\leadsto d \cdot {\left(\ell \cdot h\right)}^{-0.5} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024084 
(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)))))