Henrywood and Agarwal, Equation (12)

Percentage Accurate: 67.2% → 87.6%
Time: 34.6s
Alternatives: 22
Speedup: 1.1×

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.2% 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: 87.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

Alternative 2: 83.1% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

Alternative 3: 78.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 85.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. Simplified88.0%

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

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

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

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

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

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

    if -5.00000000000000001e-137 < d < -1.000000000000002e-309

    1. Initial program 43.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. Simplified43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
    7. Applied egg-rr67.2%

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

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

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

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

Alternative 4: 75.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 85.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. Simplified88.0%

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

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

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

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

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

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

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

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

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

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

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

    if -7.4999999999999995e-137 < d < -1.000000000000002e-309

    1. Initial program 43.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. Simplified43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

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

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

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

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

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

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

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

Alternative 5: 78.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 85.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. Simplified88.0%

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

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

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

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

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

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

    if -1.5e-134 < d < -1.000000000000002e-309

    1. Initial program 43.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. Simplified43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

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

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

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

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

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

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

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

Alternative 6: 78.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 72.4%

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 67.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
    7. Applied egg-rr67.2%

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

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

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

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

Alternative 7: 76.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{-133}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}{\ell}\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.8e-133)
   (*
    (sqrt (/ d h))
    (*
     (sqrt (/ d l))
     (+ 1.0 (/ (* h (* -0.5 (pow (* M (* D (/ 0.5 d))) 2.0))) l))))
   (if (<= d -1e-309)
     (*
      (* d (sqrt (/ (/ 1.0 h) l)))
      (- -1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0)))))
     (*
      (fma (/ h l) (* -0.5 (pow (* M (/ D (* d 2.0))) 2.0)) 1.0)
      (/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.8e-133) {
		tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * pow((M * (D * (0.5 / d))), 2.0))) / l)));
	} else if (d <= -1e-309) {
		tmp = (d * sqrt(((1.0 / h) / l))) * (-1.0 - (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0))));
	} else {
		tmp = fma((h / l), (-0.5 * pow((M * (D / (d * 2.0))), 2.0)), 1.0) * (d / (sqrt(h) * sqrt(l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.8e-133)
		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) / l))));
	elseif (d <= -1e-309)
		tmp = Float64(Float64(d * sqrt(Float64(Float64(1.0 / h) / l))) * Float64(-1.0 - Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)))));
	else
		tmp = Float64(fma(Float64(h / l), Float64(-0.5 * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)), 1.0) * Float64(d / Float64(sqrt(h) * sqrt(l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.8e-133], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h}{\ell}, -0.5 \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}, 1\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


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

    1. Initial program 85.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. Simplified88.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.7999999999999999e-133 < d < -1.000000000000002e-309

    1. Initial program 43.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. Simplified43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 70.5% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -6.50000000000000056e-135 or 2.80000000000000004e-267 < d

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.50000000000000056e-135 < d < 3.99999999999999988e-304

    1. Initial program 42.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. Simplified42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999988e-304 < d < 2.80000000000000004e-267

    1. Initial program 30.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. Simplified30.7%

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

      \[\leadsto \color{blue}{-0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r*70.7%

        \[\leadsto \color{blue}{\left(-0.125 \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutative70.7%

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

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2}}}}\right) \]
      4. associate-/r/70.7%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{d} \cdot {M}^{2}\right)}\right) \]
    6. Simplified70.7%

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

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

Alternative 9: 69.3% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.7499999999999999e148 or -1.9000000000000001e-280 < l < 2.8999999999999998e51

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

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

    if -1.7499999999999999e148 < l < -1.9000000000000001e-280

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8999999999999998e51 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down61.7%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr61.7%

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

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

Alternative 10: 70.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < -7.20000000000000036e-138 or 3.99999999999999988e-304 < d

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000036e-138 < d < 3.99999999999999988e-304

    1. Initial program 42.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. Simplified42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 68.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.25 \cdot 10^{+200}:\\
\;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.25000000000000005e200

    1. Initial program 53.8%

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

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

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

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

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

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

    if -1.25000000000000005e200 < l < -2.60000000000000001e-259

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000001e-259 < l < 8.49999999999999961e50

    1. Initial program 79.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. Simplified78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999961e50 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down61.7%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr61.7%

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

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

Alternative 12: 66.0% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -6.19999999999999978e155 or -2.5499999999999999e-259 < l < 2.1499999999999999e51

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def30.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999978e155 < l < -2.5499999999999999e-259

    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. Simplified73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1499999999999999e51 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down61.7%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr61.7%

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

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

Alternative 13: 66.2% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+50}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -2.9000000000000001e166 or -2.49999999999999989e-259 < l < 3.10000000000000003e50

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000001e166 < l < -2.49999999999999989e-259

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr74.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval74.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac74.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*75.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity75.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval75.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified75.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Step-by-step derivation
      1. expm1-log1p-u42.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)\right)} \]
      2. expm1-udef31.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)} - 1} \]
    9. Applied egg-rr28.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def38.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p65.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp58.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)} \]
      4. rem-log-exp65.7%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      5. *-commutative65.7%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}\right) \]
    11. Simplified65.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)} \]
    12. Taylor expanded in d around -inf 85.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]
    13. Step-by-step derivation
      1. mul-1-neg85.0%

        \[\leadsto \color{blue}{\left(-d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]
      2. *-commutative85.0%

        \[\leadsto \left(-\color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d}\right) \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]
      3. distribute-rgt-neg-in85.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\right)} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]
      4. associate-/r*85.1%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot \left(-d\right)\right) \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]
    14. Simplified85.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(-d\right)\right)} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \]

    if 3.10000000000000003e50 < l

    1. Initial program 49.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. Simplified49.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt49.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow249.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod49.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow249.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod32.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr49.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval49.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac52.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval52.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified52.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 55.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-155.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval55.1%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr55.1%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square55.1%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt54.9%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr54.9%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt55.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified55.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative55.1%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down61.7%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr61.7%

      \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.9 \cdot 10^{+166}:\\ \;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;\ell \leq -2.5 \cdot 10^{-259}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right) \cdot \left(-1 - -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+50}:\\ \;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 48.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;D \leq 16000000000:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= D 16000000000.0)
   (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
   (*
    (+ 1.0 (* -0.5 (* (/ h l) (pow (* D (* M (/ 0.5 d))) 2.0))))
    (sqrt (* (/ d l) (/ d h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (D <= 16000000000.0) {
		tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
	} else {
		tmp = (1.0 + (-0.5 * ((h / l) * pow((D * (M * (0.5 / d))), 2.0)))) * sqrt(((d / l) * (d / 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 (d_1 <= 16000000000.0d0) then
        tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
    else
        tmp = (1.0d0 + ((-0.5d0) * ((h / l) * ((d_1 * (m * (0.5d0 / d))) ** 2.0d0)))) * sqrt(((d / l) * (d / h)))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (D <= 16000000000.0) {
		tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
	} else {
		tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((D * (M * (0.5 / d))), 2.0)))) * Math.sqrt(((d / l) * (d / h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if D <= 16000000000.0:
		tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d)))
	else:
		tmp = (1.0 + (-0.5 * ((h / l) * math.pow((D * (M * (0.5 / d))), 2.0)))) * math.sqrt(((d / l) * (d / h)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (D <= 16000000000.0)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d))));
	else
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0)))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (D <= 16000000000.0)
		tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
	else
		tmp = (1.0 + (-0.5 * ((h / l) * ((D * (M * (0.5 / d))) ^ 2.0)))) * sqrt(((d / l) * (d / h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 16000000000.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;D \leq 16000000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 1.6e10

    1. Initial program 72.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified72.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 47.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. clear-num47.0%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
      2. sqrt-div47.7%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
      3. metadata-eval47.7%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
    6. Applied egg-rr47.7%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]

    if 1.6e10 < 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. Simplified62.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt62.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow262.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod62.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow262.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod34.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac63.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval63.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified63.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Step-by-step derivation
      1. expm1-log1p-u21.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)\right)} \]
      2. expm1-udef13.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)} - 1} \]
    9. Applied egg-rr13.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def21.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p60.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp57.4%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)} \]
      4. rem-log-exp60.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      5. *-commutative60.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}\right) \]
    11. Simplified60.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 16000000000:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 48.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;D \leq 5.5 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= D 5.5e-10)
   (* (sqrt (/ d l)) (/ 1.0 (sqrt (/ h d))))
   (*
    (+ 1.0 (* -0.5 (/ (* h (pow (* D (/ (* M 0.5) d)) 2.0)) l)))
    (sqrt (* (/ d l) (/ d h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (D <= 5.5e-10) {
		tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
	} else {
		tmp = (1.0 + (-0.5 * ((h * pow((D * ((M * 0.5) / d)), 2.0)) / l))) * sqrt(((d / l) * (d / 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 (d_1 <= 5.5d-10) then
        tmp = sqrt((d / l)) * (1.0d0 / sqrt((h / d)))
    else
        tmp = (1.0d0 + ((-0.5d0) * ((h * ((d_1 * ((m * 0.5d0) / d)) ** 2.0d0)) / l))) * sqrt(((d / l) * (d / h)))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (D <= 5.5e-10) {
		tmp = Math.sqrt((d / l)) * (1.0 / Math.sqrt((h / d)));
	} else {
		tmp = (1.0 + (-0.5 * ((h * Math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * Math.sqrt(((d / l) * (d / h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if D <= 5.5e-10:
		tmp = math.sqrt((d / l)) * (1.0 / math.sqrt((h / d)))
	else:
		tmp = (1.0 + (-0.5 * ((h * math.pow((D * ((M * 0.5) / d)), 2.0)) / l))) * math.sqrt(((d / l) * (d / h)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (D <= 5.5e-10)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(1.0 / sqrt(Float64(h / d))));
	else
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(D * Float64(Float64(M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (D <= 5.5e-10)
		tmp = sqrt((d / l)) * (1.0 / sqrt((h / d)));
	else
		tmp = (1.0 + (-0.5 * ((h * ((D * ((M * 0.5) / d)) ^ 2.0)) / l))) * sqrt(((d / l) * (d / h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[D, 5.5e-10], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(D * N[(N[(M * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;D \leq 5.5 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\

\mathbf{else}:\\
\;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 5.4999999999999996e-10

    1. Initial program 72.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. Simplified72.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 47.3%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. clear-num47.0%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
      2. sqrt-div47.6%

        \[\leadsto \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
      3. metadata-eval47.6%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]
    6. Applied egg-rr47.6%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right) \]

    if 5.4999999999999996e-10 < D

    1. Initial program 64.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified62.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow262.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod62.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow262.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod35.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr63.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval63.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac64.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval64.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified64.2%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Step-by-step derivation
      1. expm1-log1p-u23.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)\right)} \]
      2. expm1-udef15.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)} - 1} \]
    9. Applied egg-rr15.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def22.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)} \]
      2. expm1-log1p59.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      3. rem-log-exp56.9%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\log \left(e^{1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)} \]
      4. rem-log-exp59.7%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \color{blue}{\left(1 + -0.5 \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      5. *-commutative59.7%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)}\right) \]
    11. Simplified59.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. associate-*l/61.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\frac{h \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\right) \]
      2. *-commutative61.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\color{blue}{\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D\right)}}^{2}}{\ell}\right) \]
      3. associate-*r*60.3%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\color{blue}{\left(M \cdot \left(\frac{0.5}{d} \cdot D\right)\right)}}^{2}}{\ell}\right) \]
      4. associate-*r*61.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\color{blue}{\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D\right)}}^{2}}{\ell}\right) \]
      5. *-commutative61.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\color{blue}{\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}}^{2}}{\ell}\right) \]
      6. associate-*r/61.5%

        \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \color{blue}{\frac{M \cdot 0.5}{d}}\right)}^{2}}{\ell}\right) \]
    13. Applied egg-rr61.5%

      \[\leadsto \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + -0.5 \cdot \color{blue}{\frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 5.5 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + -0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M \cdot 0.5}{d}\right)}^{2}}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -5.2 \cdot 10^{-11}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -5.2e-11)
   (sqrt (* (/ d l) (/ d h)))
   (if (<= d -1e-309)
     (* d (pow (pow (* l h) 2.0) -0.25))
     (* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.2e-11) {
		tmp = sqrt(((d / l) * (d / h)));
	} else if (d <= -1e-309) {
		tmp = d * pow(pow((l * h), 2.0), -0.25);
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(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 (d <= (-5.2d-11)) then
        tmp = sqrt(((d / l) * (d / h)))
    else if (d <= (-1d-309)) then
        tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.2e-11) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else if (d <= -1e-309) {
		tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -5.2e-11:
		tmp = math.sqrt(((d / l) * (d / h)))
	elif d <= -1e-309:
		tmp = d * math.pow(math.pow((l * h), 2.0), -0.25)
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -5.2e-11)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	elseif (d <= -1e-309)
		tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25));
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -5.2e-11)
		tmp = sqrt(((d / l) * (d / h)));
	elseif (d <= -1e-309)
		tmp = d * (((l * h) ^ 2.0) ^ -0.25);
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.2e-11], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.2 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -5.2000000000000001e-11

    1. Initial program 85.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified88.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 70.9%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. *-rgt-identity70.9%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      2. *-commutative70.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      3. sqrt-unprod66.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
    6. Applied egg-rr66.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -5.2000000000000001e-11 < d < -1.000000000000002e-309

    1. Initial program 58.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. Simplified58.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt58.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow258.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod58.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow258.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod35.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr58.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac58.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval58.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified58.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 15.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-115.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval15.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square15.2%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt15.2%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr15.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt15.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified15.2%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 15.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified15.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. associate-/l/15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative15.2%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. inv-pow15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      4. metadata-eval15.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(-0.5 + -0.5\right)}}} \]
      5. pow-prod-up15.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      6. sqrt-unprod15.2%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. add-sqr-sqrt15.2%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
      8. sqr-pow15.2%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{-0.5}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-0.5}{2}\right)}\right)} \]
      9. pow-prod-down25.4%

        \[\leadsto d \cdot \color{blue}{{\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{\left(\frac{-0.5}{2}\right)}} \]
      10. pow225.4%

        \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{2}\right)}}^{\left(\frac{-0.5}{2}\right)} \]
      11. metadata-eval25.4%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{\color{blue}{-0.25}} \]
    15. Applied egg-rr25.4%

      \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}} \]

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod39.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr66.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac68.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified67.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-143.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval43.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt43.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr43.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt43.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified43.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. sqrt-div47.8%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      2. inv-pow47.8%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      3. sqrt-pow147.8%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      4. metadata-eval47.8%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    15. Applied egg-rr47.8%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.2 \cdot 10^{-11}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 46.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -5.4 \cdot 10^{-139}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -5.4e-139)
   (* (sqrt (/ d l)) (sqrt (/ d h)))
   (if (<= d -1e-309)
     (* d (pow (pow (* l h) 2.0) -0.25))
     (* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.4e-139) {
		tmp = sqrt((d / l)) * sqrt((d / h));
	} else if (d <= -1e-309) {
		tmp = d * pow(pow((l * h), 2.0), -0.25);
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(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 (d <= (-5.4d-139)) then
        tmp = sqrt((d / l)) * sqrt((d / h))
    else if (d <= (-1d-309)) then
        tmp = d * (((l * h) ** 2.0d0) ** (-0.25d0))
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.4e-139) {
		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
	} else if (d <= -1e-309) {
		tmp = d * Math.pow(Math.pow((l * h), 2.0), -0.25);
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -5.4e-139:
		tmp = math.sqrt((d / l)) * math.sqrt((d / h))
	elif d <= -1e-309:
		tmp = d * math.pow(math.pow((l * h), 2.0), -0.25)
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -5.4e-139)
		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
	elseif (d <= -1e-309)
		tmp = Float64(d * ((Float64(l * h) ^ 2.0) ^ -0.25));
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -5.4e-139)
		tmp = sqrt((d / l)) * sqrt((d / h));
	elseif (d <= -1e-309)
		tmp = d * (((l * h) ^ 2.0) ^ -0.25);
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.4e-139], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[Power[N[(l * h), $MachinePrecision], 2.0], $MachinePrecision], -0.25], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.4 \cdot 10^{-139}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -5.3999999999999997e-139

    1. Initial program 85.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. Simplified87.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 59.9%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]

    if -5.3999999999999997e-139 < d < -1.000000000000002e-309

    1. Initial program 43.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. Simplified43.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt43.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow243.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod43.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow243.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod19.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr43.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac43.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval43.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified43.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 17.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-117.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval17.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr17.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square17.0%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt17.0%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr17.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt17.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified17.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 17.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*17.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified17.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. associate-/l/17.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \]
      2. *-commutative17.0%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      3. inv-pow17.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      4. metadata-eval17.0%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(-0.5 + -0.5\right)}}} \]
      5. pow-prod-up17.0%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      6. sqrt-unprod17.0%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. add-sqr-sqrt17.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
      8. sqr-pow17.0%

        \[\leadsto d \cdot \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{-0.5}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-0.5}{2}\right)}\right)} \]
      9. pow-prod-down26.1%

        \[\leadsto d \cdot \color{blue}{{\left(\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)\right)}^{\left(\frac{-0.5}{2}\right)}} \]
      10. pow226.1%

        \[\leadsto d \cdot {\color{blue}{\left({\left(h \cdot \ell\right)}^{2}\right)}}^{\left(\frac{-0.5}{2}\right)} \]
      11. metadata-eval26.1%

        \[\leadsto d \cdot {\left({\left(h \cdot \ell\right)}^{2}\right)}^{\color{blue}{-0.25}} \]
    15. Applied egg-rr26.1%

      \[\leadsto d \cdot \color{blue}{{\left({\left(h \cdot \ell\right)}^{2}\right)}^{-0.25}} \]

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod39.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr66.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac68.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified67.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-143.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval43.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt43.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr43.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt43.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified43.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. sqrt-div47.8%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      2. inv-pow47.8%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      3. sqrt-pow147.8%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      4. metadata-eval47.8%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    15. Applied egg-rr47.8%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.4 \cdot 10^{-139}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left({\left(\ell \cdot h\right)}^{2}\right)}^{-0.25}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 42.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -5.5 \cdot 10^{-189}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -5.5e-189)
   (sqrt (* (/ d l) (/ d h)))
   (if (<= d -1e-309)
     (* d (pow (* l h) -0.5))
     (* d (/ (pow h -0.5) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.5e-189) {
		tmp = sqrt(((d / l) * (d / h)));
	} else if (d <= -1e-309) {
		tmp = d * pow((l * h), -0.5);
	} else {
		tmp = d * (pow(h, -0.5) / sqrt(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 (d <= (-5.5d-189)) then
        tmp = sqrt(((d / l) * (d / h)))
    else if (d <= (-1d-309)) then
        tmp = d * ((l * h) ** (-0.5d0))
    else
        tmp = d * ((h ** (-0.5d0)) / sqrt(l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.5e-189) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else if (d <= -1e-309) {
		tmp = d * Math.pow((l * h), -0.5);
	} else {
		tmp = d * (Math.pow(h, -0.5) / Math.sqrt(l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -5.5e-189:
		tmp = math.sqrt(((d / l) * (d / h)))
	elif d <= -1e-309:
		tmp = d * math.pow((l * h), -0.5)
	else:
		tmp = d * (math.pow(h, -0.5) / math.sqrt(l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -5.5e-189)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	elseif (d <= -1e-309)
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	else
		tmp = Float64(d * Float64((h ^ -0.5) / sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -5.5e-189)
		tmp = sqrt(((d / l) * (d / h)));
	elseif (d <= -1e-309)
		tmp = d * ((l * h) ^ -0.5);
	else
		tmp = d * ((h ^ -0.5) / sqrt(l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.5e-189], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1e-309], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.5 \cdot 10^{-189}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -5.4999999999999999e-189

    1. Initial program 85.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. Simplified86.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 56.6%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. *-rgt-identity56.6%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      2. *-commutative56.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      3. sqrt-unprod52.1%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
    6. Applied egg-rr52.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -5.4999999999999999e-189 < d < -1.000000000000002e-309

    1. Initial program 34.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. Simplified34.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt34.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow234.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod34.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow234.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod16.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr34.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac34.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval34.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified34.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 20.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-120.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval20.7%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr20.7%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square20.7%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt20.7%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr20.7%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt20.7%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified20.7%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]

    if -1.000000000000002e-309 < d

    1. Initial program 67.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod66.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow266.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod39.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr66.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval66.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac68.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/67.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval67.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified67.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-143.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval43.2%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square43.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt43.5%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr43.5%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt43.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified43.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*43.2%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. sqrt-div47.8%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \]
      2. inv-pow47.8%

        \[\leadsto d \cdot \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \]
      3. sqrt-pow147.8%

        \[\leadsto d \cdot \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      4. metadata-eval47.8%

        \[\leadsto d \cdot \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    15. Applied egg-rr47.8%

      \[\leadsto d \cdot \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.5 \cdot 10^{-189}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 37.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.48 \cdot 10^{-227}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{1}{\sqrt{\frac{\ell}{\frac{1}{h}}}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.48e-227)
   (sqrt (* (/ d l) (/ d h)))
   (* d (/ 1.0 (sqrt (/ l (/ 1.0 h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.48e-227) {
		tmp = sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * (1.0 / sqrt((l / (1.0 / 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.48d-227)) then
        tmp = sqrt(((d / l) * (d / h)))
    else
        tmp = d * (1.0d0 / sqrt((l / (1.0d0 / 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.48e-227) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * (1.0 / Math.sqrt((l / (1.0 / h))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.48e-227:
		tmp = math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d * (1.0 / math.sqrt((l / (1.0 / h))))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.48e-227)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	else
		tmp = Float64(d * Float64(1.0 / sqrt(Float64(l / Float64(1.0 / h)))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.48e-227)
		tmp = sqrt(((d / l) * (d / h)));
	else
		tmp = d * (1.0 / sqrt((l / (1.0 / h))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.48e-227], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(1.0 / N[Sqrt[N[(l / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.48 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt{\frac{\ell}{\frac{1}{h}}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.48e-227

    1. Initial program 69.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. Simplified71.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 47.5%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. *-rgt-identity47.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      2. *-commutative47.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      3. sqrt-unprod43.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
    6. Applied egg-rr43.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -1.48e-227 < l

    1. Initial program 70.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. Simplified69.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow269.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow269.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod41.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr69.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/70.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified70.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 45.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-145.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval45.3%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr45.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square45.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt45.6%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr45.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt45.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified45.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Taylor expanded in d around 0 45.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/r*45.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    13. Simplified45.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \]
    14. Step-by-step derivation
      1. clear-num45.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{\frac{1}{h}}}}} \]
      2. sqrt-div45.7%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{\frac{1}{h}}}}} \]
      3. metadata-eval45.7%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{\frac{1}{h}}}} \]
    15. Applied egg-rr45.7%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{\frac{1}{h}}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.48 \cdot 10^{-227}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{1}{\sqrt{\frac{\ell}{\frac{1}{h}}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 38.0% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6.3 \cdot 10^{-227}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -6.3e-227) (sqrt (* (/ d l) (/ d h))) (* d (pow (* l h) -0.5))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -6.3e-227) {
		tmp = sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * pow((l * h), -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 <= (-6.3d-227)) then
        tmp = sqrt(((d / l) * (d / h)))
    else
        tmp = d * ((l * h) ** (-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 <= -6.3e-227) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * Math.pow((l * h), -0.5);
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -6.3e-227:
		tmp = math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d * math.pow((l * h), -0.5)
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -6.3e-227)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	else
		tmp = Float64(d * (Float64(l * h) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -6.3e-227)
		tmp = sqrt(((d / l) * (d / h)));
	else
		tmp = d * ((l * h) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.3e-227], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.3 \cdot 10^{-227}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -6.2999999999999999e-227

    1. Initial program 69.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. Simplified71.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 47.5%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. *-rgt-identity47.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      2. *-commutative47.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      3. sqrt-unprod43.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
    6. Applied egg-rr43.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -6.2999999999999999e-227 < l

    1. Initial program 70.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. Simplified69.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow269.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod69.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. unpow269.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. sqrt-prod41.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. add-sqr-sqrt69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. div-inv69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. metadata-eval69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr69.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      2. /-rgt-identity69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      3. associate-/l*69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      4. metadata-eval69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. times-frac71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. associate-*r/70.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. associate-*l*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. *-lft-identity70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      9. associate-/l*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      10. associate-/r/70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      11. *-commutative70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      12. associate-/r*70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
      13. metadata-eval70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    7. Simplified70.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 45.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow-145.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
      2. metadata-eval45.3%

        \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
      3. pow-sqr45.3%

        \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
      4. rem-sqrt-square45.6%

        \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
      5. rem-square-sqrt45.6%

        \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
      6. fabs-sqr45.6%

        \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
      7. rem-square-sqrt45.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified45.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.3 \cdot 10^{-227}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 38.0% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.5 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{1}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.5e-226) (sqrt (* (/ d l) (/ d h))) (* d (/ 1.0 (sqrt (* l h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.5e-226) {
		tmp = sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * (1.0 / sqrt((l * 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.5d-226)) then
        tmp = sqrt(((d / l) * (d / h)))
    else
        tmp = d * (1.0d0 / sqrt((l * 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.5e-226) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * (1.0 / Math.sqrt((l * h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.5e-226:
		tmp = math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d * (1.0 / math.sqrt((l * h)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.5e-226)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	else
		tmp = Float64(d * Float64(1.0 / sqrt(Float64(l * h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.5e-226)
		tmp = sqrt(((d / l) * (d / h)));
	else
		tmp = d * (1.0 / sqrt((l * h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.5e-226], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[(1.0 / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-226}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{1}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.49999999999999998e-226

    1. Initial program 69.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. Simplified71.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, {\left(\frac{D}{\frac{2}{M} \cdot d}\right)}^{2} \cdot -0.5, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0 47.5%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. *-rgt-identity47.5%

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      2. *-commutative47.5%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      3. sqrt-unprod43.6%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
    6. Applied egg-rr43.6%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -1.49999999999999998e-226 < l

    1. Initial program 70.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. Simplified69.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 45.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. sqrt-div45.7%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      2. metadata-eval45.7%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
    6. Applied egg-rr45.7%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.5 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{1}{\sqrt{\ell \cdot h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 26.7% accurate, 3.1× speedup?

\[\begin{array}{l} \\ d \cdot {\left(\ell \cdot h\right)}^{-0.5} \end{array} \]
(FPCore (d h l M D) :precision binary64 (* d (pow (* l h) -0.5)))
double code(double d, double h, double l, double M, double D) {
	return d * pow((l * h), -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 * ((l * h) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.pow((l * h), -0.5);
}
def code(d, h, l, M, D):
	return d * math.pow((l * h), -0.5)
function code(d, h, l, M, D)
	return Float64(d * (Float64(l * h) ^ -0.5))
end
function tmp = code(d, h, l, M, D)
	tmp = d * ((l * h) ^ -0.5);
end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(l * h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 69.9%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Simplified70.3%

    \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. add-sqr-sqrt70.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
    2. pow270.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
    3. sqrt-prod70.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
    4. unpow270.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. sqrt-prod42.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    6. add-sqr-sqrt70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    7. div-inv70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    8. metadata-eval70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\left(M \cdot \color{blue}{0.5}\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
  5. Applied egg-rr70.4%

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
  6. Step-by-step derivation
    1. *-commutative70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    2. /-rgt-identity70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M \cdot 0.5}{1}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    3. associate-/l*70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \color{blue}{\frac{M}{\frac{1}{0.5}}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    4. metadata-eval70.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(\frac{D}{d} \cdot \frac{M}{\color{blue}{2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. times-frac70.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    6. associate-*r/71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    7. associate-*l*71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    8. *-lft-identity71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    9. associate-/l*71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot 2}{M}}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    10. associate-/r/71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    11. *-commutative71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{1}{\color{blue}{2 \cdot d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    12. associate-/r*71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
    13. metadata-eval71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\frac{\color{blue}{0.5}}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right) \]
  7. Simplified71.1%

    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
  8. Taylor expanded in d around inf 27.1%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  9. Step-by-step derivation
    1. unpow-127.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \]
    2. metadata-eval27.1%

      \[\leadsto d \cdot \sqrt{{\left(h \cdot \ell\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}} \]
    3. pow-sqr27.1%

      \[\leadsto d \cdot \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot {\left(h \cdot \ell\right)}^{-0.5}}} \]
    4. rem-sqrt-square27.3%

      \[\leadsto d \cdot \color{blue}{\left|{\left(h \cdot \ell\right)}^{-0.5}\right|} \]
    5. rem-square-sqrt27.3%

      \[\leadsto d \cdot \left|\color{blue}{\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}}\right| \]
    6. fabs-sqr27.3%

      \[\leadsto d \cdot \color{blue}{\left(\sqrt{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \sqrt{{\left(h \cdot \ell\right)}^{-0.5}}\right)} \]
    7. rem-square-sqrt27.3%

      \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
  10. Simplified27.3%

    \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
  11. Final simplification27.3%

    \[\leadsto d \cdot {\left(\ell \cdot h\right)}^{-0.5} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024096 
(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)))))