Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.4% → 80.8%
Time: 24.9s
Alternatives: 20
Speedup: 2.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 66.4% accurate, 1.0× speedup?

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

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

Alternative 1: 80.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 1.35 \cdot 10^{+208}:\\
\;\;\;\;t\_1 \cdot \left(t\_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\

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


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

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l < 1.35e208

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e208 < l

    1. Initial program 18.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 80.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+210}:\\
\;\;\;\;t\_2 \cdot \left(\left(1 + \left(h \cdot \left(t\_1 \cdot 0.25\right)\right) \cdot \frac{\frac{t\_1}{-2}}{\ell}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\

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


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

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l < 2.5999999999999999e210

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5999999999999999e210 < l

    1. Initial program 18.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 3 \cdot 10^{+211}:\\
\;\;\;\;t\_2 \cdot \left(\left(1 + \left(h \cdot \left(t\_3 \cdot 0.25\right)\right) \cdot \frac{\frac{t\_3}{-2}}{\ell}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\

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


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

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l < 3e211

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e211 < l

    1. Initial program 18.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 75.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+211}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\

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


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

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l < 1.4e211

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e211 < l

    1. Initial program 18.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8000000000000003e-279 < l

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 72.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\frac{d}{D}}{M}\\
t_1 := 1 + \frac{\frac{h}{t\_0}}{\ell} \cdot \frac{-0.125}{t\_0}\\
\mathbf{if}\;\ell \leq 5.6 \cdot 10^{-278}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot t\_1}{\sqrt{\frac{h}{d}}}\\

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000015e-278 < l

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 72.8% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999996e-276 < l

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 72.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2799999999999999e-278 < l

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 66.4% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
t_1 := \frac{\frac{d}{D}}{M}\\
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{-42}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

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

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-42 < l < 3.80000000000000033e-279

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000033e-279 < l

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 49.4% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_0 := \ell \cdot \left(\ell \cdot \ell\right)\\
\mathbf{if}\;d \leq -1.4 \cdot 10^{-23}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\
\;\;\;\;\sqrt{\frac{h}{t\_0}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\

\mathbf{elif}\;d \leq 4.3 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1}{\sqrt{\frac{t\_0}{h}} \cdot \left(8 \cdot \frac{d}{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}\right)}\\

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


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

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999e-23 < d < -4.8999999999999998e-296

    1. Initial program 57.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8999999999999998e-296 < d < 4.3e-117

    1. Initial program 35.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.3e-117 < d

    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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.4 \cdot 10^{-23}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 4.3 \cdot 10^{-117}:\\ \;\;\;\;\frac{-1}{\sqrt{\frac{\ell \cdot \left(\ell \cdot \ell\right)}{h}} \cdot \left(8 \cdot \frac{d}{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 63.2% accurate, 2.4× speedup?

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

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

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

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


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

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e-20 < d < -4.8999999999999998e-296

    1. Initial program 57.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8999999999999998e-296 < d

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.85 \cdot 10^{-19}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + -0.125 \cdot \frac{\frac{h \cdot M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -1.85e-19)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
   (if (<= d -4.9e-296)
     (* (sqrt (/ h (* l (* l l)))) (* (* D (* M (* M D))) (/ 0.125 d)))
     (*
      (/ d (sqrt (* l h)))
      (+ 1.0 (* -0.125 (/ (/ (* h M) (/ d D)) (/ l (/ M (/ d D))))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -1.85e-19) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else if (d <= -4.9e-296) {
		tmp = sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	} else {
		tmp = (d / sqrt((l * h))) * (1.0 + (-0.125 * (((h * M) / (d / D)) / (l / (M / (d / 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) :: tmp
    if (d <= (-1.85d-19)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else if (d <= (-4.9d-296)) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_1 * (m * (m * d_1))) * (0.125d0 / d))
    else
        tmp = (d / sqrt((l * h))) * (1.0d0 + ((-0.125d0) * (((h * m) / (d / d_1)) / (l / (m / (d / d_1))))))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -1.85e-19) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else if (d <= -4.9e-296) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	} else {
		tmp = (d / Math.sqrt((l * h))) * (1.0 + (-0.125 * (((h * M) / (d / D)) / (l / (M / (d / D))))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -1.85e-19:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	elif d <= -4.9e-296:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d))
	else:
		tmp = (d / math.sqrt((l * h))) * (1.0 + (-0.125 * (((h * M) / (d / D)) / (l / (M / (d / D))))))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -1.85e-19)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	elseif (d <= -4.9e-296)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(M * Float64(M * D))) * Float64(0.125 / d)));
	else
		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(-0.125 * Float64(Float64(Float64(h * M) / Float64(d / D)) / Float64(l / Float64(M / Float64(d / D)))))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -1.85e-19)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	elseif (d <= -4.9e-296)
		tmp = sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	else
		tmp = (d / sqrt((l * h))) * (1.0 + (-0.125 * (((h * M) / (d / D)) / (l / (M / (d / D))))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.85e-19], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.9e-296], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(N[(N[(h * M), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(l / N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.85 \cdot 10^{-19}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + -0.125 \cdot \frac{\frac{h \cdot M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -1.85000000000000003e-19

    1. Initial program 78.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified80.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(h \cdot \color{blue}{\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right) \cdot \color{blue}{h}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right), \color{blue}{h}\right)\right)\right)\right) \]
    6. Applied egg-rr80.9%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\left(\frac{\frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125\right) \cdot h}\right)\right) \]
    7. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6468.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    9. Simplified68.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(0 - d\right)} \]

    if -1.85000000000000003e-19 < d < -4.8999999999999998e-296

    1. Initial program 57.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified64.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    7. Simplified39.1%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(D \cdot M\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(M \cdot D\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(M \cdot D\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(D \cdot M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      5. *-lowering-*.f6444.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
    9. Applied egg-rr44.8%

      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \color{blue}{\left(\left(D \cdot M\right) \cdot M\right)}\right) \cdot \frac{0.125}{d}\right) \]

    if -4.8999999999999998e-296 < d

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Applied egg-rr75.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(\frac{\frac{h \cdot M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125 + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.85 \cdot 10^{-19}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + -0.125 \cdot \frac{\frac{h \cdot M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 48.8% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;d \leq -2.8 \cdot 10^{-23}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{-124}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(t\_0 \cdot \left(-0.125 \cdot \frac{M \cdot M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ h (* l (* l l))))))
   (if (<= d -2.8e-23)
     (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
     (if (<= d -4.9e-296)
       (* t_0 (* (* D (* M (* M D))) (/ 0.125 d)))
       (if (<= d 3.6e-124)
         (* (* D D) (* t_0 (* -0.125 (/ (* M M) d))))
         (* d (sqrt (/ (/ 1.0 l) h))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h / (l * (l * l))));
	double tmp;
	if (d <= -2.8e-23) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else if (d <= -4.9e-296) {
		tmp = t_0 * ((D * (M * (M * D))) * (0.125 / d));
	} else if (d <= 3.6e-124) {
		tmp = (D * D) * (t_0 * (-0.125 * ((M * M) / d)));
	} else {
		tmp = d * sqrt(((1.0 / 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) :: t_0
    real(8) :: tmp
    t_0 = sqrt((h / (l * (l * l))))
    if (d <= (-2.8d-23)) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else if (d <= (-4.9d-296)) then
        tmp = t_0 * ((d_1 * (m * (m * d_1))) * (0.125d0 / d))
    else if (d <= 3.6d-124) then
        tmp = (d_1 * d_1) * (t_0 * ((-0.125d0) * ((m * m) / d)))
    else
        tmp = d * sqrt(((1.0d0 / l) / h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h / (l * (l * l))));
	double tmp;
	if (d <= -2.8e-23) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else if (d <= -4.9e-296) {
		tmp = t_0 * ((D * (M * (M * D))) * (0.125 / d));
	} else if (d <= 3.6e-124) {
		tmp = (D * D) * (t_0 * (-0.125 * ((M * M) / d)));
	} else {
		tmp = d * Math.sqrt(((1.0 / l) / h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((h / (l * (l * l))))
	tmp = 0
	if d <= -2.8e-23:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	elif d <= -4.9e-296:
		tmp = t_0 * ((D * (M * (M * D))) * (0.125 / d))
	elif d <= 3.6e-124:
		tmp = (D * D) * (t_0 * (-0.125 * ((M * M) / d)))
	else:
		tmp = d * math.sqrt(((1.0 / l) / h))
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
	tmp = 0.0
	if (d <= -2.8e-23)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	elseif (d <= -4.9e-296)
		tmp = Float64(t_0 * Float64(Float64(D * Float64(M * Float64(M * D))) * Float64(0.125 / d)));
	elseif (d <= 3.6e-124)
		tmp = Float64(Float64(D * D) * Float64(t_0 * Float64(-0.125 * Float64(Float64(M * M) / d))));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h / (l * (l * l))));
	tmp = 0.0;
	if (d <= -2.8e-23)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	elseif (d <= -4.9e-296)
		tmp = t_0 * ((D * (M * (M * D))) * (0.125 / d));
	elseif (d <= 3.6e-124)
		tmp = (D * D) * (t_0 * (-0.125 * ((M * M) / d)));
	else
		tmp = d * sqrt(((1.0 / l) / h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2.8e-23], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.9e-296], N[(t$95$0 * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.6e-124], N[(N[(D * D), $MachinePrecision] * N[(t$95$0 * N[(-0.125 * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -2.8 \cdot 10^{-23}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\

\mathbf{elif}\;d \leq 3.6 \cdot 10^{-124}:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(t\_0 \cdot \left(-0.125 \cdot \frac{M \cdot M}{d}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.7999999999999997e-23

    1. Initial program 78.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified80.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(h \cdot \color{blue}{\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right) \cdot \color{blue}{h}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right), \color{blue}{h}\right)\right)\right)\right) \]
    6. Applied egg-rr80.9%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\left(\frac{\frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125\right) \cdot h}\right)\right) \]
    7. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6468.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    9. Simplified68.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(0 - d\right)} \]

    if -2.7999999999999997e-23 < d < -4.8999999999999998e-296

    1. Initial program 57.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified64.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    7. Simplified39.1%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(D \cdot M\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(M \cdot D\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(M \cdot D\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(D \cdot M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      5. *-lowering-*.f6444.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
    9. Applied egg-rr44.8%

      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \color{blue}{\left(\left(D \cdot M\right) \cdot M\right)}\right) \cdot \frac{0.125}{d}\right) \]

    if -4.8999999999999998e-296 < d < 3.6000000000000001e-124

    1. Initial program 36.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified40.2%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(h \cdot \color{blue}{\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right) \cdot \color{blue}{h}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right), \color{blue}{h}\right)\right)\right)\right) \]
    6. Applied egg-rr38.9%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\left(\frac{\frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125\right) \cdot h}\right)\right) \]
    7. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      2. associate-/l*N/A

        \[\leadsto \left(\left({D}^{2} \cdot \frac{{M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8} \]
      3. associate-*l*N/A

        \[\leadsto \left({D}^{2} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \frac{-1}{8} \]
      4. associate-*r*N/A

        \[\leadsto {D}^{2} \cdot \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \]
      5. *-commutativeN/A

        \[\leadsto {D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)}\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}}\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{{M}^{2}}{d}\right) \cdot \frac{-1}{8}\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \frac{-1}{8}\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \frac{-1}{8}\right)}\right)\right) \]
    9. Simplified41.2%

      \[\leadsto \color{blue}{\left(D \cdot D\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot -0.125\right)\right)} \]

    if 3.6000000000000001e-124 < d

    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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified79.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6454.3%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified54.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot h}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      4. /-lowering-/.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    9. Applied egg-rr54.9%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{-23}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -4.9 \cdot 10^{-296}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{-124}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-0.125 \cdot \frac{M \cdot M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 46.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{if}\;d \leq -8.4 \cdot 10^{-19}:\\ \;\;\;\;\left(0 - d\right) \cdot t\_0\\ \mathbf{elif}\;d \leq -5.6 \cdot 10^{-291}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ (/ 1.0 h) l))))
   (if (<= d -8.4e-19)
     (* (- 0.0 d) t_0)
     (if (<= d -5.6e-291)
       (* (sqrt (/ h (* l (* l l)))) (* (* D (* M (* M D))) (/ 0.125 d)))
       (* d t_0)))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt(((1.0 / h) / l));
	double tmp;
	if (d <= -8.4e-19) {
		tmp = (0.0 - d) * t_0;
	} else if (d <= -5.6e-291) {
		tmp = sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	} else {
		tmp = d * 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(((1.0d0 / h) / l))
    if (d <= (-8.4d-19)) then
        tmp = (0.0d0 - d) * t_0
    else if (d <= (-5.6d-291)) then
        tmp = sqrt((h / (l * (l * l)))) * ((d_1 * (m * (m * d_1))) * (0.125d0 / d))
    else
        tmp = d * 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(((1.0 / h) / l));
	double tmp;
	if (d <= -8.4e-19) {
		tmp = (0.0 - d) * t_0;
	} else if (d <= -5.6e-291) {
		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	} else {
		tmp = d * t_0;
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt(((1.0 / h) / l))
	tmp = 0
	if d <= -8.4e-19:
		tmp = (0.0 - d) * t_0
	elif d <= -5.6e-291:
		tmp = math.sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d))
	else:
		tmp = d * t_0
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(Float64(1.0 / h) / l))
	tmp = 0.0
	if (d <= -8.4e-19)
		tmp = Float64(Float64(0.0 - d) * t_0);
	elseif (d <= -5.6e-291)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(M * Float64(M * D))) * Float64(0.125 / d)));
	else
		tmp = Float64(d * t_0);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt(((1.0 / h) / l));
	tmp = 0.0;
	if (d <= -8.4e-19)
		tmp = (0.0 - d) * t_0;
	elseif (d <= -5.6e-291)
		tmp = sqrt((h / (l * (l * l)))) * ((D * (M * (M * D))) * (0.125 / d));
	else
		tmp = d * t_0;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -8.4e-19], N[(N[(0.0 - d), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, -5.6e-291], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{\frac{1}{h}}{\ell}}\\
\mathbf{if}\;d \leq -8.4 \cdot 10^{-19}:\\
\;\;\;\;\left(0 - d\right) \cdot t\_0\\

\mathbf{elif}\;d \leq -5.6 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -8.3999999999999996e-19

    1. Initial program 78.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified80.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(h \cdot \color{blue}{\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right) \cdot \color{blue}{h}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right), \color{blue}{h}\right)\right)\right)\right) \]
    6. Applied egg-rr80.9%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\left(\frac{\frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125\right) \cdot h}\right)\right) \]
    7. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6468.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    9. Simplified68.2%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(0 - d\right)} \]

    if -8.3999999999999996e-19 < d < -5.5999999999999999e-291

    1. Initial program 56.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified64.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{h}{{\ell}^{3}}}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)}\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{h}{{\ell}^{3}}\right)\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left({\ell}^{3}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \left(\ell \cdot {\ell}^{2}\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left({\ell}^{2}\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right)\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {M}^{2}}{d}\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {M}^{2}}{d}\right)\right) \]
      15. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{-1 \cdot {M}^{2}}{d}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(-1 \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right)\right) \]
      17. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2}}{d}\right)\right)\right)\right) \]
    7. Simplified38.0%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(D \cdot M\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \left(\left(M \cdot D\right) \cdot M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(M \cdot D\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(D \cdot M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
      5. *-lowering-*.f6443.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(h, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), M\right)\right), \mathsf{/.f64}\left(\frac{1}{8}, d\right)\right)\right) \]
    9. Applied egg-rr43.8%

      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \color{blue}{\left(\left(D \cdot M\right) \cdot M\right)}\right) \cdot \frac{0.125}{d}\right) \]

    if -5.5999999999999999e-291 < d

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6442.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified42.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6442.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    9. Applied egg-rr42.6%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.4 \cdot 10^{-19}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -5.6 \cdot 10^{-291}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 42.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 5.2 \cdot 10^{-156}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d 5.2e-156)
   (* (- 0.0 d) (sqrt (/ (/ 1.0 h) l)))
   (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 5.2e-156) {
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	} else {
		tmp = d * sqrt(((1.0 / 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 (d <= 5.2d-156) then
        tmp = (0.0d0 - d) * sqrt(((1.0d0 / h) / l))
    else
        tmp = d * sqrt(((1.0d0 / 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 (d <= 5.2e-156) {
		tmp = (0.0 - d) * Math.sqrt(((1.0 / h) / l));
	} else {
		tmp = d * Math.sqrt(((1.0 / l) / h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= 5.2e-156:
		tmp = (0.0 - d) * math.sqrt(((1.0 / h) / l))
	else:
		tmp = d * math.sqrt(((1.0 / l) / h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= 5.2e-156)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(Float64(1.0 / h) / l)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= 5.2e-156)
		tmp = (0.0 - d) * sqrt(((1.0 / h) / l));
	else
		tmp = d * sqrt(((1.0 / l) / h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5.2e-156], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.2 \cdot 10^{-156}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 5.2000000000000002e-156

    1. Initial program 63.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(h \cdot \color{blue}{\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)}\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right) \cdot \color{blue}{h}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right), \color{blue}{h}\right)\right)\right)\right) \]
    6. Applied egg-rr66.3%

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \color{blue}{\left(\frac{\frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{M}{\frac{d}{D}}}} \cdot -0.125\right) \cdot h}\right)\right) \]
    7. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right), \left(-1 \cdot d\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(-1 \cdot d\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      12. --lowering--.f6444.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    9. Simplified44.4%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(0 - d\right)} \]

    if 5.2000000000000002e-156 < d

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified76.0%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6451.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified51.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot h}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      4. /-lowering-/.f6452.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    9. Applied egg-rr52.0%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 5.2 \cdot 10^{-156}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 6.5 \cdot 10^{-157}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d 6.5e-157)
   (* (- 0.0 d) (sqrt (/ 1.0 (* l h))))
   (* d (sqrt (/ (/ 1.0 l) h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 6.5e-157) {
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	} else {
		tmp = d * sqrt(((1.0 / 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 (d <= 6.5d-157) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (l * h)))
    else
        tmp = d * sqrt(((1.0d0 / 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 (d <= 6.5e-157) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (l * h)));
	} else {
		tmp = d * Math.sqrt(((1.0 / l) / h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= 6.5e-157:
		tmp = (0.0 - d) * math.sqrt((1.0 / (l * h)))
	else:
		tmp = d * math.sqrt(((1.0 / l) / h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= 6.5e-157)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(l * h))));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= 6.5e-157)
		tmp = (0.0 - d) * sqrt((1.0 / (l * h)));
	else
		tmp = d * sqrt(((1.0 / l) / h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 6.5e-157], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq 6.5 \cdot 10^{-157}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 6.5000000000000002e-157

    1. Initial program 63.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.4%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \color{blue}{d}\right) \]
      3. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot d\right) \]
      4. rem-square-sqrtN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{h \cdot \ell}}\right), \color{blue}{\left(-1 \cdot d\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right), \left(\color{blue}{-1} \cdot d\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(-1 \cdot d\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(\mathsf{neg}\left(d\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \left(0 - \color{blue}{d}\right)\right) \]
      11. --lowering--.f6442.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{d}\right)\right) \]
    7. Simplified42.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(0 - d\right)} \]

    if 6.5000000000000002e-157 < d

    1. Initial program 68.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified76.0%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6451.5%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified51.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot h}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{h}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), h\right)\right)\right) \]
      4. /-lowering-/.f6452.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), h\right)\right)\right) \]
    9. Applied egg-rr52.0%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 6.5 \cdot 10^{-157}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 38.8% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7 \cdot 10^{-250}:\\ \;\;\;\;{\left(\frac{h}{d} \cdot \frac{\ell}{d}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -7e-250)
   (pow (* (/ h d) (/ l d)) -0.5)
   (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -7e-250) {
		tmp = pow(((h / d) * (l / d)), -0.5);
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-7d-250)) then
        tmp = ((h / d) * (l / d)) ** (-0.5d0)
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -7e-250) {
		tmp = Math.pow(((h / d) * (l / d)), -0.5);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -7e-250:
		tmp = math.pow(((h / d) * (l / d)), -0.5)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -7e-250)
		tmp = Float64(Float64(h / d) * Float64(l / d)) ^ -0.5;
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -7e-250)
		tmp = ((h / d) * (l / d)) ^ -0.5;
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -7e-250], N[Power[N[(N[(h / d), $MachinePrecision] * N[(l / d), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7 \cdot 10^{-250}:\\
\;\;\;\;{\left(\frac{h}{d} \cdot \frac{\ell}{d}\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -6.9999999999999998e-250

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f647.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified7.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. *-commutativeN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\ell \cdot h}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
      7. pow1/2N/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot {h}^{\color{blue}{\frac{1}{2}}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{{h}^{\frac{1}{2}}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
      10. pow1/2N/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}} \]
      11. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}} \]
      12. *-commutativeN/A

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
      13. clear-numN/A

        \[\leadsto \sqrt{\frac{1}{\frac{h}{d}}} \cdot \sqrt{\frac{\color{blue}{d}}{\ell}} \]
      14. inv-powN/A

        \[\leadsto \sqrt{{\left(\frac{h}{d}\right)}^{-1}} \cdot \sqrt{\frac{\color{blue}{d}}{\ell}} \]
      15. sqrt-pow1N/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\left(\frac{-1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{d}{\ell}}} \]
      16. metadata-evalN/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\frac{-1}{2}} \cdot \sqrt{\frac{d}{\color{blue}{\ell}}} \]
      17. clear-numN/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\frac{-1}{2}} \cdot \sqrt{\frac{1}{\frac{\ell}{d}}} \]
      18. inv-powN/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\frac{-1}{2}} \cdot \sqrt{{\left(\frac{\ell}{d}\right)}^{-1}} \]
      19. sqrt-pow1N/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\frac{-1}{2}} \cdot {\left(\frac{\ell}{d}\right)}^{\color{blue}{\left(\frac{-1}{2}\right)}} \]
      20. metadata-evalN/A

        \[\leadsto {\left(\frac{h}{d}\right)}^{\frac{-1}{2}} \cdot {\left(\frac{\ell}{d}\right)}^{\frac{-1}{2}} \]
      21. pow-prod-downN/A

        \[\leadsto {\left(\frac{h}{d} \cdot \frac{\ell}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{pow.f64}\left(\left(\frac{h}{d} \cdot \frac{\ell}{d}\right), \color{blue}{\frac{-1}{2}}\right) \]
    9. Applied egg-rr34.4%

      \[\leadsto \color{blue}{{\left(\frac{h}{d} \cdot \frac{\ell}{d}\right)}^{-0.5}} \]

    if -6.9999999999999998e-250 < l

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6442.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified42.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6442.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    9. Applied egg-rr42.6%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 38.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.32 \cdot 10^{-250}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.32e-250)
   (sqrt (* (/ d l) (/ d h)))
   (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.32e-250) {
		tmp = sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * sqrt(((1.0 / h) / l));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-1.32d-250)) then
        tmp = sqrt(((d / l) * (d / h)))
    else
        tmp = d * sqrt(((1.0d0 / h) / l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.32e-250) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.32e-250:
		tmp = math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.32e-250)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -1.32e-250)
		tmp = sqrt(((d / l) * (d / h)));
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.32e-250], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.32 \cdot 10^{-250}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.32e-250

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f647.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified7.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. *-commutativeN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\ell \cdot h}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
      7. pow1/2N/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot {h}^{\color{blue}{\frac{1}{2}}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{{h}^{\frac{1}{2}}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
      10. pow1/2N/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}} \]
      11. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}} \]
      12. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{d}{h}\right)\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{d}{h}\right)\right)\right) \]
      16. /-lowering-/.f6433.7%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(d, h\right)\right)\right) \]
    9. Applied egg-rr33.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -1.32e-250 < l

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6442.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified42.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{h}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{h}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6442.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, h\right), \ell\right)\right)\right) \]
    9. Applied egg-rr42.6%

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 38.4% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-251}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -6.5e-251) (sqrt (* (/ d l) (/ d h))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -6.5e-251) {
		tmp = sqrt(((d / l) * (d / h)));
	} else {
		tmp = d / 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 <= (-6.5d-251)) then
        tmp = sqrt(((d / l) * (d / h)))
    else
        tmp = d / 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 <= -6.5e-251) {
		tmp = Math.sqrt(((d / l) * (d / h)));
	} else {
		tmp = d / Math.sqrt((l * h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -6.5e-251:
		tmp = math.sqrt(((d / l) * (d / h)))
	else:
		tmp = d / math.sqrt((l * h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -6.5e-251)
		tmp = sqrt(Float64(Float64(d / l) * Float64(d / h)));
	else
		tmp = Float64(d / sqrt(Float64(l * h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -6.5e-251)
		tmp = sqrt(((d / l) * (d / h)));
	else
		tmp = d / sqrt((l * h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.5e-251], N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-251}:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -6.5000000000000002e-251

    1. Initial program 69.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f647.0%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified7.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. *-commutativeN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\ell \cdot h}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      6. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
      7. pow1/2N/A

        \[\leadsto \frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot {h}^{\color{blue}{\frac{1}{2}}}} \]
      8. frac-timesN/A

        \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{{h}^{\frac{1}{2}}}} \]
      9. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
      10. pow1/2N/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}} \]
      11. sqrt-divN/A

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}} \]
      12. sqrt-unprodN/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{\ell}\right), \left(\frac{d}{h}\right)\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \left(\frac{d}{h}\right)\right)\right) \]
      16. /-lowering-/.f6433.7%

        \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \ell\right), \mathsf{/.f64}\left(d, h\right)\right)\right) \]
    9. Applied egg-rr33.7%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]

    if -6.5000000000000002e-251 < l

    1. Initial program 61.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. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. associate-*l*N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      10. unpow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    3. Simplified67.9%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
      4. *-lowering-*.f6442.2%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
    7. Simplified42.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. metadata-evalN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      3. *-commutativeN/A

        \[\leadsto d \cdot \frac{1}{\sqrt{\ell \cdot h}} \]
      4. div-invN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(\ell \cdot h\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{1}{2}\right)\right) \]
      10. *-lowering-*.f6442.5%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \frac{1}{2}\right)\right) \]
    9. Applied egg-rr42.5%

      \[\leadsto \color{blue}{\frac{d}{{\left(\ell \cdot h\right)}^{0.5}}} \]
    10. Step-by-step derivation
      1. unpow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
      3. *-lowering-*.f6442.5%

        \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right) \]
    11. Applied egg-rr42.5%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 26.4% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
	return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D):
	return d / math.sqrt((l * h))
function code(d, h, l, M, D)
	return Float64(d / sqrt(Float64(l * h)))
end
function tmp = code(d, h, l, M, D)
	tmp = d / sqrt((l * h));
end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Derivation
  1. Initial program 65.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. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. associate-*l*N/A

      \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}\right), \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    5. unpow1/2N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{\ell}}\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{\ell}\right)\right), \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right), \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left({\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    10. unpow1/2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\frac{d}{h}}\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    11. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{d}{h}\right)\right), \left(\color{blue}{1} - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
    14. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(d, h\right)\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)\right)\right) \]
  3. Simplified70.7%

    \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \left(h \cdot \left(\frac{M \cdot D}{d} \cdot 0.25\right)\right) \cdot \frac{\frac{\frac{M \cdot D}{d}}{-2}}{\ell}\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(\sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\frac{1}{h \cdot \ell}\right)\right)\right) \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \left(h \cdot \ell\right)\right)\right)\right) \]
    4. *-lowering-*.f6425.4%

      \[\leadsto \mathsf{*.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(h, \ell\right)\right)\right)\right) \]
  7. Simplified25.4%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  8. Step-by-step derivation
    1. sqrt-divN/A

      \[\leadsto d \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    2. metadata-evalN/A

      \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    3. *-commutativeN/A

      \[\leadsto d \cdot \frac{1}{\sqrt{\ell \cdot h}} \]
    4. div-invN/A

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\sqrt{\ell \cdot h}\right)}\right) \]
    6. pow1/2N/A

      \[\leadsto \mathsf{/.f64}\left(d, \left({\left(\ell \cdot h\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(d, \left({\left(h \cdot \ell\right)}^{\frac{1}{2}}\right)\right) \]
    8. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(h \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\left(\ell \cdot h\right), \frac{1}{2}\right)\right) \]
    10. *-lowering-*.f6425.6%

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\ell, h\right), \frac{1}{2}\right)\right) \]
  9. Applied egg-rr25.6%

    \[\leadsto \color{blue}{\frac{d}{{\left(\ell \cdot h\right)}^{0.5}}} \]
  10. Step-by-step derivation
    1. unpow1/2N/A

      \[\leadsto \mathsf{/.f64}\left(d, \left(\sqrt{\ell \cdot h}\right)\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\left(\ell \cdot h\right)\right)\right) \]
    3. *-lowering-*.f6425.6%

      \[\leadsto \mathsf{/.f64}\left(d, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, h\right)\right)\right) \]
  11. Applied egg-rr25.6%

    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024192 
(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)))))