Henrywood and Agarwal, Equation (12)

Percentage Accurate: 67.1% → 83.0%
Time: 24.5s
Alternatives: 22
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 67.1% 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: 83.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\ t_1 := {\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_0\\ t_2 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_3 := \sqrt{0 - d}\\ \mathbf{if}\;h \leq -5.2 \cdot 10^{+125}:\\ \;\;\;\;\frac{t\_3}{{\left(0 - h\right)}^{0.5}} \cdot t\_1\\ \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\ \;\;\;\;t\_2 \cdot \left(t\_0 \cdot \frac{t\_3}{{\left(0 - \ell\right)}^{0.5}}\right)\\ \mathbf{elif}\;h \leq 7.2 \cdot 10^{+123}:\\ \;\;\;\;t\_2 \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+ 1.0 (* (/ h (/ d (/ (* M D) 2.0))) (/ (* -0.25 (/ (* M D) d)) l))))
        (t_1 (* (pow (/ d l) 0.5) t_0))
        (t_2 (pow (/ d h) 0.5))
        (t_3 (sqrt (- 0.0 d))))
   (if (<= h -5.2e+125)
     (* (/ t_3 (pow (- 0.0 h) 0.5)) t_1)
     (if (<= h -4e-310)
       (* t_2 (* t_0 (/ t_3 (pow (- 0.0 l) 0.5))))
       (if (<= h 7.2e+123)
         (* t_2 (* t_0 (/ (sqrt d) (sqrt l))))
         (* t_1 (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double t_1 = pow((d / l), 0.5) * t_0;
	double t_2 = pow((d / h), 0.5);
	double t_3 = sqrt((0.0 - d));
	double tmp;
	if (h <= -5.2e+125) {
		tmp = (t_3 / pow((0.0 - h), 0.5)) * t_1;
	} else if (h <= -4e-310) {
		tmp = t_2 * (t_0 * (t_3 / pow((0.0 - l), 0.5)));
	} else if (h <= 7.2e+123) {
		tmp = t_2 * (t_0 * (sqrt(d) / sqrt(l)));
	} else {
		tmp = t_1 * (sqrt(d) / sqrt(h));
	}
	return tmp;
}
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 = 1.0d0 + ((h / (d / ((m * d_1) / 2.0d0))) * (((-0.25d0) * ((m * d_1) / d)) / l))
    t_1 = ((d / l) ** 0.5d0) * t_0
    t_2 = (d / h) ** 0.5d0
    t_3 = sqrt((0.0d0 - d))
    if (h <= (-5.2d+125)) then
        tmp = (t_3 / ((0.0d0 - h) ** 0.5d0)) * t_1
    else if (h <= (-4d-310)) then
        tmp = t_2 * (t_0 * (t_3 / ((0.0d0 - l) ** 0.5d0)))
    else if (h <= 7.2d+123) then
        tmp = t_2 * (t_0 * (sqrt(d) / sqrt(l)))
    else
        tmp = t_1 * (sqrt(d) / sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double t_1 = Math.pow((d / l), 0.5) * t_0;
	double t_2 = Math.pow((d / h), 0.5);
	double t_3 = Math.sqrt((0.0 - d));
	double tmp;
	if (h <= -5.2e+125) {
		tmp = (t_3 / Math.pow((0.0 - h), 0.5)) * t_1;
	} else if (h <= -4e-310) {
		tmp = t_2 * (t_0 * (t_3 / Math.pow((0.0 - l), 0.5)));
	} else if (h <= 7.2e+123) {
		tmp = t_2 * (t_0 * (Math.sqrt(d) / Math.sqrt(l)));
	} else {
		tmp = t_1 * (Math.sqrt(d) / Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))
	t_1 = math.pow((d / l), 0.5) * t_0
	t_2 = math.pow((d / h), 0.5)
	t_3 = math.sqrt((0.0 - d))
	tmp = 0
	if h <= -5.2e+125:
		tmp = (t_3 / math.pow((0.0 - h), 0.5)) * t_1
	elif h <= -4e-310:
		tmp = t_2 * (t_0 * (t_3 / math.pow((0.0 - l), 0.5)))
	elif h <= 7.2e+123:
		tmp = t_2 * (t_0 * (math.sqrt(d) / math.sqrt(l)))
	else:
		tmp = t_1 * (math.sqrt(d) / math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(h / Float64(d / Float64(Float64(M * D) / 2.0))) * Float64(Float64(-0.25 * Float64(Float64(M * D) / d)) / l)))
	t_1 = Float64((Float64(d / l) ^ 0.5) * t_0)
	t_2 = Float64(d / h) ^ 0.5
	t_3 = sqrt(Float64(0.0 - d))
	tmp = 0.0
	if (h <= -5.2e+125)
		tmp = Float64(Float64(t_3 / (Float64(0.0 - h) ^ 0.5)) * t_1);
	elseif (h <= -4e-310)
		tmp = Float64(t_2 * Float64(t_0 * Float64(t_3 / (Float64(0.0 - l) ^ 0.5))));
	elseif (h <= 7.2e+123)
		tmp = Float64(t_2 * Float64(t_0 * Float64(sqrt(d) / sqrt(l))));
	else
		tmp = Float64(t_1 * Float64(sqrt(d) / sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	t_1 = ((d / l) ^ 0.5) * t_0;
	t_2 = (d / h) ^ 0.5;
	t_3 = sqrt((0.0 - d));
	tmp = 0.0;
	if (h <= -5.2e+125)
		tmp = (t_3 / ((0.0 - h) ^ 0.5)) * t_1;
	elseif (h <= -4e-310)
		tmp = t_2 * (t_0 * (t_3 / ((0.0 - l) ^ 0.5)));
	elseif (h <= 7.2e+123)
		tmp = t_2 * (t_0 * (sqrt(d) / sqrt(l)));
	else
		tmp = t_1 * (sqrt(d) / sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / N[(d / N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -5.2e+125], N[(N[(t$95$3 / N[Power[N[(0.0 - h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, -4e-310], N[(t$95$2 * N[(t$95$0 * N[(t$95$3 / N[Power[N[(0.0 - l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7.2e+123], N[(t$95$2 * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\
t_1 := {\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_0\\
t_2 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_3 := \sqrt{0 - d}\\
\mathbf{if}\;h \leq -5.2 \cdot 10^{+125}:\\
\;\;\;\;\frac{t\_3}{{\left(0 - h\right)}^{0.5}} \cdot t\_1\\

\mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;t\_2 \cdot \left(t\_0 \cdot \frac{t\_3}{{\left(0 - \ell\right)}^{0.5}}\right)\\

\mathbf{elif}\;h \leq 7.2 \cdot 10^{+123}:\\
\;\;\;\;t\_2 \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\

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


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

    1. Initial program 60.4%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000006e125 < h < -3.999999999999988e-310

    1. Initial program 70.8%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < h < 7.19999999999999996e123

    1. Initial program 67.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999996e123 < h

    1. Initial program 56.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 82.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\ t_1 := {\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_0\\ \mathbf{if}\;h \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{0 - d}}{{\left(0 - h\right)}^{0.5}} \cdot t\_1\\ \mathbf{elif}\;h \leq 1.4 \cdot 10^{+117}:\\ \;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+ 1.0 (* (/ h (/ d (/ (* M D) 2.0))) (/ (* -0.25 (/ (* M D) d)) l))))
        (t_1 (* (pow (/ d l) 0.5) t_0)))
   (if (<= h -4e-310)
     (* (/ (sqrt (- 0.0 d)) (pow (- 0.0 h) 0.5)) t_1)
     (if (<= h 1.4e+117)
       (* (pow (/ d h) 0.5) (* t_0 (/ (sqrt d) (sqrt l))))
       (* t_1 (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double t_1 = pow((d / l), 0.5) * t_0;
	double tmp;
	if (h <= -4e-310) {
		tmp = (sqrt((0.0 - d)) / pow((0.0 - h), 0.5)) * t_1;
	} else if (h <= 1.4e+117) {
		tmp = pow((d / h), 0.5) * (t_0 * (sqrt(d) / sqrt(l)));
	} else {
		tmp = t_1 * (sqrt(d) / sqrt(h));
	}
	return tmp;
}
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 = 1.0d0 + ((h / (d / ((m * d_1) / 2.0d0))) * (((-0.25d0) * ((m * d_1) / d)) / l))
    t_1 = ((d / l) ** 0.5d0) * t_0
    if (h <= (-4d-310)) then
        tmp = (sqrt((0.0d0 - d)) / ((0.0d0 - h) ** 0.5d0)) * t_1
    else if (h <= 1.4d+117) then
        tmp = ((d / h) ** 0.5d0) * (t_0 * (sqrt(d) / sqrt(l)))
    else
        tmp = t_1 * (sqrt(d) / sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double t_1 = Math.pow((d / l), 0.5) * t_0;
	double tmp;
	if (h <= -4e-310) {
		tmp = (Math.sqrt((0.0 - d)) / Math.pow((0.0 - h), 0.5)) * t_1;
	} else if (h <= 1.4e+117) {
		tmp = Math.pow((d / h), 0.5) * (t_0 * (Math.sqrt(d) / Math.sqrt(l)));
	} else {
		tmp = t_1 * (Math.sqrt(d) / Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))
	t_1 = math.pow((d / l), 0.5) * t_0
	tmp = 0
	if h <= -4e-310:
		tmp = (math.sqrt((0.0 - d)) / math.pow((0.0 - h), 0.5)) * t_1
	elif h <= 1.4e+117:
		tmp = math.pow((d / h), 0.5) * (t_0 * (math.sqrt(d) / math.sqrt(l)))
	else:
		tmp = t_1 * (math.sqrt(d) / math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(h / Float64(d / Float64(Float64(M * D) / 2.0))) * Float64(Float64(-0.25 * Float64(Float64(M * D) / d)) / l)))
	t_1 = Float64((Float64(d / l) ^ 0.5) * t_0)
	tmp = 0.0
	if (h <= -4e-310)
		tmp = Float64(Float64(sqrt(Float64(0.0 - d)) / (Float64(0.0 - h) ^ 0.5)) * t_1);
	elseif (h <= 1.4e+117)
		tmp = Float64((Float64(d / h) ^ 0.5) * Float64(t_0 * Float64(sqrt(d) / sqrt(l))));
	else
		tmp = Float64(t_1 * Float64(sqrt(d) / sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	t_1 = ((d / l) ^ 0.5) * t_0;
	tmp = 0.0;
	if (h <= -4e-310)
		tmp = (sqrt((0.0 - d)) / ((0.0 - h) ^ 0.5)) * t_1;
	elseif (h <= 1.4e+117)
		tmp = ((d / h) ^ 0.5) * (t_0 * (sqrt(d) / sqrt(l)));
	else
		tmp = t_1 * (sqrt(d) / sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / N[(d / N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[h, -4e-310], N[(N[(N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision] / N[Power[N[(0.0 - h), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, 1.4e+117], N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\
t_1 := {\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_0\\
\mathbf{if}\;h \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{0 - d}}{{\left(0 - h\right)}^{0.5}} \cdot t\_1\\

\mathbf{elif}\;h \leq 1.4 \cdot 10^{+117}:\\
\;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\

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


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

    1. Initial program 68.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < h < 1.39999999999999999e117

    1. Initial program 67.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.39999999999999999e117 < h

    1. Initial program 56.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\ \mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+120}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_1\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (pow (/ d h) 0.5))
        (t_1
         (+
          1.0
          (* (/ h (/ d (/ (* M D) 2.0))) (/ (* -0.25 (/ (* M D) d)) l)))))
   (if (<= h -1e-309)
     (* t_0 (* t_1 (sqrt (/ d l))))
     (if (<= h 2.8e+120)
       (* t_0 (* t_1 (/ (sqrt d) (sqrt l))))
       (* (* (pow (/ d l) 0.5) t_1) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = pow((d / h), 0.5);
	double t_1 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double tmp;
	if (h <= -1e-309) {
		tmp = t_0 * (t_1 * sqrt((d / l)));
	} else if (h <= 2.8e+120) {
		tmp = t_0 * (t_1 * (sqrt(d) / sqrt(l)));
	} else {
		tmp = (pow((d / l), 0.5) * t_1) * (sqrt(d) / sqrt(h));
	}
	return tmp;
}
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 = (d / h) ** 0.5d0
    t_1 = 1.0d0 + ((h / (d / ((m * d_1) / 2.0d0))) * (((-0.25d0) * ((m * d_1) / d)) / l))
    if (h <= (-1d-309)) then
        tmp = t_0 * (t_1 * sqrt((d / l)))
    else if (h <= 2.8d+120) then
        tmp = t_0 * (t_1 * (sqrt(d) / sqrt(l)))
    else
        tmp = (((d / l) ** 0.5d0) * t_1) * (sqrt(d) / sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.pow((d / h), 0.5);
	double t_1 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double tmp;
	if (h <= -1e-309) {
		tmp = t_0 * (t_1 * Math.sqrt((d / l)));
	} else if (h <= 2.8e+120) {
		tmp = t_0 * (t_1 * (Math.sqrt(d) / Math.sqrt(l)));
	} else {
		tmp = (Math.pow((d / l), 0.5) * t_1) * (Math.sqrt(d) / Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.pow((d / h), 0.5)
	t_1 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))
	tmp = 0
	if h <= -1e-309:
		tmp = t_0 * (t_1 * math.sqrt((d / l)))
	elif h <= 2.8e+120:
		tmp = t_0 * (t_1 * (math.sqrt(d) / math.sqrt(l)))
	else:
		tmp = (math.pow((d / l), 0.5) * t_1) * (math.sqrt(d) / math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(d / h) ^ 0.5
	t_1 = Float64(1.0 + Float64(Float64(h / Float64(d / Float64(Float64(M * D) / 2.0))) * Float64(Float64(-0.25 * Float64(Float64(M * D) / d)) / l)))
	tmp = 0.0
	if (h <= -1e-309)
		tmp = Float64(t_0 * Float64(t_1 * sqrt(Float64(d / l))));
	elseif (h <= 2.8e+120)
		tmp = Float64(t_0 * Float64(t_1 * Float64(sqrt(d) / sqrt(l))));
	else
		tmp = Float64(Float64((Float64(d / l) ^ 0.5) * t_1) * Float64(sqrt(d) / sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (d / h) ^ 0.5;
	t_1 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	tmp = 0.0;
	if (h <= -1e-309)
		tmp = t_0 * (t_1 * sqrt((d / l)));
	elseif (h <= 2.8e+120)
		tmp = t_0 * (t_1 * (sqrt(d) / sqrt(l)));
	else
		tmp = (((d / l) ^ 0.5) * t_1) * (sqrt(d) / sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(h / N[(d / N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-309], N[(t$95$0 * N[(t$95$1 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.8e+120], N[(t$95$0 * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_1 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right)\\

\mathbf{elif}\;h \leq 2.8 \cdot 10^{+120}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\

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


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

    1. Initial program 68.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < h < 2.8000000000000001e120

    1. Initial program 67.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8000000000000001e120 < h

    1. Initial program 56.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\ \mathbf{if}\;d \leq -7.2 \cdot 10^{-281}:\\ \;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;d \leq 5.2 \cdot 10^{-307}:\\ \;\;\;\;h \cdot \left(\frac{d}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}} + {\left(h \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)}^{-0.5} \cdot \left(-0.125 \cdot \frac{D}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot t\_0\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+
          1.0
          (* (/ h (/ d (/ (* M D) 2.0))) (/ (* -0.25 (/ (* M D) d)) l)))))
   (if (<= d -7.2e-281)
     (* (pow (/ d h) 0.5) (* t_0 (sqrt (/ d l))))
     (if (<= d 5.2e-307)
       (*
        h
        (+
         (/ d (sqrt (* h (* l (* h h)))))
         (*
          (pow (* h (* l (* l l))) -0.5)
          (* -0.125 (/ D (/ d (* M (* M D))))))))
       (* (* (pow (/ d l) 0.5) t_0) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double tmp;
	if (d <= -7.2e-281) {
		tmp = pow((d / h), 0.5) * (t_0 * sqrt((d / l)));
	} else if (d <= 5.2e-307) {
		tmp = h * ((d / sqrt((h * (l * (h * h))))) + (pow((h * (l * (l * l))), -0.5) * (-0.125 * (D / (d / (M * (M * D)))))));
	} else {
		tmp = (pow((d / l), 0.5) * t_0) * (sqrt(d) / sqrt(h));
	}
	return tmp;
}
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 = 1.0d0 + ((h / (d / ((m * d_1) / 2.0d0))) * (((-0.25d0) * ((m * d_1) / d)) / l))
    if (d <= (-7.2d-281)) then
        tmp = ((d / h) ** 0.5d0) * (t_0 * sqrt((d / l)))
    else if (d <= 5.2d-307) then
        tmp = h * ((d / sqrt((h * (l * (h * h))))) + (((h * (l * (l * l))) ** (-0.5d0)) * ((-0.125d0) * (d_1 / (d / (m * (m * d_1)))))))
    else
        tmp = (((d / l) ** 0.5d0) * t_0) * (sqrt(d) / sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	double tmp;
	if (d <= -7.2e-281) {
		tmp = Math.pow((d / h), 0.5) * (t_0 * Math.sqrt((d / l)));
	} else if (d <= 5.2e-307) {
		tmp = h * ((d / Math.sqrt((h * (l * (h * h))))) + (Math.pow((h * (l * (l * l))), -0.5) * (-0.125 * (D / (d / (M * (M * D)))))));
	} else {
		tmp = (Math.pow((d / l), 0.5) * t_0) * (Math.sqrt(d) / Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))
	tmp = 0
	if d <= -7.2e-281:
		tmp = math.pow((d / h), 0.5) * (t_0 * math.sqrt((d / l)))
	elif d <= 5.2e-307:
		tmp = h * ((d / math.sqrt((h * (l * (h * h))))) + (math.pow((h * (l * (l * l))), -0.5) * (-0.125 * (D / (d / (M * (M * D)))))))
	else:
		tmp = (math.pow((d / l), 0.5) * t_0) * (math.sqrt(d) / math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(h / Float64(d / Float64(Float64(M * D) / 2.0))) * Float64(Float64(-0.25 * Float64(Float64(M * D) / d)) / l)))
	tmp = 0.0
	if (d <= -7.2e-281)
		tmp = Float64((Float64(d / h) ^ 0.5) * Float64(t_0 * sqrt(Float64(d / l))));
	elseif (d <= 5.2e-307)
		tmp = Float64(h * Float64(Float64(d / sqrt(Float64(h * Float64(l * Float64(h * h))))) + Float64((Float64(h * Float64(l * Float64(l * l))) ^ -0.5) * Float64(-0.125 * Float64(D / Float64(d / Float64(M * Float64(M * D))))))));
	else
		tmp = Float64(Float64((Float64(d / l) ^ 0.5) * t_0) * Float64(sqrt(d) / sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = 1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l));
	tmp = 0.0;
	if (d <= -7.2e-281)
		tmp = ((d / h) ^ 0.5) * (t_0 * sqrt((d / l)));
	elseif (d <= 5.2e-307)
		tmp = h * ((d / sqrt((h * (l * (h * h))))) + (((h * (l * (l * l))) ^ -0.5) * (-0.125 * (D / (d / (M * (M * D)))))));
	else
		tmp = (((d / l) ^ 0.5) * t_0) * (sqrt(d) / sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / N[(d / N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -7.2e-281], N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.2e-307], N[(h * N[(N[(d / N[Sqrt[N[(h * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(h * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(-0.125 * N[(D / N[(d / N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\\
\mathbf{if}\;d \leq -7.2 \cdot 10^{-281}:\\
\;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000013e-281 < d < 5.19999999999999992e-307

    1. Initial program 36.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in h around inf

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

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

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

    if 5.19999999999999992e-307 < d

    1. Initial program 63.4%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 1.42 \cdot 10^{-161}:\\ \;\;\;\;\left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;\ell \leq 2.05 \cdot 10^{+67}:\\ \;\;\;\;\frac{\sqrt{h \cdot \ell} \cdot \left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right) + \sqrt{\frac{\ell}{h}} \cdot \left(d \cdot \ell\right)}{\ell \cdot \ell}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 1.42e-161)
   (*
    (+ 1.0 (/ (/ (* h (* M D)) (* d 2.0)) (/ l (/ -0.25 (/ d (* M D))))))
    (sqrt (* (/ d l) (/ d h))))
   (if (<= l 2.05e+67)
     (/
      (+
       (* (sqrt (* h l)) (* (* -0.125 (* D D)) (/ (* M M) d)))
       (* (sqrt (/ l h)) (* d l)))
      (* l l))
     (/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 1.42e-161) {
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
	} else if (l <= 2.05e+67) {
		tmp = ((sqrt((h * l)) * ((-0.125 * (D * D)) * ((M * M) / d))) + (sqrt((l / h)) * (d * l))) / (l * l);
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
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 <= 1.42d-161) then
        tmp = (1.0d0 + (((h * (m * d_1)) / (d * 2.0d0)) / (l / ((-0.25d0) / (d / (m * d_1)))))) * sqrt(((d / l) * (d / h)))
    else if (l <= 2.05d+67) then
        tmp = ((sqrt((h * l)) * (((-0.125d0) * (d_1 * d_1)) * ((m * m) / d))) + (sqrt((l / h)) * (d * l))) / (l * l)
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 1.42e-161) {
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * Math.sqrt(((d / l) * (d / h)));
	} else if (l <= 2.05e+67) {
		tmp = ((Math.sqrt((h * l)) * ((-0.125 * (D * D)) * ((M * M) / d))) + (Math.sqrt((l / h)) * (d * l))) / (l * l);
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= 1.42e-161:
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * math.sqrt(((d / l) * (d / h)))
	elif l <= 2.05e+67:
		tmp = ((math.sqrt((h * l)) * ((-0.125 * (D * D)) * ((M * M) / d))) + (math.sqrt((l / h)) * (d * l))) / (l * l)
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 1.42e-161)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)) / Float64(l / Float64(-0.25 / Float64(d / Float64(M * D)))))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	elseif (l <= 2.05e+67)
		tmp = Float64(Float64(Float64(sqrt(Float64(h * l)) * Float64(Float64(-0.125 * Float64(D * D)) * Float64(Float64(M * M) / d))) + Float64(sqrt(Float64(l / h)) * Float64(d * l))) / Float64(l * l));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 1.42e-161)
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
	elseif (l <= 2.05e+67)
		tmp = ((sqrt((h * l)) * ((-0.125 * (D * D)) * ((M * M) / d))) + (sqrt((l / h)) * (d * l))) / (l * l);
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.42e-161], N[(N[(1.0 + N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(l / N[(-0.25 / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.05e+67], N[(N[(N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.42 \cdot 10^{-161}:\\
\;\;\;\;\left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.42000000000000004e-161 < l < 2.0499999999999999e67

    1. Initial program 70.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

    if 2.0499999999999999e67 < l

    1. Initial program 53.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

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

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

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

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

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

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

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. un-div-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      6. *-lowering-*.f6443.3%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    7. Applied egg-rr43.3%

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

        \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right) \]
      2. sqrt-prodN/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(h\right)\right)\right) \]
    9. Applied egg-rr60.2%

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

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

Alternative 6: 69.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 2.9 \cdot 10^{+107}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left({\left(\frac{h}{d}\right)}^{-0.5} \cdot \left(1 + \frac{\frac{\frac{h}{d} \cdot \frac{M \cdot D}{-2}}{\frac{d}{M \cdot D} \cdot 4}}{\ell}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 2.9e+107)
   (*
    (sqrt (/ d l))
    (*
     (pow (/ h d) -0.5)
     (+ 1.0 (/ (/ (* (/ h d) (/ (* M D) -2.0)) (* (/ d (* M D)) 4.0)) l))))
   (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.9e+107) {
		tmp = sqrt((d / l)) * (pow((h / d), -0.5) * (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
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.9d+107) then
        tmp = sqrt((d / l)) * (((h / d) ** (-0.5d0)) * (1.0d0 + ((((h / d) * ((m * d_1) / (-2.0d0))) / ((d / (m * d_1)) * 4.0d0)) / l)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 2.9e+107) {
		tmp = Math.sqrt((d / l)) * (Math.pow((h / d), -0.5) * (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= 2.9e+107:
		tmp = math.sqrt((d / l)) * (math.pow((h / d), -0.5) * (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 2.9e+107)
		tmp = Float64(sqrt(Float64(d / l)) * Float64((Float64(h / d) ^ -0.5) * Float64(1.0 + Float64(Float64(Float64(Float64(h / d) * Float64(Float64(M * D) / -2.0)) / Float64(Float64(d / Float64(M * D)) * 4.0)) / l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 2.9e+107)
		tmp = sqrt((d / l)) * (((h / d) ^ -0.5) * (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.9e+107], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(h / d), $MachinePrecision], -0.5], $MachinePrecision] * N[(1.0 + N[(N[(N[(N[(h / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.9 \cdot 10^{+107}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left({\left(\frac{h}{d}\right)}^{-0.5} \cdot \left(1 + \frac{\frac{\frac{h}{d} \cdot \frac{M \cdot D}{-2}}{\frac{d}{M \cdot D} \cdot 4}}{\ell}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.89999999999999988e107

    1. Initial program 69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999988e107 < l

    1. Initial program 49.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

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

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

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

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

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

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

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    7. Applied egg-rr44.5%

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

        \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right) \]
      2. sqrt-prodN/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(h\right)\right)\right) \]
    9. Applied egg-rr61.6%

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

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

Alternative 7: 71.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{M \cdot D}\\ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{\frac{\frac{h}{\frac{\ell}{\frac{-0.25}{t\_0}}}}{t\_0}}{2}\right)\right) \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ d (* M D))))
   (*
    (pow (/ d h) 0.5)
    (* (pow (/ d l) 0.5) (+ 1.0 (/ (/ (/ h (/ l (/ -0.25 t_0))) t_0) 2.0))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = d / (M * D);
	return pow((d / h), 0.5) * (pow((d / l), 0.5) * (1.0 + (((h / (l / (-0.25 / t_0))) / t_0) / 2.0)));
}
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 = d / (m * d_1)
    code = ((d / h) ** 0.5d0) * (((d / l) ** 0.5d0) * (1.0d0 + (((h / (l / ((-0.25d0) / t_0))) / t_0) / 2.0d0)))
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = d / (M * D);
	return Math.pow((d / h), 0.5) * (Math.pow((d / l), 0.5) * (1.0 + (((h / (l / (-0.25 / t_0))) / t_0) / 2.0)));
}
def code(d, h, l, M, D):
	t_0 = d / (M * D)
	return math.pow((d / h), 0.5) * (math.pow((d / l), 0.5) * (1.0 + (((h / (l / (-0.25 / t_0))) / t_0) / 2.0)))
function code(d, h, l, M, D)
	t_0 = Float64(d / Float64(M * D))
	return Float64((Float64(d / h) ^ 0.5) * Float64((Float64(d / l) ^ 0.5) * Float64(1.0 + Float64(Float64(Float64(h / Float64(l / Float64(-0.25 / t_0))) / t_0) / 2.0))))
end
function tmp = code(d, h, l, M, D)
	t_0 = d / (M * D);
	tmp = ((d / h) ^ 0.5) * (((d / l) ^ 0.5) * (1.0 + (((h / (l / (-0.25 / t_0))) / t_0) / 2.0)));
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision] * N[(1.0 + N[(N[(N[(h / N[(l / N[(-0.25 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{d}{M \cdot D}\\
{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{\frac{\frac{h}{\frac{\ell}{\frac{-0.25}{t\_0}}}}{t\_0}}{2}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 66.2%

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
    6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 71.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left(\left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (pow (/ d h) 0.5)
  (*
   (+ 1.0 (* (/ h (/ d (/ (* M D) 2.0))) (/ (* -0.25 (/ (* M D) d)) l)))
   (sqrt (/ d l)))))
double code(double d, double h, double l, double M, double D) {
	return pow((d / h), 0.5) * ((1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))) * sqrt((d / 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) ** 0.5d0) * ((1.0d0 + ((h / (d / ((m * d_1) / 2.0d0))) * (((-0.25d0) * ((m * d_1) / d)) / l))) * sqrt((d / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
	return Math.pow((d / h), 0.5) * ((1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))) * Math.sqrt((d / l)));
}
def code(d, h, l, M, D):
	return math.pow((d / h), 0.5) * ((1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))) * math.sqrt((d / l)))
function code(d, h, l, M, D)
	return Float64((Float64(d / h) ^ 0.5) * Float64(Float64(1.0 + Float64(Float64(h / Float64(d / Float64(Float64(M * D) / 2.0))) * Float64(Float64(-0.25 * Float64(Float64(M * D) / d)) / l))) * sqrt(Float64(d / l))))
end
function tmp = code(d, h, l, M, D)
	tmp = ((d / h) ^ 0.5) * ((1.0 + ((h / (d / ((M * D) / 2.0))) * ((-0.25 * ((M * D) / d)) / l))) * sqrt((d / l)));
end
code[d_, h_, l_, M_, D_] := N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[(1.0 + N[(N[(h / N[(d / N[(N[(M * D), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
{\left(\frac{d}{h}\right)}^{0.5} \cdot \left(\left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{-0.25 \cdot \frac{M \cdot D}{d}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell}}\right)
\end{array}
Derivation
  1. Initial program 66.2%

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
    6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 8 \cdot 10^{+129}:\\ \;\;\;\;\left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 8e+129)
   (*
    (+ 1.0 (/ (/ (* h (* M D)) (* d 2.0)) (/ l (/ -0.25 (/ d (* M D))))))
    (sqrt (* (/ d l) (/ d h))))
   (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 8e+129) {
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
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 <= 8d+129) then
        tmp = (1.0d0 + (((h * (m * d_1)) / (d * 2.0d0)) / (l / ((-0.25d0) / (d / (m * d_1)))))) * sqrt(((d / l) * (d / h)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 8e+129) {
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= 8e+129:
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 8e+129)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)) / Float64(l / Float64(-0.25 / Float64(d / Float64(M * D)))))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 8e+129)
		tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 8e+129], N[(N[(1.0 + N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(l / N[(-0.25 / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 8 \cdot 10^{+129}:\\
\;\;\;\;\left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 8e129

    1. Initial program 70.3%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8e129 < l

    1. Initial program 43.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6439.0%

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

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

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    7. Applied egg-rr39.0%

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

        \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right) \]
      2. sqrt-prodN/A

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

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

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

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

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

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

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

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

Alternative 10: 59.1% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\ \mathbf{if}\;d \leq -5.2 \cdot 10^{+142}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-155}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -3.2 \cdot 10^{-302}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{-100}:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{elif}\;d \leq 3 \cdot 10^{+146}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* (/ (* M D) (/ (* 4.0 (* d d)) (* M D))) (* -0.5 (/ h l))))
          (sqrt (/ d (/ h (/ d l)))))))
   (if (<= d -5.2e+142)
     (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
     (if (<= d -2e-155)
       t_0
       (if (<= d -3.2e-302)
         (* (sqrt (/ (/ h l) (* l l))) (* (/ (* M M) d) (* (* D D) 0.125)))
         (if (<= d 4.6e-100)
           (* M (* (* M -0.125) (/ (* D (* D (sqrt (/ (/ (/ h l) l) l)))) d)))
           (if (<= d 3e+146) t_0 (* d (pow (* h l) -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * sqrt((d / (h / (d / l))));
	double tmp;
	if (d <= -5.2e+142) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (d <= -2e-155) {
		tmp = t_0;
	} else if (d <= -3.2e-302) {
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (d <= 4.6e-100) {
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	} else if (d <= 3e+146) {
		tmp = t_0;
	} else {
		tmp = d * pow((h * l), -0.5);
	}
	return tmp;
}
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 = (1.0d0 + (((m * d_1) / ((4.0d0 * (d * d)) / (m * d_1))) * ((-0.5d0) * (h / l)))) * sqrt((d / (h / (d / l))))
    if (d <= (-5.2d+142)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (d <= (-2d-155)) then
        tmp = t_0
    else if (d <= (-3.2d-302)) then
        tmp = sqrt(((h / l) / (l * l))) * (((m * m) / d) * ((d_1 * d_1) * 0.125d0))
    else if (d <= 4.6d-100) then
        tmp = m * ((m * (-0.125d0)) * ((d_1 * (d_1 * sqrt((((h / l) / l) / l)))) / d))
    else if (d <= 3d+146) then
        tmp = t_0
    else
        tmp = d * ((h * l) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * Math.sqrt((d / (h / (d / l))));
	double tmp;
	if (d <= -5.2e+142) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (d <= -2e-155) {
		tmp = t_0;
	} else if (d <= -3.2e-302) {
		tmp = Math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (d <= 4.6e-100) {
		tmp = M * ((M * -0.125) * ((D * (D * Math.sqrt((((h / l) / l) / l)))) / d));
	} else if (d <= 3e+146) {
		tmp = t_0;
	} else {
		tmp = d * Math.pow((h * l), -0.5);
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * math.sqrt((d / (h / (d / l))))
	tmp = 0
	if d <= -5.2e+142:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif d <= -2e-155:
		tmp = t_0
	elif d <= -3.2e-302:
		tmp = math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125))
	elif d <= 4.6e-100:
		tmp = M * ((M * -0.125) * ((D * (D * math.sqrt((((h / l) / l) / l)))) / d))
	elif d <= 3e+146:
		tmp = t_0
	else:
		tmp = d * math.pow((h * l), -0.5)
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(Float64(Float64(M * D) / Float64(Float64(4.0 * Float64(d * d)) / Float64(M * D))) * Float64(-0.5 * Float64(h / l)))) * sqrt(Float64(d / Float64(h / Float64(d / l)))))
	tmp = 0.0
	if (d <= -5.2e+142)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (d <= -2e-155)
		tmp = t_0;
	elseif (d <= -3.2e-302)
		tmp = Float64(sqrt(Float64(Float64(h / l) / Float64(l * l))) * Float64(Float64(Float64(M * M) / d) * Float64(Float64(D * D) * 0.125)));
	elseif (d <= 4.6e-100)
		tmp = Float64(M * Float64(Float64(M * -0.125) * Float64(Float64(D * Float64(D * sqrt(Float64(Float64(Float64(h / l) / l) / l)))) / d)));
	elseif (d <= 3e+146)
		tmp = t_0;
	else
		tmp = Float64(d * (Float64(h * l) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * sqrt((d / (h / (d / l))));
	tmp = 0.0;
	if (d <= -5.2e+142)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (d <= -2e-155)
		tmp = t_0;
	elseif (d <= -3.2e-302)
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	elseif (d <= 4.6e-100)
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	elseif (d <= 3e+146)
		tmp = t_0;
	else
		tmp = d * ((h * l) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(N[(M * D), $MachinePrecision] / N[(N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / N[(h / N[(d / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.2e+142], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-155], t$95$0, If[LessEqual[d, -3.2e-302], N[(N[Sqrt[N[(N[(h / l), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e-100], N[(M * N[(N[(M * -0.125), $MachinePrecision] * N[(N[(D * N[(D * N[Sqrt[N[(N[(N[(h / l), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3e+146], t$95$0, N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\
\mathbf{if}\;d \leq -5.2 \cdot 10^{+142}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -2 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\

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

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

\mathbf{elif}\;d \leq 3 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 73.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6461.3%

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

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

    if -5.20000000000000043e142 < d < -2.00000000000000003e-155 or 4.59999999999999989e-100 < d < 3.00000000000000002e146

    1. Initial program 81.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr70.9%

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

    if -2.00000000000000003e-155 < d < -3.19999999999999978e-302

    1. Initial program 48.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.19999999999999978e-302 < d < 4.59999999999999989e-100

    1. Initial program 35.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000002e146 < d

    1. Initial program 63.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.2 \cdot 10^{+142}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-155}:\\ \;\;\;\;\left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\ \mathbf{elif}\;d \leq -3.2 \cdot 10^{-302}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{-100}:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{elif}\;d \leq 3 \cdot 10^{+146}:\\ \;\;\;\;\left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 54.3% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7 \cdot 10^{+250}:\\ \;\;\;\;\left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\ \mathbf{elif}\;\ell \leq -1.3 \cdot 10^{-32}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+107}:\\ \;\;\;\;\left(1 + \frac{\frac{\frac{h}{d} \cdot \frac{M \cdot D}{-2}}{\frac{d}{M \cdot D} \cdot 4}}{\ell}\right) \cdot \sqrt{\frac{\frac{d}{\frac{h}{d}}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -7e+250)
   (*
    (+ 1.0 (* (/ (* M D) (/ (* 4.0 (* d d)) (* M D))) (* -0.5 (/ h l))))
    (sqrt (/ d (/ h (/ d l)))))
   (if (<= l -1.3e-32)
     (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
     (if (<= l 2.45e+107)
       (*
        (+ 1.0 (/ (/ (* (/ h d) (/ (* M D) -2.0)) (* (/ d (* M D)) 4.0)) l))
        (sqrt (/ (/ d (/ h d)) l)))
       (* d (sqrt (/ (/ 1.0 h) l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -7e+250) {
		tmp = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * sqrt((d / (h / (d / l))));
	} else if (l <= -1.3e-32) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.45e+107) {
		tmp = (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)) * sqrt(((d / (h / d)) / l));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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 <= (-7d+250)) then
        tmp = (1.0d0 + (((m * d_1) / ((4.0d0 * (d * d)) / (m * d_1))) * ((-0.5d0) * (h / l)))) * sqrt((d / (h / (d / l))))
    else if (l <= (-1.3d-32)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.45d+107) then
        tmp = (1.0d0 + ((((h / d) * ((m * d_1) / (-2.0d0))) / ((d / (m * d_1)) * 4.0d0)) / l)) * sqrt(((d / (h / d)) / l))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -7e+250) {
		tmp = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * Math.sqrt((d / (h / (d / l))));
	} else if (l <= -1.3e-32) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.45e+107) {
		tmp = (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)) * Math.sqrt(((d / (h / d)) / l));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -7e+250:
		tmp = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * math.sqrt((d / (h / (d / l))))
	elif l <= -1.3e-32:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.45e+107:
		tmp = (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)) * math.sqrt(((d / (h / d)) / l))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -7e+250)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M * D) / Float64(Float64(4.0 * Float64(d * d)) / Float64(M * D))) * Float64(-0.5 * Float64(h / l)))) * sqrt(Float64(d / Float64(h / Float64(d / l)))));
	elseif (l <= -1.3e-32)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.45e+107)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(h / d) * Float64(Float64(M * D) / -2.0)) / Float64(Float64(d / Float64(M * D)) * 4.0)) / l)) * sqrt(Float64(Float64(d / Float64(h / d)) / l)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -7e+250)
		tmp = (1.0 + (((M * D) / ((4.0 * (d * d)) / (M * D))) * (-0.5 * (h / l)))) * sqrt((d / (h / (d / l))));
	elseif (l <= -1.3e-32)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.45e+107)
		tmp = (1.0 + ((((h / d) * ((M * D) / -2.0)) / ((d / (M * D)) * 4.0)) / l)) * sqrt(((d / (h / d)) / l));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -7e+250], N[(N[(1.0 + N[(N[(N[(M * D), $MachinePrecision] / N[(N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / N[(h / N[(d / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.3e-32], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.45e+107], N[(N[(1.0 + N[(N[(N[(N[(h / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7 \cdot 10^{+250}:\\
\;\;\;\;\left(1 + \frac{M \cdot D}{\frac{4 \cdot \left(d \cdot d\right)}{M \cdot D}} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\frac{h}{\frac{d}{\ell}}}}\\

\mathbf{elif}\;\ell \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -7.0000000000000001e250

    1. Initial program 68.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr63.3%

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

    if -7.0000000000000001e250 < l < -1.2999999999999999e-32

    1. Initial program 63.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6455.2%

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

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

    if -1.2999999999999999e-32 < l < 2.4500000000000001e107

    1. Initial program 72.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4500000000000001e107 < l

    1. Initial program 49.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;\ell \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;-0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \left(t\_0 \cdot \left(0 - D \cdot D\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 15600000:\\ \;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot t\_0\right)\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ h (* l (* l l))))))
   (if (<= l -2.3e-12)
     (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
     (if (<= l 2.3e-308)
       (* -0.125 (* (/ (* M M) d) (* t_0 (- 0.0 (* D D)))))
       (if (<= l 15600000.0)
         (/ (* (* M -0.125) (* D (* (* M D) t_0))) d)
         (* d (sqrt (/ (/ 1.0 h) l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h / (l * (l * l))));
	double tmp;
	if (l <= -2.3e-12) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = -0.125 * (((M * M) / d) * (t_0 * (0.0 - (D * D))));
	} else if (l <= 15600000.0) {
		tmp = ((M * -0.125) * (D * ((M * D) * t_0))) / d;
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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((h / (l * (l * l))))
    if (l <= (-2.3d-12)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.3d-308) then
        tmp = (-0.125d0) * (((m * m) / d) * (t_0 * (0.0d0 - (d_1 * d_1))))
    else if (l <= 15600000.0d0) then
        tmp = ((m * (-0.125d0)) * (d_1 * ((m * d_1) * t_0))) / d
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h / (l * (l * l))));
	double tmp;
	if (l <= -2.3e-12) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = -0.125 * (((M * M) / d) * (t_0 * (0.0 - (D * D))));
	} else if (l <= 15600000.0) {
		tmp = ((M * -0.125) * (D * ((M * D) * t_0))) / d;
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((h / (l * (l * l))))
	tmp = 0
	if l <= -2.3e-12:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.3e-308:
		tmp = -0.125 * (((M * M) / d) * (t_0 * (0.0 - (D * D))))
	elif l <= 15600000.0:
		tmp = ((M * -0.125) * (D * ((M * D) * t_0))) / d
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
	tmp = 0.0
	if (l <= -2.3e-12)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.3e-308)
		tmp = Float64(-0.125 * Float64(Float64(Float64(M * M) / d) * Float64(t_0 * Float64(0.0 - Float64(D * D)))));
	elseif (l <= 15600000.0)
		tmp = Float64(Float64(Float64(M * -0.125) * Float64(D * Float64(Float64(M * D) * t_0))) / d);
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h / (l * (l * l))));
	tmp = 0.0;
	if (l <= -2.3e-12)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.3e-308)
		tmp = -0.125 * (((M * M) / d) * (t_0 * (0.0 - (D * D))));
	elseif (l <= 15600000.0)
		tmp = ((M * -0.125) * (D * ((M * D) * t_0))) / d;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -2.3e-12], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(-0.125 * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(t$95$0 * N[(0.0 - N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 15600000.0], N[(N[(N[(M * -0.125), $MachinePrecision] * N[(D * N[(N[(M * D), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;-0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \left(t\_0 \cdot \left(0 - D \cdot D\right)\right)\right)\\

\mathbf{elif}\;\ell \leq 15600000:\\
\;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot t\_0\right)\right)}{d}\\

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


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

    1. Initial program 64.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6451.1%

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

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

    if -2.29999999999999989e-12 < l < 2.2999999999999999e-308

    1. Initial program 74.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr22.3%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \left(\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \left({D}^{2}\right)\right), \left(\frac{\color{blue}{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}}{d}\right)\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left({D}^{2}\right)\right), \left(\frac{\color{blue}{{M}^{2}} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{\color{blue}{M}}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left({D}^{2}\right)\right), \left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(D \cdot D\right)\right), \left(\frac{{M}^{2} \cdot \color{blue}{{\left(\sqrt{-1}\right)}^{2}}}{d}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{{M}^{2} \cdot \color{blue}{{\left(\sqrt{-1}\right)}^{2}}}{d}\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(\left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right), \color{blue}{d}\right)\right)\right) \]
    6. Simplified45.7%

      \[\leadsto \color{blue}{-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(D \cdot D\right)\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right)} \]

    if 2.2999999999999999e-308 < l < 1.56e7

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{{D}^{2}} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot {\color{blue}{D}}^{2} \]
      8. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{8} \cdot {M}^{2}}{d} \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot {D}^{2}\right) \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{\color{blue}{d}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)\right), \color{blue}{d}\right) \]
    5. Simplified49.5%

      \[\leadsto \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right), d\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(D \cdot \left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right), d\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{\ell \cdot \ell}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{h}{\ell}}{\ell}\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{h}{\ell}\right), \ell\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \left(M \cdot \left(M \cdot \frac{-1}{8}\right)\right)\right)\right), d\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \mathsf{*.f64}\left(M, \left(M \cdot \frac{-1}{8}\right)\right)\right)\right), d\right) \]
      15. *-lowering-*.f6449.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \frac{-1}{8}\right)\right)\right)\right), d\right) \]
    7. Applied egg-rr49.7%

      \[\leadsto \frac{\color{blue}{D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot \left(M \cdot \left(M \cdot -0.125\right)\right)\right)}}{d} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(D \cdot \left(\left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right) \cdot \left(M \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right)\right) \cdot \left(M \cdot \frac{-1}{8}\right)\right), d\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right)\right), \left(M \cdot \frac{-1}{8}\right)\right), d\right) \]
    9. Applied egg-rr57.1%

      \[\leadsto \frac{\color{blue}{\left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(M \cdot D\right)\right)\right) \cdot \left(M \cdot -0.125\right)}}{d} \]

    if 1.56e7 < l

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    7. Applied egg-rr47.6%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;-0.125 \cdot \left(\frac{M \cdot M}{d} \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(0 - D \cdot D\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 15600000:\\ \;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 47.6% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.95 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;\ell \leq 80000000:\\ \;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.95e-13)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (if (<= l 2.3e-308)
     (* (sqrt (/ (/ h l) (* l l))) (* (/ (* M M) d) (* (* D D) 0.125)))
     (if (<= l 80000000.0)
       (/ (* (* M -0.125) (* D (* (* M D) (sqrt (/ h (* l (* l l))))))) d)
       (* d (sqrt (/ (/ 1.0 h) l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.95e-13) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (l <= 80000000.0) {
		tmp = ((M * -0.125) * (D * ((M * D) * sqrt((h / (l * (l * l))))))) / d;
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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 <= (-1.95d-13)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.3d-308) then
        tmp = sqrt(((h / l) / (l * l))) * (((m * m) / d) * ((d_1 * d_1) * 0.125d0))
    else if (l <= 80000000.0d0) then
        tmp = ((m * (-0.125d0)) * (d_1 * ((m * d_1) * sqrt((h / (l * (l * l))))))) / d
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.95e-13) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = Math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (l <= 80000000.0) {
		tmp = ((M * -0.125) * (D * ((M * D) * Math.sqrt((h / (l * (l * l))))))) / d;
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.95e-13:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.3e-308:
		tmp = math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125))
	elif l <= 80000000.0:
		tmp = ((M * -0.125) * (D * ((M * D) * math.sqrt((h / (l * (l * l))))))) / d
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.95e-13)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.3e-308)
		tmp = Float64(sqrt(Float64(Float64(h / l) / Float64(l * l))) * Float64(Float64(Float64(M * M) / d) * Float64(Float64(D * D) * 0.125)));
	elseif (l <= 80000000.0)
		tmp = Float64(Float64(Float64(M * -0.125) * Float64(D * Float64(Float64(M * D) * sqrt(Float64(h / Float64(l * Float64(l * l))))))) / d);
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.95e-13)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.3e-308)
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	elseif (l <= 80000000.0)
		tmp = ((M * -0.125) * (D * ((M * D) * sqrt((h / (l * (l * l))))))) / d;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.95e-13], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(N[Sqrt[N[(N[(h / l), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 80000000.0], N[(N[(N[(M * -0.125), $MachinePrecision] * N[(D * N[(N[(M * D), $MachinePrecision] * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.95 \cdot 10^{-13}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\

\mathbf{elif}\;\ell \leq 80000000:\\
\;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{d}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.95000000000000002e-13

    1. Initial program 64.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6451.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    5. Simplified51.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if -1.95000000000000002e-13 < l < 2.2999999999999999e-308

    1. Initial program 74.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}{\frac{\ell}{h}}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)}\right)\right)\right) \]
    4. Applied egg-rr78.8%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{h}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{1}{2}\right)\right), \left({\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{1} - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{1}{2}\right)\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
    6. Applied egg-rr79.0%

      \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{\frac{\frac{M \cdot D}{2}}{d}}{-2}}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot M}{d}\right)}, \ell\right)\right)\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{D \cdot M}{d}\right)\right), \ell\right)\right)\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f6479.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
    9. Simplified79.0%

      \[\leadsto {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\color{blue}{-0.25 \cdot \frac{D \cdot M}{d}}}{\ell}\right)\right) \]
    10. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{h}{\ell}\right), \left({\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}}{d}\right)\right) \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right) \]
      14. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)\right) \]
      15. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d} \cdot \left(\frac{1}{8} \cdot {D}^{2}\right)\right)\right)\right) \]
    12. Simplified44.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)} \]

    if 2.2999999999999999e-308 < l < 8e7

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{{D}^{2}} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot {\color{blue}{D}}^{2} \]
      8. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{8} \cdot {M}^{2}}{d} \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot {D}^{2}\right) \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{\color{blue}{d}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)\right), \color{blue}{d}\right) \]
    5. Simplified49.5%

      \[\leadsto \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right), d\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(D \cdot \left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right), d\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{\ell \cdot \ell}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\left(\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{h}{\ell}}{\ell}\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{h}{\ell}\right), \ell\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \left(M \cdot \left(M \cdot \frac{-1}{8}\right)\right)\right)\right), d\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \mathsf{*.f64}\left(M, \left(M \cdot \frac{-1}{8}\right)\right)\right)\right), d\right) \]
      15. *-lowering-*.f6449.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \ell\right), \ell\right)\right)\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \frac{-1}{8}\right)\right)\right)\right), d\right) \]
    7. Applied egg-rr49.7%

      \[\leadsto \frac{\color{blue}{D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot \left(M \cdot \left(M \cdot -0.125\right)\right)\right)}}{d} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(D \cdot \left(\left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right) \cdot \left(M \cdot \frac{-1}{8}\right)\right)\right), d\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right)\right) \cdot \left(M \cdot \frac{-1}{8}\right)\right), d\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(D \cdot \left(\left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right) \cdot M\right)\right), \left(M \cdot \frac{-1}{8}\right)\right), d\right) \]
    9. Applied egg-rr57.1%

      \[\leadsto \frac{\color{blue}{\left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(M \cdot D\right)\right)\right) \cdot \left(M \cdot -0.125\right)}}{d} \]

    if 8e7 < l

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    7. Applied egg-rr47.6%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.95 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;\ell \leq 80000000:\\ \;\;\;\;\frac{\left(M \cdot -0.125\right) \cdot \left(D \cdot \left(\left(M \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 47.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.7 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;\ell \leq 340000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.7e-13)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (if (<= l 2.3e-308)
     (* (sqrt (/ (/ h l) (* l l))) (* (/ (* M M) d) (* (* D D) 0.125)))
     (if (<= l 340000000.0)
       (* M (* (* M -0.125) (/ (* D (* D (sqrt (/ (/ (/ h l) l) l)))) d)))
       (* d (sqrt (/ (/ 1.0 h) l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.7e-13) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (l <= 340000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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 <= (-1.7d-13)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.3d-308) then
        tmp = sqrt(((h / l) / (l * l))) * (((m * m) / d) * ((d_1 * d_1) * 0.125d0))
    else if (l <= 340000000.0d0) then
        tmp = m * ((m * (-0.125d0)) * ((d_1 * (d_1 * sqrt((((h / l) / l) / l)))) / d))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.7e-13) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = Math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	} else if (l <= 340000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * Math.sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.7e-13:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.3e-308:
		tmp = math.sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125))
	elif l <= 340000000.0:
		tmp = M * ((M * -0.125) * ((D * (D * math.sqrt((((h / l) / l) / l)))) / d))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.7e-13)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.3e-308)
		tmp = Float64(sqrt(Float64(Float64(h / l) / Float64(l * l))) * Float64(Float64(Float64(M * M) / d) * Float64(Float64(D * D) * 0.125)));
	elseif (l <= 340000000.0)
		tmp = Float64(M * Float64(Float64(M * -0.125) * Float64(Float64(D * Float64(D * sqrt(Float64(Float64(Float64(h / l) / l) / l)))) / d)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.7e-13)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.3e-308)
		tmp = sqrt(((h / l) / (l * l))) * (((M * M) / d) * ((D * D) * 0.125));
	elseif (l <= 340000000.0)
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.7e-13], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(N[Sqrt[N[(N[(h / l), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 340000000.0], N[(M * N[(N[(M * -0.125), $MachinePrecision] * N[(N[(D * N[(D * N[Sqrt[N[(N[(N[(h / l), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{-13}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\

\mathbf{elif}\;\ell \leq 340000000:\\
\;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.70000000000000008e-13

    1. Initial program 64.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6451.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    5. Simplified51.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if -1.70000000000000008e-13 < l < 2.2999999999999999e-308

    1. Initial program 74.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}{\frac{\ell}{h}}\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
      5. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
      6. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)}\right)\right)\right) \]
    4. Applied egg-rr78.8%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right) \]
      3. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{h}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{1}{2}\right)\right), \left({\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)}\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{1} - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{1}{2}\right)\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
      10. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
    6. Applied egg-rr79.0%

      \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{\frac{\frac{M \cdot D}{2}}{d}}{-2}}{\ell}\right)\right)} \]
    7. Taylor expanded in M around 0

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot M}{d}\right)}, \ell\right)\right)\right)\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{D \cdot M}{d}\right)\right), \ell\right)\right)\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f6479.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
    9. Simplified79.0%

      \[\leadsto {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\color{blue}{-0.25 \cdot \frac{D \cdot M}{d}}}{\ell}\right)\right) \]
    10. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{\ell \cdot {\ell}^{2}}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{h}{\ell}}{{\ell}^{2}}\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{h}{\ell}\right), \left({\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left({\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \left(\ell \cdot \ell\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}}{d}\right)\right) \]
      13. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right) \]
      14. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)\right) \]
      15. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d} \cdot \left(\frac{1}{8} \cdot {D}^{2}\right)\right)\right)\right) \]
    12. Simplified44.3%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)} \]

    if 2.2999999999999999e-308 < l < 3.4e8

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{{D}^{2}} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot {\color{blue}{D}}^{2} \]
      8. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{8} \cdot {M}^{2}}{d} \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot {D}^{2}\right) \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{\color{blue}{d}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)\right), \color{blue}{d}\right) \]
    5. Simplified49.5%

      \[\leadsto \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}} \]
      2. associate-*l*N/A

        \[\leadsto \left(M \cdot \left(M \cdot \frac{-1}{8}\right)\right) \cdot \frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d} \]
      3. associate-*l*N/A

        \[\leadsto M \cdot \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(M \cdot \frac{-1}{8}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right), \color{blue}{d}\right)\right)\right) \]
    7. Applied egg-rr55.6%

      \[\leadsto \color{blue}{M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)} \]

    if 3.4e8 < l

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    7. Applied egg-rr47.6%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.7 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\sqrt{\frac{\frac{h}{\ell}}{\ell \cdot \ell}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;\ell \leq 340000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 47.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.75 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{elif}\;\ell \leq 340000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.75e-13)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (if (<= l 2.3e-308)
     (* (* (/ (* M M) d) (* (* D D) 0.125)) (sqrt (/ h (* l (* l l)))))
     (if (<= l 340000000.0)
       (* M (* (* M -0.125) (/ (* D (* D (sqrt (/ (/ (/ h l) l) l)))) d)))
       (* d (sqrt (/ (/ 1.0 h) l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.75e-13) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = (((M * M) / d) * ((D * D) * 0.125)) * sqrt((h / (l * (l * l))));
	} else if (l <= 340000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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 <= (-1.75d-13)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.3d-308) then
        tmp = (((m * m) / d) * ((d_1 * d_1) * 0.125d0)) * sqrt((h / (l * (l * l))))
    else if (l <= 340000000.0d0) then
        tmp = m * ((m * (-0.125d0)) * ((d_1 * (d_1 * sqrt((((h / l) / l) / l)))) / d))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.75e-13) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = (((M * M) / d) * ((D * D) * 0.125)) * Math.sqrt((h / (l * (l * l))));
	} else if (l <= 340000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * Math.sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.75e-13:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.3e-308:
		tmp = (((M * M) / d) * ((D * D) * 0.125)) * math.sqrt((h / (l * (l * l))))
	elif l <= 340000000.0:
		tmp = M * ((M * -0.125) * ((D * (D * math.sqrt((((h / l) / l) / l)))) / d))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.75e-13)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.3e-308)
		tmp = Float64(Float64(Float64(Float64(M * M) / d) * Float64(Float64(D * D) * 0.125)) * sqrt(Float64(h / Float64(l * Float64(l * l)))));
	elseif (l <= 340000000.0)
		tmp = Float64(M * Float64(Float64(M * -0.125) * Float64(Float64(D * Float64(D * sqrt(Float64(Float64(Float64(h / l) / l) / l)))) / d)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.75e-13)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.3e-308)
		tmp = (((M * M) / d) * ((D * D) * 0.125)) * sqrt((h / (l * (l * l))));
	elseif (l <= 340000000.0)
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.75e-13], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 340000000.0], N[(M * N[(N[(M * -0.125), $MachinePrecision] * N[(N[(D * N[(D * N[Sqrt[N[(N[(N[(h / l), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-13}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;\left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\

\mathbf{elif}\;\ell \leq 340000000:\\
\;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.7500000000000001e-13

    1. Initial program 64.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6451.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    5. Simplified51.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if -1.7500000000000001e-13 < l < 2.2999999999999999e-308

    1. Initial program 74.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \frac{\color{blue}{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}}{d}\right)\right) \]
      12. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right) \]
      13. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\mathsf{neg}\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d} \cdot \left(\frac{1}{8} \cdot {D}^{2}\right)\right)\right)\right) \]
    5. Simplified44.3%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)} \]

    if 2.2999999999999999e-308 < l < 3.4e8

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{{D}^{2}} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot {\color{blue}{D}}^{2} \]
      8. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{8} \cdot {M}^{2}}{d} \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot {D}^{2}\right) \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{\color{blue}{d}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)\right), \color{blue}{d}\right) \]
    5. Simplified49.5%

      \[\leadsto \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}} \]
      2. associate-*l*N/A

        \[\leadsto \left(M \cdot \left(M \cdot \frac{-1}{8}\right)\right) \cdot \frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d} \]
      3. associate-*l*N/A

        \[\leadsto M \cdot \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(M \cdot \frac{-1}{8}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right), \color{blue}{d}\right)\right)\right) \]
    7. Applied egg-rr55.6%

      \[\leadsto \color{blue}{M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)} \]

    if 3.4e8 < l

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    7. Applied egg-rr47.6%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.75 \cdot 10^{-13}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;\left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{elif}\;\ell \leq 340000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 46.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{-214}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;d \cdot {\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}\\ \mathbf{elif}\;\ell \leq 175000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.8e-214)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (if (<= l 2.3e-308)
     (* d (pow (* (* h l) (* h l)) -0.25))
     (if (<= l 175000000.0)
       (* M (* (* M -0.125) (/ (* D (* D (sqrt (/ (/ (/ h l) l) l)))) d)))
       (* d (sqrt (/ (/ 1.0 h) l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.8e-214) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = d * pow(((h * l) * (h * l)), -0.25);
	} else if (l <= 175000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
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 <= (-1.8d-214)) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else if (l <= 2.3d-308) then
        tmp = d * (((h * l) * (h * l)) ** (-0.25d0))
    else if (l <= 175000000.0d0) then
        tmp = m * ((m * (-0.125d0)) * ((d_1 * (d_1 * sqrt((((h / l) / l) / l)))) / d))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.8e-214) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else if (l <= 2.3e-308) {
		tmp = d * Math.pow(((h * l) * (h * l)), -0.25);
	} else if (l <= 175000000.0) {
		tmp = M * ((M * -0.125) * ((D * (D * Math.sqrt((((h / l) / l) / l)))) / d));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.8e-214:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	elif l <= 2.3e-308:
		tmp = d * math.pow(((h * l) * (h * l)), -0.25)
	elif l <= 175000000.0:
		tmp = M * ((M * -0.125) * ((D * (D * math.sqrt((((h / l) / l) / l)))) / d))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.8e-214)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (l <= 2.3e-308)
		tmp = Float64(d * (Float64(Float64(h * l) * Float64(h * l)) ^ -0.25));
	elseif (l <= 175000000.0)
		tmp = Float64(M * Float64(Float64(M * -0.125) * Float64(Float64(D * Float64(D * sqrt(Float64(Float64(Float64(h / l) / l) / l)))) / d)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.8e-214)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	elseif (l <= 2.3e-308)
		tmp = d * (((h * l) * (h * l)) ^ -0.25);
	elseif (l <= 175000000.0)
		tmp = M * ((M * -0.125) * ((D * (D * sqrt((((h / l) / l) / l)))) / d));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.8e-214], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.3e-308], N[(d * N[Power[N[(N[(h * l), $MachinePrecision] * N[(h * l), $MachinePrecision]), $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 175000000.0], N[(M * N[(N[(M * -0.125), $MachinePrecision] * N[(N[(D * N[(D * N[Sqrt[N[(N[(N[(h / l), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{-214}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\
\;\;\;\;d \cdot {\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}\\

\mathbf{elif}\;\ell \leq 175000000:\\
\;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.8e-214

    1. Initial program 67.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6443.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    5. Simplified43.0%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if -1.8e-214 < l < 2.2999999999999999e-308

    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. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6420.9%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified20.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{h \cdot \ell}\right)}\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
      6. *-lowering-*.f6420.9%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
    7. Applied egg-rr20.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{h \cdot \ell}}{d}}} \]
      2. associate-/r/N/A

        \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot \color{blue}{d} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{\sqrt{h \cdot \ell}}\right), \color{blue}{d}\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{{\left(h \cdot \ell\right)}^{\frac{1}{2}}}\right), d\right) \]
      5. pow-flipN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), d\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), d\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\ell \cdot h\right), \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), d\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), d\right) \]
      9. metadata-eval20.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \frac{-1}{2}\right), d\right) \]
    9. Applied egg-rr20.9%

      \[\leadsto \color{blue}{{\left(\ell \cdot h\right)}^{-0.5} \cdot d} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(2 \cdot \frac{-1}{4}\right)}\right), d\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{4}} \cdot {\left(h \cdot \ell\right)}^{\frac{-1}{4}}\right), d\right) \]
      4. pow-prod-downN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{\frac{-1}{4}}\right), d\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right), \frac{-1}{4}\right), d\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(h \cdot \ell\right), \left(h \cdot \ell\right)\right), \frac{-1}{4}\right), d\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \left(h \cdot \ell\right)\right), \frac{-1}{4}\right), d\right) \]
      8. *-lowering-*.f6448.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \mathsf{*.f64}\left(h, \ell\right)\right), \frac{-1}{4}\right), d\right) \]
    11. Applied egg-rr48.9%

      \[\leadsto \color{blue}{{\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}} \cdot d \]

    if 2.2999999999999999e-308 < l < 1.75e8

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{{D}^{2}} \]
      7. associate-*r*N/A

        \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot {\color{blue}{D}}^{2} \]
      8. associate-*l*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)} \]
      9. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{8} \cdot {M}^{2}}{d} \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot {D}^{2}\right) \]
      10. associate-*l/N/A

        \[\leadsto \frac{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)}{\color{blue}{d}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot {D}^{2}\right)\right), \color{blue}{d}\right) \]
    5. Simplified49.5%

      \[\leadsto \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \left(\left(M \cdot M\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}} \]
      2. associate-*l*N/A

        \[\leadsto \left(M \cdot \left(M \cdot \frac{-1}{8}\right)\right) \cdot \frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d} \]
      3. associate-*l*N/A

        \[\leadsto M \cdot \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \color{blue}{\left(\left(M \cdot \frac{-1}{8}\right) \cdot \frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(M \cdot \frac{-1}{8}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}}{d}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, \frac{-1}{8}\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right), \color{blue}{d}\right)\right)\right) \]
    7. Applied egg-rr55.6%

      \[\leadsto \color{blue}{M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)} \]

    if 1.75e8 < l

    1. Initial program 60.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6447.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6447.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    7. Applied egg-rr47.6%

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification47.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{-214}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-308}:\\ \;\;\;\;d \cdot {\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{-0.25}\\ \mathbf{elif}\;\ell \leq 175000000:\\ \;\;\;\;M \cdot \left(\left(M \cdot -0.125\right) \cdot \frac{D \cdot \left(D \cdot \sqrt{\frac{\frac{\frac{h}{\ell}}{\ell}}{\ell}}\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 58.1% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (+ 1.0 (/ (/ (* h (* M D)) (* d 2.0)) (/ l (/ -0.25 (/ d (* M D))))))
  (sqrt (* (/ d l) (/ d h)))))
double code(double d, double h, double l, double M, double D) {
	return (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
}
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 = (1.0d0 + (((h * (m * d_1)) / (d * 2.0d0)) / (l / ((-0.25d0) / (d / (m * d_1)))))) * sqrt(((d / l) * (d / h)))
end function
public static double code(double d, double h, double l, double M, double D) {
	return (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * Math.sqrt(((d / l) * (d / h)));
}
def code(d, h, l, M, D):
	return (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * math.sqrt(((d / l) * (d / h)))
function code(d, h, l, M, D)
	return Float64(Float64(1.0 + Float64(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)) / Float64(l / Float64(-0.25 / Float64(d / Float64(M * D)))))) * sqrt(Float64(Float64(d / l) * Float64(d / h))))
end
function tmp = code(d, h, l, M, D)
	tmp = (1.0 + (((h * (M * D)) / (d * 2.0)) / (l / (-0.25 / (d / (M * D)))))) * sqrt(((d / l) * (d / h)));
end
code[d_, h_, l_, M_, D_] := N[(N[(1.0 + N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(l / N[(-0.25 / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}
\end{array}
Derivation
  1. Initial program 66.2%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
    2. un-div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\frac{\ell}{h}}}\right)\right)\right) \]
    3. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}{\frac{\ell}{h}}\right)\right)\right) \]
    4. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\color{blue}{\ell}}{h}}\right)\right)\right) \]
    5. div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \color{blue}{\frac{1}{h}}}\right)\right)\right) \]
    6. times-fracN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \mathsf{/.f64}\left(1, 2\right)\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(1, 2\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}\right), \color{blue}{\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)}\right)\right)\right) \]
  4. Applied egg-rr71.2%

    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}}\right) \]
  5. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right) \]
    3. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{h}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \left(\frac{1}{2}\right)\right), \left({\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)}\right)\right) \]
    7. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{1}{2}\right)\right), \left(\color{blue}{1} - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{1}{2}\right)\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 - \frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)\right) \]
    10. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
    11. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{\frac{M \cdot \frac{D}{2}}{d}}{2}}{\ell} \cdot \frac{\frac{M \cdot \frac{D}{2}}{d}}{\frac{1}{h}}\right)\right)}\right)\right)\right) \]
  6. Applied egg-rr71.3%

    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{\frac{\frac{M \cdot D}{2}}{d}}{-2}}{\ell}\right)\right)} \]
  7. Taylor expanded in M around 0

    \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot M}{d}\right)}, \ell\right)\right)\right)\right)\right) \]
  8. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{D \cdot M}{d}\right)\right), \ell\right)\right)\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
    3. *-lowering-*.f6471.3%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, h\right), \frac{1}{2}\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \frac{1}{2}\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, D\right), 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right), \ell\right)\right)\right)\right)\right) \]
  9. Simplified71.3%

    \[\leadsto {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\color{blue}{-0.25 \cdot \frac{D \cdot M}{d}}}{\ell}\right)\right) \]
  10. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right) \cdot \color{blue}{\left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{-1}{4} \cdot \frac{D \cdot M}{d}}{\ell}\right)} \]
    2. *-commutativeN/A

      \[\leadsto \left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{-1}{4} \cdot \frac{D \cdot M}{d}}{\ell}\right) \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right)} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{h}{\frac{d}{\frac{M \cdot D}{2}}} \cdot \frac{\frac{-1}{4} \cdot \frac{D \cdot M}{d}}{\ell}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right)}\right) \]
  11. Applied egg-rr58.2%

    \[\leadsto \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}} + 1\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
  12. Final simplification58.2%

    \[\leadsto \left(1 + \frac{\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{\ell}{\frac{-0.25}{\frac{d}{M \cdot D}}}}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
  13. Add Preprocessing

Alternative 18: 43.1% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3.1 \cdot 10^{-282}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 3.1e-282)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 3.1e-282) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else {
		tmp = d * pow((h * l), -0.5);
	}
	return tmp;
}
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 <= 3.1d-282) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else
        tmp = d * ((h * l) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 3.1e-282) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else {
		tmp = d * Math.pow((h * l), -0.5);
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= 3.1e-282:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	else:
		tmp = d * math.pow((h * l), -0.5)
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 3.1e-282)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	else
		tmp = Float64(d * (Float64(h * l) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 3.1e-282)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	else
		tmp = d * ((h * l) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.1e-282], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.1 \cdot 10^{-282}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 3.10000000000000013e-282

    1. Initial program 69.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6440.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    5. Simplified40.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if 3.10000000000000013e-282 < l

    1. Initial program 61.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    5. Simplified38.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{d}\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right), d\right) \]
      4. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right), d\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
      7. *-lowering-*.f6438.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
    7. Applied egg-rr38.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.1 \cdot 10^{-282}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 26.9% accurate, 3.1× speedup?

\[\begin{array}{l} \\ d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}} \end{array} \]
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ (/ 1.0 h) l))))
double code(double d, double h, double l, double M, double D) {
	return d * sqrt(((1.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 * sqrt(((1.0d0 / h) / l))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.sqrt(((1.0 / h) / l));
}
def code(d, h, l, M, D):
	return d * math.sqrt(((1.0 / h) / l))
function code(d, h, l, M, D)
	return Float64(d * sqrt(Float64(Float64(1.0 / h) / l)))
end
function tmp = code(d, h, l, M, D)
	tmp = d * sqrt(((1.0 / h) / l));
end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}
\end{array}
Derivation
  1. Initial program 66.2%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6422.5%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  5. Simplified22.5%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Step-by-step derivation
    1. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    2. associate-/r*N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
    4. /-lowering-/.f6422.6%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
  7. Applied egg-rr22.6%

    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}}} \]
  8. Add Preprocessing

Alternative 20: 26.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ d \cdot \sqrt{\frac{1}{h \cdot \ell}} \end{array} \]
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* h l)))))
double code(double d, double h, double l, double M, double D) {
	return d * sqrt((1.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 * sqrt((1.0d0 / (h * l)))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.sqrt((1.0 / (h * l)));
}
def code(d, h, l, M, D):
	return d * math.sqrt((1.0 / (h * l)))
function code(d, h, l, M, D)
	return Float64(d * sqrt(Float64(1.0 / Float64(h * l))))
end
function tmp = code(d, h, l, M, D)
	tmp = d * sqrt((1.0 / (h * l)));
end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
d \cdot \sqrt{\frac{1}{h \cdot \ell}}
\end{array}
Derivation
  1. Initial program 66.2%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6422.5%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  5. Simplified22.5%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Add Preprocessing

Alternative 21: 26.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ d \cdot {\left(h \cdot \ell\right)}^{-0.5} \end{array} \]
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
	return d * pow((h * l), -0.5);
}
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 * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D):
	return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D)
	return Float64(d * (Float64(h * l) ^ -0.5))
end
function tmp = code(d, h, l, M, D)
	tmp = d * ((h * l) ^ -0.5);
end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 66.2%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6422.5%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  5. Simplified22.5%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{d}\right) \]
    3. inv-powN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right), d\right) \]
    4. sqrt-pow1N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right), d\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(h \cdot \ell\right)}^{\frac{-1}{2}}\right), d\right) \]
    6. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(h \cdot \ell\right), \frac{-1}{2}\right), d\right) \]
    7. *-lowering-*.f6422.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(h, \ell\right), \frac{-1}{2}\right), d\right) \]
  7. Applied egg-rr22.4%

    \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot d} \]
  8. Final simplification22.4%

    \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]
  9. Add Preprocessing

Alternative 22: 26.7% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
	return d / sqrt((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 / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D):
	return d / math.sqrt((h * l))
function code(d, h, l, M, D)
	return Float64(d / sqrt(Float64(h * l)))
end
function tmp = code(d, h, l, M, D)
	tmp = d / sqrt((h * l));
end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Derivation
  1. Initial program 66.2%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6422.5%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  5. Simplified22.5%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Step-by-step derivation
    1. sqrt-divN/A

      \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    2. metadata-evalN/A

      \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    3. un-div-invN/A

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{h \cdot \ell}\right)}\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(h \cdot \ell\right)\right)\right) \]
    6. *-lowering-*.f6422.3%

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(h, \ell\right)\right)\right) \]
  7. Applied egg-rr22.3%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024191 
(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)))))