Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.5% → 74.7%
Time: 10.0s
Alternatives: 24
Speedup: 1.7×

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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 alternatives:

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

Initial Program: 66.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    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: 74.7% accurate, 1.3× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := M\_m \cdot \frac{D\_m}{d + d}\\ t_2 := \left(t\_1 \cdot t\_1\right) \cdot 0.5\\ t_3 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{t\_2 \cdot h}{\ell}\right)\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;d \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-295}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-271}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\left(\left(h \cdot h\right) \cdot h\right) \cdot \ell}}, d, \left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot \sqrt{\frac{1}{\left(\left(\ell \cdot \ell\right) \cdot \ell\right) \cdot h}}\right) \cdot h\\ \mathbf{else}:\\ \;\;\;\;\left(1 - t\_2 \cdot \frac{h}{\ell}\right) \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ d l)))
        (t_1 (* M_m (/ D_m (+ d d))))
        (t_2 (* (* t_1 t_1) 0.5))
        (t_3 (* (* d (- (sqrt (/ 1.0 (* l h))))) (- 1.0 (/ (* t_2 h) l)))))
   (if (<= d -2.3e+69)
     t_3
     (if (<= d -1.45e-155)
       (*
        (* t_0 (sqrt (/ d h)))
        (- 1.0 (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l)))
       (if (<= d -2.6e-295)
         t_3
         (if (<= d 8e-271)
           (*
            (fma
             (sqrt (/ 1.0 (* (* (* h h) h) l)))
             d
             (*
              (* -0.125 (* (* D_m D_m) (/ (* M_m M_m) d)))
              (sqrt (/ 1.0 (* (* (* l l) l) h)))))
            h)
           (* (- 1.0 (* t_2 (/ h l))) (* t_0 (/ (sqrt d) (sqrt h))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((d / l));
	double t_1 = M_m * (D_m / (d + d));
	double t_2 = (t_1 * t_1) * 0.5;
	double t_3 = (d * -sqrt((1.0 / (l * h)))) * (1.0 - ((t_2 * h) / l));
	double tmp;
	if (d <= -2.3e+69) {
		tmp = t_3;
	} else if (d <= -1.45e-155) {
		tmp = (t_0 * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= -2.6e-295) {
		tmp = t_3;
	} else if (d <= 8e-271) {
		tmp = fma(sqrt((1.0 / (((h * h) * h) * l))), d, ((-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * sqrt((1.0 / (((l * l) * l) * h))))) * h;
	} else {
		tmp = (1.0 - (t_2 * (h / l))) * (t_0 * (sqrt(d) / sqrt(h)));
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(d / l))
	t_1 = Float64(M_m * Float64(D_m / Float64(d + d)))
	t_2 = Float64(Float64(t_1 * t_1) * 0.5)
	t_3 = Float64(Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))) * Float64(1.0 - Float64(Float64(t_2 * h) / l)))
	tmp = 0.0
	if (d <= -2.3e+69)
		tmp = t_3;
	elseif (d <= -1.45e-155)
		tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)));
	elseif (d <= -2.6e-295)
		tmp = t_3;
	elseif (d <= 8e-271)
		tmp = Float64(fma(sqrt(Float64(1.0 / Float64(Float64(Float64(h * h) * h) * l))), d, Float64(Float64(-0.125 * Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / d))) * sqrt(Float64(1.0 / Float64(Float64(Float64(l * l) * l) * h))))) * h);
	else
		tmp = Float64(Float64(1.0 - Float64(t_2 * Float64(h / l))) * Float64(t_0 * Float64(sqrt(d) / sqrt(h))));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M$95$m * N[(D$95$m / N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$3 = N[(N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(1.0 - N[(N[(t$95$2 * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.3e+69], t$95$3, If[LessEqual[d, -1.45e-155], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.6e-295], t$95$3, If[LessEqual[d, 8e-271], N[(N[(N[Sqrt[N[(1.0 / N[(N[(N[(h * h), $MachinePrecision] * h), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d + N[(N[(-0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision], N[(N[(1.0 - N[(t$95$2 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M\_m \cdot \frac{D\_m}{d + d}\\
t_2 := \left(t\_1 \cdot t\_1\right) \cdot 0.5\\
t_3 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{t\_2 \cdot h}{\ell}\right)\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;d \leq -1.45 \cdot 10^{-155}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\

\mathbf{elif}\;d \leq -2.6 \cdot 10^{-295}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;d \leq 8 \cdot 10^{-271}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\left(\left(h \cdot h\right) \cdot h\right) \cdot \ell}}, d, \left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot \sqrt{\frac{1}{\left(\left(\ell \cdot \ell\right) \cdot \ell\right) \cdot h}}\right) \cdot h\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.30000000000000017e69 or -1.45000000000000005e-155 < d < -2.59999999999999985e-295

    1. Initial program 63.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      6. sqrt-pow2N/A

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

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

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

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

        \[\leadsto \left(d \cdot \color{blue}{\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      11. mul-1-negN/A

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lift-*.f6475.6

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites75.6%

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

    if -2.30000000000000017e69 < d < -1.45000000000000005e-155

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
      12. lower-*.f6470.2

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites70.2%

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

    if -2.59999999999999985e-295 < d < 7.9999999999999997e-271

    1. Initial program 63.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. Taylor expanded in h around inf

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

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

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

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

    if 7.9999999999999997e-271 < d

    1. Initial program 32.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 74.1% accurate, 1.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{D\_m}{d + d}\\ t_1 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(t\_0 \cdot t\_0\right) \cdot 0.5\right) \cdot h}{\ell}\right)\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ \mathbf{elif}\;d \leq -9.6 \cdot 10^{-306}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (/ D_m (+ d d))))
        (t_1
         (*
          (* d (- (sqrt (/ 1.0 (* l h)))))
          (- 1.0 (/ (* (* (* t_0 t_0) 0.5) h) l)))))
   (if (<= d -2.3e+69)
     t_1
     (if (<= d -1.45e-155)
       (*
        (* (sqrt (/ d l)) (sqrt (/ d h)))
        (- 1.0 (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l)))
       (if (<= d -9.6e-306)
         t_1
         (*
          (* (/ (sqrt d) (sqrt h)) (pow (/ d l) (/ 1.0 2.0)))
          (-
           1.0
           (*
            (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
            (/ h l)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = (d * -sqrt((1.0 / (l * h)))) * (1.0 - ((((t_0 * t_0) * 0.5) * h) / l));
	double tmp;
	if (d <= -2.3e+69) {
		tmp = t_1;
	} else if (d <= -1.45e-155) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= -9.6e-306) {
		tmp = t_1;
	} else {
		tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m_m, d_m)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = m_m * (d_m / (d + d))
    t_1 = (d * -sqrt((1.0d0 / (l * h)))) * (1.0d0 - ((((t_0 * t_0) * 0.5d0) * h) / l))
    if (d <= (-2.3d+69)) then
        tmp = t_1
    else if (d <= (-1.45d-155)) then
        tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((((((m_m * m_m) * d_m) * d_m) / (d * d)) * 0.125d0) * h) / l))
    else if (d <= (-9.6d-306)) then
        tmp = t_1
    else
        tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = (d * -Math.sqrt((1.0 / (l * h)))) * (1.0 - ((((t_0 * t_0) * 0.5) * h) / l));
	double tmp;
	if (d <= -2.3e+69) {
		tmp = t_1;
	} else if (d <= -1.45e-155) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= -9.6e-306) {
		tmp = t_1;
	} else {
		tmp = ((Math.sqrt(d) / Math.sqrt(h)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = M_m * (D_m / (d + d))
	t_1 = (d * -math.sqrt((1.0 / (l * h)))) * (1.0 - ((((t_0 * t_0) * 0.5) * h) / l))
	tmp = 0
	if d <= -2.3e+69:
		tmp = t_1
	elif d <= -1.45e-155:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l))
	elif d <= -9.6e-306:
		tmp = t_1
	else:
		tmp = ((math.sqrt(d) / math.sqrt(h)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(M_m * Float64(D_m / Float64(d + d)))
	t_1 = Float64(Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))) * Float64(1.0 - Float64(Float64(Float64(Float64(t_0 * t_0) * 0.5) * h) / l)))
	tmp = 0.0
	if (d <= -2.3e+69)
		tmp = t_1;
	elseif (d <= -1.45e-155)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)));
	elseif (d <= -9.6e-306)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = M_m * (D_m / (d + d));
	t_1 = (d * -sqrt((1.0 / (l * h)))) * (1.0 - ((((t_0 * t_0) * 0.5) * h) / l));
	tmp = 0.0;
	if (d <= -2.3e+69)
		tmp = t_1;
	elseif (d <= -1.45e-155)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	elseif (d <= -9.6e-306)
		tmp = t_1;
	else
		tmp = ((sqrt(d) / sqrt(h)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(M$95$m * N[(D$95$m / N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.5), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.3e+69], t$95$1, If[LessEqual[d, -1.45e-155], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -9.6e-306], t$95$1, N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $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$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d + d}\\
t_1 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(t\_0 \cdot t\_0\right) \cdot 0.5\right) \cdot h}{\ell}\right)\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;d \leq -9.6 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -2.30000000000000017e69 or -1.45000000000000005e-155 < d < -9.5999999999999998e-306

    1. Initial program 63.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      6. sqrt-pow2N/A

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

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

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

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

        \[\leadsto \left(d \cdot \color{blue}{\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      11. mul-1-negN/A

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lift-*.f6474.7

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites74.7%

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

    if -2.30000000000000017e69 < d < -1.45000000000000005e-155

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
      12. lower-*.f6470.2

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites70.2%

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

    if -9.5999999999999998e-306 < d

    1. Initial program 63.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. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 73.9% accurate, 1.5× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := M\_m \cdot \frac{D\_m}{d + d}\\ t_2 := \left(t\_1 \cdot t\_1\right) \cdot 0.5\\ t_3 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{t\_2 \cdot h}{\ell}\right)\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;d \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ \mathbf{elif}\;d \leq -9.6 \cdot 10^{-306}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\left(1 - t\_2 \cdot \frac{h}{\ell}\right) \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (/ d l)))
        (t_1 (* M_m (/ D_m (+ d d))))
        (t_2 (* (* t_1 t_1) 0.5))
        (t_3 (* (* d (- (sqrt (/ 1.0 (* l h))))) (- 1.0 (/ (* t_2 h) l)))))
   (if (<= d -2.3e+69)
     t_3
     (if (<= d -1.45e-155)
       (*
        (* t_0 (sqrt (/ d h)))
        (- 1.0 (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l)))
       (if (<= d -9.6e-306)
         t_3
         (* (- 1.0 (* t_2 (/ h l))) (* t_0 (/ (sqrt d) (sqrt h)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt((d / l));
	double t_1 = M_m * (D_m / (d + d));
	double t_2 = (t_1 * t_1) * 0.5;
	double t_3 = (d * -sqrt((1.0 / (l * h)))) * (1.0 - ((t_2 * h) / l));
	double tmp;
	if (d <= -2.3e+69) {
		tmp = t_3;
	} else if (d <= -1.45e-155) {
		tmp = (t_0 * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= -9.6e-306) {
		tmp = t_3;
	} else {
		tmp = (1.0 - (t_2 * (h / l))) * (t_0 * (sqrt(d) / sqrt(h)));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m_m, d_m)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = sqrt((d / l))
    t_1 = m_m * (d_m / (d + d))
    t_2 = (t_1 * t_1) * 0.5d0
    t_3 = (d * -sqrt((1.0d0 / (l * h)))) * (1.0d0 - ((t_2 * h) / l))
    if (d <= (-2.3d+69)) then
        tmp = t_3
    else if (d <= (-1.45d-155)) then
        tmp = (t_0 * sqrt((d / h))) * (1.0d0 - (((((((m_m * m_m) * d_m) * d_m) / (d * d)) * 0.125d0) * h) / l))
    else if (d <= (-9.6d-306)) then
        tmp = t_3
    else
        tmp = (1.0d0 - (t_2 * (h / l))) * (t_0 * (sqrt(d) / sqrt(h)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = Math.sqrt((d / l));
	double t_1 = M_m * (D_m / (d + d));
	double t_2 = (t_1 * t_1) * 0.5;
	double t_3 = (d * -Math.sqrt((1.0 / (l * h)))) * (1.0 - ((t_2 * h) / l));
	double tmp;
	if (d <= -2.3e+69) {
		tmp = t_3;
	} else if (d <= -1.45e-155) {
		tmp = (t_0 * Math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= -9.6e-306) {
		tmp = t_3;
	} else {
		tmp = (1.0 - (t_2 * (h / l))) * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = math.sqrt((d / l))
	t_1 = M_m * (D_m / (d + d))
	t_2 = (t_1 * t_1) * 0.5
	t_3 = (d * -math.sqrt((1.0 / (l * h)))) * (1.0 - ((t_2 * h) / l))
	tmp = 0
	if d <= -2.3e+69:
		tmp = t_3
	elif d <= -1.45e-155:
		tmp = (t_0 * math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l))
	elif d <= -9.6e-306:
		tmp = t_3
	else:
		tmp = (1.0 - (t_2 * (h / l))) * (t_0 * (math.sqrt(d) / math.sqrt(h)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = sqrt(Float64(d / l))
	t_1 = Float64(M_m * Float64(D_m / Float64(d + d)))
	t_2 = Float64(Float64(t_1 * t_1) * 0.5)
	t_3 = Float64(Float64(d * Float64(-sqrt(Float64(1.0 / Float64(l * h))))) * Float64(1.0 - Float64(Float64(t_2 * h) / l)))
	tmp = 0.0
	if (d <= -2.3e+69)
		tmp = t_3;
	elseif (d <= -1.45e-155)
		tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)));
	elseif (d <= -9.6e-306)
		tmp = t_3;
	else
		tmp = Float64(Float64(1.0 - Float64(t_2 * Float64(h / l))) * Float64(t_0 * Float64(sqrt(d) / sqrt(h))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = sqrt((d / l));
	t_1 = M_m * (D_m / (d + d));
	t_2 = (t_1 * t_1) * 0.5;
	t_3 = (d * -sqrt((1.0 / (l * h)))) * (1.0 - ((t_2 * h) / l));
	tmp = 0.0;
	if (d <= -2.3e+69)
		tmp = t_3;
	elseif (d <= -1.45e-155)
		tmp = (t_0 * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	elseif (d <= -9.6e-306)
		tmp = t_3;
	else
		tmp = (1.0 - (t_2 * (h / l))) * (t_0 * (sqrt(d) / sqrt(h)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M$95$m * N[(D$95$m / N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$3 = N[(N[(d * (-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(1.0 - N[(N[(t$95$2 * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.3e+69], t$95$3, If[LessEqual[d, -1.45e-155], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -9.6e-306], t$95$3, N[(N[(1.0 - N[(t$95$2 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := M\_m \cdot \frac{D\_m}{d + d}\\
t_2 := \left(t\_1 \cdot t\_1\right) \cdot 0.5\\
t_3 := \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{t\_2 \cdot h}{\ell}\right)\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{+69}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;d \leq -1.45 \cdot 10^{-155}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\

\mathbf{elif}\;d \leq -9.6 \cdot 10^{-306}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -2.30000000000000017e69 or -1.45000000000000005e-155 < d < -9.5999999999999998e-306

    1. Initial program 63.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      6. sqrt-pow2N/A

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

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

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

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

        \[\leadsto \left(d \cdot \color{blue}{\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      11. mul-1-negN/A

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lift-*.f6474.7

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites74.7%

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

    if -2.30000000000000017e69 < d < -1.45000000000000005e-155

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
      12. lower-*.f6470.2

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites70.2%

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

    if -9.5999999999999998e-306 < d

    1. Initial program 63.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. Applied rewrites62.5%

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

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

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

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

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

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

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

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

Alternative 4: 73.7% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{D\_m}{d + d}\\ t_1 := 1 - \frac{\left(\left(t\_0 \cdot t\_0\right) \cdot 0.5\right) \cdot h}{\ell}\\ \mathbf{if}\;\ell \leq -6.6 \cdot 10^{-304}:\\ \;\;\;\;\left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot t\_1\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{-194}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_1\\ \mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+179}:\\ \;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (/ D_m (+ d d))))
        (t_1 (- 1.0 (/ (* (* (* t_0 t_0) 0.5) h) l))))
   (if (<= l -6.6e-304)
     (* (* d (- (sqrt (/ 1.0 (* l h))))) t_1)
     (if (<= l 5.5e-194)
       (* (* (sqrt (/ d l)) (sqrt (/ d h))) t_1)
       (if (<= l 3.6e+179)
         (* (* (sqrt (/ 1.0 (* h l))) d) t_1)
         (/ (* 1.0 d) (* (sqrt h) (sqrt l))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = 1.0 - ((((t_0 * t_0) * 0.5) * h) / l);
	double tmp;
	if (l <= -6.6e-304) {
		tmp = (d * -sqrt((1.0 / (l * h)))) * t_1;
	} else if (l <= 5.5e-194) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * t_1;
	} else if (l <= 3.6e+179) {
		tmp = (sqrt((1.0 / (h * l))) * d) * t_1;
	} else {
		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;\ell \leq 5.5 \cdot 10^{-194}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_1\\

\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+179}:\\
\;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot t\_1\\

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


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

    1. Initial program 66.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      6. sqrt-pow2N/A

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

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

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

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

        \[\leadsto \left(d \cdot \color{blue}{\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      11. mul-1-negN/A

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lift-*.f6473.4

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites73.4%

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

    if -6.60000000000000025e-304 < l < 5.49999999999999941e-194

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

    if 5.49999999999999941e-194 < l < 3.5999999999999998e179

    1. Initial program 70.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      5. lower-*.f6477.7

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites77.7%

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

    if 3.5999999999999998e179 < l

    1. Initial program 48.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. Taylor expanded in d around inf

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      4. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      6. lower-*.f6447.3

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
    4. Applied rewrites47.3%

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

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

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      3. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. sqrt-divN/A

        \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
      5. *-commutativeN/A

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

        \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      9. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      10. lift-*.f6447.3

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
    6. Applied rewrites47.3%

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

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

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      4. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      5. associate-*l/N/A

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      7. lower-/.f64N/A

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

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      10. lower-*.f6447.4

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites47.4%

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      3. sqrt-prodN/A

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

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\color{blue}{\ell}}} \]
      6. lower-sqrt.f6465.0

        \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}} \]
    10. Applied rewrites65.0%

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

Alternative 5: 73.2% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{D\_m}{d + d}\\ t_1 := 1 - \frac{\left(\left(t\_0 \cdot t\_0\right) \cdot 0.5\right) \cdot h}{\ell}\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot t\_1\\ \mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+179}:\\ \;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (/ D_m (+ d d))))
        (t_1 (- 1.0 (/ (* (* (* t_0 t_0) 0.5) h) l))))
   (if (<= l -5e-310)
     (* (* d (- (sqrt (/ 1.0 (* l h))))) t_1)
     (if (<= l 3.6e+179)
       (* (* (sqrt (/ 1.0 (* h l))) d) t_1)
       (/ (* 1.0 d) (* (sqrt h) (sqrt l)))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = 1.0 - ((((t_0 * t_0) * 0.5) * h) / l);
	double tmp;
	if (l <= -5e-310) {
		tmp = (d * -sqrt((1.0 / (l * h)))) * t_1;
	} else if (l <= 3.6e+179) {
		tmp = (sqrt((1.0 / (h * l))) * d) * t_1;
	} else {
		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+179}:\\
\;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot t\_1\\

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


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

    1. Initial program 66.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      6. sqrt-pow2N/A

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

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

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

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

        \[\leadsto \left(d \cdot \color{blue}{\left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      11. mul-1-negN/A

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      15. lift-/.f64N/A

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lift-*.f6473.4

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites73.4%

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

    if -4.999999999999985e-310 < l < 3.5999999999999998e179

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      5. lower-*.f6479.2

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

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

    if 3.5999999999999998e179 < l

    1. Initial program 48.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. Taylor expanded in d around inf

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      4. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      6. lower-*.f6447.3

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
    4. Applied rewrites47.3%

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

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

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      3. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. sqrt-divN/A

        \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
      5. *-commutativeN/A

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

        \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      9. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      10. lift-*.f6447.3

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
    6. Applied rewrites47.3%

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

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

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      3. lift-*.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      4. lift-sqrt.f64N/A

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      5. associate-*l/N/A

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      7. lower-/.f64N/A

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

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      10. lower-*.f6447.4

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites47.4%

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
      3. sqrt-prodN/A

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

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

        \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\color{blue}{\ell}}} \]
      6. lower-sqrt.f6465.0

        \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}} \]
    10. Applied rewrites65.0%

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

Alternative 6: 68.4% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{D\_m}{d + d}\\ t_1 := M\_m \cdot t\_0\\ \mathbf{if}\;d \leq -1.7 \cdot 10^{+164}:\\ \;\;\;\;\left(1 - \left(0.5 \cdot \left(M\_m \cdot \left(t\_0 \cdot \left(t\_0 \cdot M\_m\right)\right)\right)\right) \cdot \frac{h}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ \mathbf{elif}\;d \leq 1.45 \cdot 10^{-295}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(t\_1 \cdot t\_1\right) \cdot 0.5\right) \cdot h}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (/ D_m (+ d d))) (t_1 (* M_m t_0)))
   (if (<= d -1.7e+164)
     (*
      (- 1.0 (* (* 0.5 (* M_m (* t_0 (* t_0 M_m)))) (/ h l)))
      (sqrt (* (/ d l) (/ d h))))
     (if (<= d -6e-161)
       (*
        (* (sqrt (/ d l)) (sqrt (/ d h)))
        (- 1.0 (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l)))
       (if (<= d 1.45e-295)
         (*
          (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d))))
          (sqrt (/ h (* (* l l) l))))
         (*
          (* (sqrt (/ 1.0 (* h l))) d)
          (- 1.0 (/ (* (* (* t_1 t_1) 0.5) h) l))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = D_m / (d + d);
	double t_1 = M_m * t_0;
	double tmp;
	if (d <= -1.7e+164) {
		tmp = (1.0 - ((0.5 * (M_m * (t_0 * (t_0 * M_m)))) * (h / l))) * sqrt(((d / l) * (d / h)));
	} else if (d <= -6e-161) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= 1.45e-295) {
		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * sqrt((h / ((l * l) * l)));
	} else {
		tmp = (sqrt((1.0 / (h * l))) * d) * (1.0 - ((((t_1 * t_1) * 0.5) * h) / l));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m_m, d_m)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = d_m / (d + d)
    t_1 = m_m * t_0
    if (d <= (-1.7d+164)) then
        tmp = (1.0d0 - ((0.5d0 * (m_m * (t_0 * (t_0 * m_m)))) * (h / l))) * sqrt(((d / l) * (d / h)))
    else if (d <= (-6d-161)) then
        tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((((((m_m * m_m) * d_m) * d_m) / (d * d)) * 0.125d0) * h) / l))
    else if (d <= 1.45d-295) then
        tmp = (0.125d0 * ((d_m * d_m) * (m_m * (m_m / d)))) * sqrt((h / ((l * l) * l)))
    else
        tmp = (sqrt((1.0d0 / (h * l))) * d) * (1.0d0 - ((((t_1 * t_1) * 0.5d0) * h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = D_m / (d + d);
	double t_1 = M_m * t_0;
	double tmp;
	if (d <= -1.7e+164) {
		tmp = (1.0 - ((0.5 * (M_m * (t_0 * (t_0 * M_m)))) * (h / l))) * Math.sqrt(((d / l) * (d / h)));
	} else if (d <= -6e-161) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= 1.45e-295) {
		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * Math.sqrt((h / ((l * l) * l)));
	} else {
		tmp = (Math.sqrt((1.0 / (h * l))) * d) * (1.0 - ((((t_1 * t_1) * 0.5) * h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = D_m / (d + d)
	t_1 = M_m * t_0
	tmp = 0
	if d <= -1.7e+164:
		tmp = (1.0 - ((0.5 * (M_m * (t_0 * (t_0 * M_m)))) * (h / l))) * math.sqrt(((d / l) * (d / h)))
	elif d <= -6e-161:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l))
	elif d <= 1.45e-295:
		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * math.sqrt((h / ((l * l) * l)))
	else:
		tmp = (math.sqrt((1.0 / (h * l))) * d) * (1.0 - ((((t_1 * t_1) * 0.5) * h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(D_m / Float64(d + d))
	t_1 = Float64(M_m * t_0)
	tmp = 0.0
	if (d <= -1.7e+164)
		tmp = Float64(Float64(1.0 - Float64(Float64(0.5 * Float64(M_m * Float64(t_0 * Float64(t_0 * M_m)))) * Float64(h / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	elseif (d <= -6e-161)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)));
	elseif (d <= 1.45e-295)
		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * sqrt(Float64(h / Float64(Float64(l * l) * l))));
	else
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(h * l))) * d) * Float64(1.0 - Float64(Float64(Float64(Float64(t_1 * t_1) * 0.5) * h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = D_m / (d + d);
	t_1 = M_m * t_0;
	tmp = 0.0;
	if (d <= -1.7e+164)
		tmp = (1.0 - ((0.5 * (M_m * (t_0 * (t_0 * M_m)))) * (h / l))) * sqrt(((d / l) * (d / h)));
	elseif (d <= -6e-161)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	elseif (d <= 1.45e-295)
		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * sqrt((h / ((l * l) * l)));
	else
		tmp = (sqrt((1.0 / (h * l))) * d) * (1.0 - ((((t_1 * t_1) * 0.5) * h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(D$95$m / N[(d + d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M$95$m * t$95$0), $MachinePrecision]}, If[LessEqual[d, -1.7e+164], N[(N[(1.0 - N[(N[(0.5 * N[(M$95$m * N[(t$95$0 * N[(t$95$0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6e-161], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e-295], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.5), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \frac{D\_m}{d + d}\\
t_1 := M\_m \cdot t\_0\\
\mathbf{if}\;d \leq -1.7 \cdot 10^{+164}:\\
\;\;\;\;\left(1 - \left(0.5 \cdot \left(M\_m \cdot \left(t\_0 \cdot \left(t\_0 \cdot M\_m\right)\right)\right)\right) \cdot \frac{h}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.7000000000000001e164

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

    if -1.7000000000000001e164 < d < -5.99999999999999977e-161

    1. Initial program 74.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
      12. lower-*.f6470.3

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites70.3%

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

    if -5.99999999999999977e-161 < d < 1.45000000000000008e-295

    1. Initial program 43.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. 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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
      9. pow2N/A

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
      11. pow3N/A

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      14. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      15. lift-sqrt.f6440.6

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
    7. Applied rewrites40.6%

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      5. lower-/.f6448.8

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
    9. Applied rewrites48.8%

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

    if 1.45000000000000008e-295 < d

    1. Initial program 67.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      17. lift-/.f6467.3

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      5. lower-*.f6473.0

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites73.0%

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

Alternative 7: 67.9% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{D\_m}{d + d}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ \mathbf{elif}\;d \leq 1.45 \cdot 10^{-295}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(t\_0 \cdot t\_0\right) \cdot 0.5\right) \cdot h}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (/ D_m (+ d d)))))
   (if (<= d -1.2e+154)
     (* (- (sqrt (/ 1.0 (* l h)))) d)
     (if (<= d -6e-161)
       (*
        (* (sqrt (/ d l)) (sqrt (/ d h)))
        (- 1.0 (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l)))
       (if (<= d 1.45e-295)
         (*
          (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d))))
          (sqrt (/ h (* (* l l) l))))
         (*
          (* (sqrt (/ 1.0 (* h l))) d)
          (- 1.0 (/ (* (* (* t_0 t_0) 0.5) h) l))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double tmp;
	if (d <= -1.2e+154) {
		tmp = -sqrt((1.0 / (l * h))) * d;
	} else if (d <= -6e-161) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
	} else if (d <= 1.45e-295) {
		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * sqrt((h / ((l * l) * l)));
	} else {
		tmp = (sqrt((1.0 / (h * l))) * d) * (1.0 - ((((t_0 * t_0) * 0.5) * h) / l));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.20000000000000007e154

    1. Initial program 72.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. Taylor expanded in d around inf

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      4. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      6. lower-*.f647.1

        \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
    4. Applied rewrites7.1%

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

      \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
    6. Step-by-step derivation
      1. sqrt-pow2N/A

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
      3. metadata-evalN/A

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

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

        \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
      6. lower-neg.f64N/A

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

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

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

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      10. lift-*.f6467.6

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
    7. Applied rewrites67.6%

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

    if -1.20000000000000007e154 < d < -5.99999999999999977e-161

    1. Initial program 75.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      17. lift-/.f6476.3

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
      12. lower-*.f6470.8

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites70.8%

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

    if -5.99999999999999977e-161 < d < 1.45000000000000008e-295

    1. Initial program 43.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. 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)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
      9. pow2N/A

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
      11. pow3N/A

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      14. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      15. lift-sqrt.f6440.6

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
    7. Applied rewrites40.6%

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      2. lift-/.f64N/A

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

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

        \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      5. lower-/.f6448.8

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
    9. Applied rewrites48.8%

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

    if 1.45000000000000008e-295 < d

    1. Initial program 67.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      17. lift-/.f6467.3

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      5. lower-*.f6473.0

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
    8. Applied rewrites73.0%

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

Alternative 8: 65.4% accurate, 0.4× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{D\_m}{d + d}\\ t_1 := \left(t\_0 \cdot t\_0\right) \cdot 0.5\\ t_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\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-209}:\\ \;\;\;\;\left(1 - t\_1 \cdot \frac{h}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{t\_1 \cdot h}{\ell}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0 (* M_m (/ D_m (+ d d))))
        (t_1 (* (* t_0 t_0) 0.5))
        (t_2
         (*
          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
          (-
           1.0
           (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))))
   (if (<= t_2 -1e-209)
     (* (- 1.0 (* t_1 (/ h l))) (sqrt (* (/ d l) (/ d h))))
     (if (<= t_2 5e+298)
       (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
       (* (* (sqrt (/ 1.0 (* h l))) d) (- 1.0 (/ (* t_1 h) l)))))))
M_m = fabs(M);
D_m = fabs(D);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = (t_0 * t_0) * 0.5;
	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
	double tmp;
	if (t_2 <= -1e-209) {
		tmp = (1.0 - (t_1 * (h / l))) * sqrt(((d / l) * (d / h)));
	} else if (t_2 <= 5e+298) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
	} else {
		tmp = (sqrt((1.0 / (h * l))) * d) * (1.0 - ((t_1 * h) / l));
	}
	return tmp;
}
M_m =     private
D_m =     private
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m_m, d_m)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = m_m * (d_m / (d + d))
    t_1 = (t_0 * t_0) * 0.5d0
    t_2 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
    if (t_2 <= (-1d-209)) then
        tmp = (1.0d0 - (t_1 * (h / l))) * sqrt(((d / l) * (d / h)))
    else if (t_2 <= 5d+298) then
        tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
    else
        tmp = (sqrt((1.0d0 / (h * l))) * d) * (1.0d0 - ((t_1 * h) / l))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = M_m * (D_m / (d + d));
	double t_1 = (t_0 * t_0) * 0.5;
	double t_2 = (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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
	double tmp;
	if (t_2 <= -1e-209) {
		tmp = (1.0 - (t_1 * (h / l))) * Math.sqrt(((d / l) * (d / h)));
	} else if (t_2 <= 5e+298) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
	} else {
		tmp = (Math.sqrt((1.0 / (h * l))) * d) * (1.0 - ((t_1 * h) / l));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = M_m * (D_m / (d + d))
	t_1 = (t_0 * t_0) * 0.5
	t_2 = (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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
	tmp = 0
	if t_2 <= -1e-209:
		tmp = (1.0 - (t_1 * (h / l))) * math.sqrt(((d / l) * (d / h)))
	elif t_2 <= 5e+298:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
	else:
		tmp = (math.sqrt((1.0 / (h * l))) * d) * (1.0 - ((t_1 * h) / l))
	return tmp
M_m = abs(M)
D_m = abs(D)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(M_m * Float64(D_m / Float64(d + d)))
	t_1 = Float64(Float64(t_0 * t_0) * 0.5)
	t_2 = 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_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	tmp = 0.0
	if (t_2 <= -1e-209)
		tmp = Float64(Float64(1.0 - Float64(t_1 * Float64(h / l))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	elseif (t_2 <= 5e+298)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
	else
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(h * l))) * d) * Float64(1.0 - Float64(Float64(t_1 * h) / l)));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = M_m * (D_m / (d + d));
	t_1 = (t_0 * t_0) * 0.5;
	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
	tmp = 0.0;
	if (t_2 <= -1e-209)
		tmp = (1.0 - (t_1 * (h / l))) * sqrt(((d / l) * (d / h)));
	elseif (t_2 <= 5e+298)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
	else
		tmp = (sqrt((1.0 / (h * l))) * d) * (1.0 - ((t_1 * h) / l));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(M$95$m * N[(D$95$m / N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$2 = 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$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-209], N[(N[(1.0 - N[(t$95$1 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+298], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] * N[(1.0 - N[(N[(t$95$1 * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := M\_m \cdot \frac{D\_m}{d + d}\\
t_1 := \left(t\_0 \cdot t\_0\right) \cdot 0.5\\
t_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\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-209}:\\
\;\;\;\;\left(1 - t\_1 \cdot \frac{h}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-209

    1. Initial program 86.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. Applied rewrites85.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 - \left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      9. lift-/.f64N/A

        \[\leadsto \left(1 - \left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      10. lift-/.f6472.8

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

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

    if -1e-209 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000003e298

    1. Initial program 87.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      16. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      17. lift-/.f6486.3

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

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

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

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

      if 5.0000000000000003e298 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

      1. Initial program 21.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6427.7

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lower-*.f6433.7

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot d\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites33.7%

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

    Alternative 9: 64.6% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\ t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\\ t_2 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{t\_1}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_3 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-t\_0\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_3\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.125 \cdot t\_1, t\_3, t\_0 \cdot \left(d \cdot d\right)\right)}{d}\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ 1.0 (* l h))))
            (t_1 (* (* (* M_m M_m) D_m) D_m))
            (t_2
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (- 1.0 (/ (* (* (/ t_1 (* d d)) 0.125) h) l))))
            (t_3 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- t_0) d)
         (if (<= d -6e-161)
           t_2
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_3)
             (if (<= d 1.5e-96)
               (/ (fma (* -0.125 t_1) t_3 (* t_0 (* d d))) d)
               (if (<= d 1.4e+154) t_2 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = sqrt((1.0 / (l * h)));
    	double t_1 = ((M_m * M_m) * D_m) * D_m;
    	double t_2 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((t_1 / (d * d)) * 0.125) * h) / l));
    	double t_3 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -t_0 * d;
    	} else if (d <= -6e-161) {
    		tmp = t_2;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_3;
    	} else if (d <= 1.5e-96) {
    		tmp = fma((-0.125 * t_1), t_3, (t_0 * (d * d))) / d;
    	} else if (d <= 1.4e+154) {
    		tmp = t_2;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = sqrt(Float64(1.0 / Float64(l * h)))
    	t_1 = Float64(Float64(Float64(M_m * M_m) * D_m) * D_m)
    	t_2 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(t_1 / Float64(d * d)) * 0.125) * h) / l)))
    	t_3 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-t_0) * d);
    	elseif (d <= -6e-161)
    		tmp = t_2;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_3);
    	elseif (d <= 1.5e-96)
    		tmp = Float64(fma(Float64(-0.125 * t_1), t_3, Float64(t_0 * Float64(d * d))) / d);
    	elseif (d <= 1.4e+154)
    		tmp = t_2;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$1 / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-t$95$0) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$2, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[d, 1.5e-96], N[(N[(N[(-0.125 * t$95$1), $MachinePrecision] * t$95$3 + N[(t$95$0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$2, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
    t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\\
    t_2 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{t\_1}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_3 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-t\_0\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_3\\
    
    \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(-0.125 \cdot t\_1, t\_3, t\_0 \cdot \left(d \cdot d\right)\right)}{d}\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

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

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

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

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

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

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

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

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

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

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

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

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

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

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

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 1.5e-96 < d < 1.4e154

      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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6477.9

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6471.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites71.9%

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

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

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

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

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

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

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

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

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

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

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

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

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

      if -4.999999999999985e-310 < d < 1.5e-96

      1. Initial program 47.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.4e154 < d

      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. Taylor expanded in d around inf

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

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

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

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6422.2

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites22.2%

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

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

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6422.1

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites22.1%

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

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6422.0

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites22.0%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 63.5% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\ t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-t\_1\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)\right), t\_2, t\_1 \cdot \left(d \cdot d\right)\right)}{d}\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l))))
            (t_1 (sqrt (/ 1.0 (* l h))))
            (t_2 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- t_1) d)
         (if (<= d -6e-161)
           t_0
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_2)
             (if (<= d 1.5e-96)
               (/
                (fma (* -0.125 (* (* M_m M_m) (* D_m D_m))) t_2 (* t_1 (* d d)))
                d)
               (if (<= d 1.4e+154) t_0 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	double t_1 = sqrt((1.0 / (l * h)));
    	double t_2 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -t_1 * d;
    	} else if (d <= -6e-161) {
    		tmp = t_0;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_2;
    	} else if (d <= 1.5e-96) {
    		tmp = fma((-0.125 * ((M_m * M_m) * (D_m * D_m))), t_2, (t_1 * (d * d))) / d;
    	} else if (d <= 1.4e+154) {
    		tmp = t_0;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)))
    	t_1 = sqrt(Float64(1.0 / Float64(l * h)))
    	t_2 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-t_1) * d);
    	elseif (d <= -6e-161)
    		tmp = t_0;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_2);
    	elseif (d <= 1.5e-96)
    		tmp = Float64(fma(Float64(-0.125 * Float64(Float64(M_m * M_m) * Float64(D_m * D_m))), t_2, Float64(t_1 * Float64(d * d))) / d);
    	elseif (d <= 1.4e+154)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-t$95$1) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$0, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[d, 1.5e-96], N[(N[(N[(-0.125 * N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2 + N[(t$95$1 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$0, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
    t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-t\_1\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\
    
    \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(-0.125 \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)\right), t\_2, t\_1 \cdot \left(d \cdot d\right)\right)}{d}\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

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

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

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

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

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

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

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

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

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

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

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

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

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

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

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 1.5e-96 < d < 1.4e154

      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. lift-*.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites77.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6477.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites77.9%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}\right)} \cdot h}{\ell}\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        5. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        6. associate-*r*N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        11. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6471.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites71.9%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right)} \cdot h}{\ell}\right) \]

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      4. Applied rewrites43.4%

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
      5. Taylor expanded in d around 0

        \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        6. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        12. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        13. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        3. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

      if -4.999999999999985e-310 < d < 1.5e-96

      1. Initial program 47.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. Taylor expanded in d around 0

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) + {d}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}}{d}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{\frac{-1}{8} \cdot \left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) + {d}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}}{\color{blue}{d}} \]
      4. Applied rewrites35.2%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-0.125 \cdot \left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right), \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \sqrt{\frac{1}{\ell \cdot h}} \cdot \left(d \cdot d\right)\right)}{d}} \]

      if 1.4e154 < d

      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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6422.2

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites22.2%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
        6. metadata-evalN/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6422.1

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites22.1%

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6422.0

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites22.0%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 63.2% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\ t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\\ t_2 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{t\_1}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_3 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-t\_0\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_3\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t\_3 \cdot t\_1}{d \cdot d}, -0.125, t\_0\right) \cdot d\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0 (sqrt (/ 1.0 (* l h))))
            (t_1 (* (* (* M_m M_m) D_m) D_m))
            (t_2
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (- 1.0 (/ (* (* (/ t_1 (* d d)) 0.125) h) l))))
            (t_3 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- t_0) d)
         (if (<= d -6e-161)
           t_2
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_3)
             (if (<= d 1.5e-96)
               (* (fma (/ (* t_3 t_1) (* d d)) -0.125 t_0) d)
               (if (<= d 1.4e+154) t_2 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = sqrt((1.0 / (l * h)));
    	double t_1 = ((M_m * M_m) * D_m) * D_m;
    	double t_2 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((t_1 / (d * d)) * 0.125) * h) / l));
    	double t_3 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -t_0 * d;
    	} else if (d <= -6e-161) {
    		tmp = t_2;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_3;
    	} else if (d <= 1.5e-96) {
    		tmp = fma(((t_3 * t_1) / (d * d)), -0.125, t_0) * d;
    	} else if (d <= 1.4e+154) {
    		tmp = t_2;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = sqrt(Float64(1.0 / Float64(l * h)))
    	t_1 = Float64(Float64(Float64(M_m * M_m) * D_m) * D_m)
    	t_2 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(t_1 / Float64(d * d)) * 0.125) * h) / l)))
    	t_3 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-t_0) * d);
    	elseif (d <= -6e-161)
    		tmp = t_2;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_3);
    	elseif (d <= 1.5e-96)
    		tmp = Float64(fma(Float64(Float64(t_3 * t_1) / Float64(d * d)), -0.125, t_0) * d);
    	elseif (d <= 1.4e+154)
    		tmp = t_2;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$1 / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-t$95$0) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$2, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[d, 1.5e-96], N[(N[(N[(N[(t$95$3 * t$95$1), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * -0.125 + t$95$0), $MachinePrecision] * d), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$2, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
    t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\\
    t_2 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{t\_1}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_3 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-t\_0\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_3\\
    
    \mathbf{elif}\;d \leq 1.5 \cdot 10^{-96}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{t\_3 \cdot t\_1}{d \cdot d}, -0.125, t\_0\right) \cdot d\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Taylor expanded in h around -inf

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
        2. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
        4. *-commutativeN/A

          \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        5. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. *-commutativeN/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        8. lower-sqrt.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        9. lift-/.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 1.5e-96 < d < 1.4e154

      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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites77.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6477.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites77.9%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}\right)} \cdot h}{\ell}\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        5. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        6. associate-*r*N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        11. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6471.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites71.9%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right)} \cdot h}{\ell}\right) \]

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      4. Applied rewrites43.4%

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
      5. Taylor expanded in d around 0

        \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        6. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        12. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        13. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        3. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

      if -4.999999999999985e-310 < d < 1.5e-96

      1. Initial program 47.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites46.0%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \left(\sqrt{\frac{1}{h \cdot \ell}} + \frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)} \]
      5. Applied rewrites30.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        4. pow2N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        5. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        6. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        7. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        8. pow2N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        9. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. pow2N/A

          \[\leadsto \mathsf{fma}\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        12. lift-sqrt.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        13. lift-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        14. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        15. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        16. pow3N/A

          \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        17. associate-*l/N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}}{{d}^{2}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites30.8%

        \[\leadsto \mathsf{fma}\left(\frac{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d \cdot d}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if 1.4e154 < d

      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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6422.2

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites22.2%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
        6. metadata-evalN/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6422.1

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites22.1%

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6422.0

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites22.0%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 12: 62.5% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\ t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-t\_1\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\ \mathbf{elif}\;d \leq 5.5 \cdot 10^{-26}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right) \cdot D\_m}{d \cdot d} \cdot t\_2, -0.125, t\_1\right) \cdot d\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l))))
            (t_1 (sqrt (/ 1.0 (* l h))))
            (t_2 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- t_1) d)
         (if (<= d -6e-161)
           t_0
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_2)
             (if (<= d 5.5e-26)
               (*
                (fma (* (/ (* (* M_m (* D_m M_m)) D_m) (* d d)) t_2) -0.125 t_1)
                d)
               (if (<= d 1.4e+154) t_0 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	double t_1 = sqrt((1.0 / (l * h)));
    	double t_2 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -t_1 * d;
    	} else if (d <= -6e-161) {
    		tmp = t_0;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_2;
    	} else if (d <= 5.5e-26) {
    		tmp = fma(((((M_m * (D_m * M_m)) * D_m) / (d * d)) * t_2), -0.125, t_1) * d;
    	} else if (d <= 1.4e+154) {
    		tmp = t_0;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)))
    	t_1 = sqrt(Float64(1.0 / Float64(l * h)))
    	t_2 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-t_1) * d);
    	elseif (d <= -6e-161)
    		tmp = t_0;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_2);
    	elseif (d <= 5.5e-26)
    		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * Float64(D_m * M_m)) * D_m) / Float64(d * d)) * t_2), -0.125, t_1) * d);
    	elseif (d <= 1.4e+154)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-t$95$1) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$0, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[d, 5.5e-26], N[(N[(N[(N[(N[(N[(M$95$m * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * -0.125 + t$95$1), $MachinePrecision] * d), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$0, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
    t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-t\_1\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\
    
    \mathbf{elif}\;d \leq 5.5 \cdot 10^{-26}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right) \cdot D\_m}{d \cdot d} \cdot t\_2, -0.125, t\_1\right) \cdot d\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Taylor expanded in h around -inf

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
        2. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
        4. *-commutativeN/A

          \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        5. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. *-commutativeN/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        8. lower-sqrt.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        9. lift-/.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 5.5000000000000005e-26 < d < 1.4e154

      1. Initial program 76.6%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites78.3%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6478.3

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites78.3%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}\right)} \cdot h}{\ell}\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        5. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        6. associate-*r*N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        11. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6472.4

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites72.4%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right)} \cdot h}{\ell}\right) \]

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      4. Applied rewrites43.4%

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
      5. Taylor expanded in d around 0

        \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        6. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        12. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        13. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        3. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

      if -4.999999999999985e-310 < d < 5.5000000000000005e-26

      1. Initial program 54.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites52.7%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \left(\sqrt{\frac{1}{h \cdot \ell}} + \frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)} \]
      5. Applied rewrites34.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        3. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        4. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot M\right)\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, \frac{-1}{8}, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        6. lower-*.f6438.3

          \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot M\right)\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites38.3%

        \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot M\right)\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if 1.4e154 < d

      1. Initial program 76.6%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6420.8

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites20.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
        6. metadata-evalN/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6420.8

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites20.8%

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6419.4

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites19.4%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 13: 62.4% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\ t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-t\_1\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\ \mathbf{elif}\;d \leq 7 \cdot 10^{-119}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{d \cdot d} \cdot t\_2, -0.125, t\_1\right) \cdot d\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l))))
            (t_1 (sqrt (/ 1.0 (* l h))))
            (t_2 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- t_1) d)
         (if (<= d -6e-161)
           t_0
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_2)
             (if (<= d 7e-119)
               (*
                (fma (* (/ (* (* M_m M_m) (* D_m D_m)) (* d d)) t_2) -0.125 t_1)
                d)
               (if (<= d 1.4e+154) t_0 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	double t_1 = sqrt((1.0 / (l * h)));
    	double t_2 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -t_1 * d;
    	} else if (d <= -6e-161) {
    		tmp = t_0;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_2;
    	} else if (d <= 7e-119) {
    		tmp = fma(((((M_m * M_m) * (D_m * D_m)) / (d * d)) * t_2), -0.125, t_1) * d;
    	} else if (d <= 1.4e+154) {
    		tmp = t_0;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)))
    	t_1 = sqrt(Float64(1.0 / Float64(l * h)))
    	t_2 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-t_1) * d);
    	elseif (d <= -6e-161)
    		tmp = t_0;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_2);
    	elseif (d <= 7e-119)
    		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(d * d)) * t_2), -0.125, t_1) * d);
    	elseif (d <= 1.4e+154)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-t$95$1) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$0, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[d, 7e-119], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * -0.125 + t$95$1), $MachinePrecision] * d), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$0, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
    t_2 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-t\_1\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_2\\
    
    \mathbf{elif}\;d \leq 7 \cdot 10^{-119}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{d \cdot d} \cdot t\_2, -0.125, t\_1\right) \cdot d\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Taylor expanded in h around -inf

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
        2. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
        4. *-commutativeN/A

          \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        5. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. *-commutativeN/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        8. lower-sqrt.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        9. lift-/.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 7e-119 < d < 1.4e154

      1. Initial program 76.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites77.3%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6477.3

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites77.3%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}\right)} \cdot h}{\ell}\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        5. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        6. associate-*r*N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        11. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6471.3

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites71.3%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right)} \cdot h}{\ell}\right) \]

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      4. Applied rewrites43.4%

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
      5. Taylor expanded in d around 0

        \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        6. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        12. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        13. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        3. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

      if -4.999999999999985e-310 < d < 7e-119

      1. Initial program 46.6%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \left(\sqrt{\frac{1}{h \cdot \ell}} + \frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} + \frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} + \frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot \color{blue}{d} \]
      4. Applied rewrites28.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}, -0.125, \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d} \]

      if 1.4e154 < d

      1. Initial program 76.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6422.3

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites22.3%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
        6. metadata-evalN/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6422.3

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites22.3%

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6422.3

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites22.3%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 14: 62.2% accurate, 1.5× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\ t_1 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_1\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-158}:\\ \;\;\;\;\left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot t\_1\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (/ (* (* (/ (* (* (* M_m M_m) D_m) D_m) (* d d)) 0.125) h) l))))
            (t_1 (sqrt (/ h (* (* l l) l)))))
       (if (<= d -1.2e+154)
         (* (- (sqrt (/ 1.0 (* l h)))) d)
         (if (<= d -6e-161)
           t_0
           (if (<= d -5e-310)
             (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) t_1)
             (if (<= d 1.6e-158)
               (* (* -0.125 (* (* D_m D_m) (/ (* M_m M_m) d))) t_1)
               (if (<= d 1.4e+154) t_0 (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	double t_1 = sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -sqrt((1.0 / (l * h))) * d;
    	} else if (d <= -6e-161) {
    		tmp = t_0;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_1;
    	} else if (d <= 1.6e-158) {
    		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_1;
    	} else if (d <= 1.4e+154) {
    		tmp = t_0;
    	} else {
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m =     private
    D_m =     private
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(d, h, l, m_m, d_m)
    use fmin_fmax_functions
        real(8), intent (in) :: d
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: m_m
        real(8), intent (in) :: d_m
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((((((m_m * m_m) * d_m) * d_m) / (d * d)) * 0.125d0) * h) / l))
        t_1 = sqrt((h / ((l * l) * l)))
        if (d <= (-1.2d+154)) then
            tmp = -sqrt((1.0d0 / (l * h))) * d
        else if (d <= (-6d-161)) then
            tmp = t_0
        else if (d <= (-5d-310)) then
            tmp = (0.125d0 * ((d_m * d_m) * (m_m * (m_m / d)))) * t_1
        else if (d <= 1.6d-158) then
            tmp = ((-0.125d0) * ((d_m * d_m) * ((m_m * m_m) / d))) * t_1
        else if (d <= 1.4d+154) then
            tmp = t_0
        else
            tmp = (1.0d0 / (sqrt(l) * sqrt(h))) * d
        end if
        code = tmp
    end function
    
    M_m = Math.abs(M);
    D_m = Math.abs(D);
    assert d < h && h < l && l < M_m && M_m < D_m;
    public static double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	double t_1 = Math.sqrt((h / ((l * l) * l)));
    	double tmp;
    	if (d <= -1.2e+154) {
    		tmp = -Math.sqrt((1.0 / (l * h))) * d;
    	} else if (d <= -6e-161) {
    		tmp = t_0;
    	} else if (d <= -5e-310) {
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_1;
    	} else if (d <= 1.6e-158) {
    		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_1;
    	} else if (d <= 1.4e+154) {
    		tmp = t_0;
    	} else {
    		tmp = (1.0 / (Math.sqrt(l) * Math.sqrt(h))) * d;
    	}
    	return tmp;
    }
    
    M_m = math.fabs(M)
    D_m = math.fabs(D)
    [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
    def code(d, h, l, M_m, D_m):
    	t_0 = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l))
    	t_1 = math.sqrt((h / ((l * l) * l)))
    	tmp = 0
    	if d <= -1.2e+154:
    		tmp = -math.sqrt((1.0 / (l * h))) * d
    	elif d <= -6e-161:
    		tmp = t_0
    	elif d <= -5e-310:
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_1
    	elif d <= 1.6e-158:
    		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_1
    	elif d <= 1.4e+154:
    		tmp = t_0
    	else:
    		tmp = (1.0 / (math.sqrt(l) * math.sqrt(h))) * d
    	return tmp
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * D_m) * D_m) / Float64(d * d)) * 0.125) * h) / l)))
    	t_1 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
    	tmp = 0.0
    	if (d <= -1.2e+154)
    		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
    	elseif (d <= -6e-161)
    		tmp = t_0;
    	elseif (d <= -5e-310)
    		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * t_1);
    	elseif (d <= 1.6e-158)
    		tmp = Float64(Float64(-0.125 * Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / d))) * t_1);
    	elseif (d <= 1.4e+154)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
    	end
    	return tmp
    end
    
    M_m = abs(M);
    D_m = abs(D);
    d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
    function tmp_2 = code(d, h, l, M_m, D_m)
    	t_0 = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((((M_m * M_m) * D_m) * D_m) / (d * d)) * 0.125) * h) / l));
    	t_1 = sqrt((h / ((l * l) * l)));
    	tmp = 0.0;
    	if (d <= -1.2e+154)
    		tmp = -sqrt((1.0 / (l * h))) * d;
    	elseif (d <= -6e-161)
    		tmp = t_0;
    	elseif (d <= -5e-310)
    		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * t_1;
    	elseif (d <= 1.6e-158)
    		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_1;
    	elseif (d <= 1.4e+154)
    		tmp = t_0;
    	else
    		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
    	end
    	tmp_2 = tmp;
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.2e+154], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], If[LessEqual[d, -6e-161], t$95$0, If[LessEqual[d, -5e-310], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 1.6e-158], N[(N[(-0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 1.4e+154], t$95$0, N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right)\\
    t_1 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
    \mathbf{if}\;d \leq -1.2 \cdot 10^{+154}:\\
    \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
    
    \mathbf{elif}\;d \leq -6 \cdot 10^{-161}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot t\_1\\
    
    \mathbf{elif}\;d \leq 1.6 \cdot 10^{-158}:\\
    \;\;\;\;\left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot t\_1\\
    
    \mathbf{elif}\;d \leq 1.4 \cdot 10^{+154}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if d < -1.20000000000000007e154

      1. Initial program 72.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f647.1

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Taylor expanded in h around -inf

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      6. Step-by-step derivation
        1. sqrt-pow2N/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
        2. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
        3. metadata-evalN/A

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
        4. *-commutativeN/A

          \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        5. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
        6. lower-neg.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. *-commutativeN/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        8. lower-sqrt.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        9. lift-/.f64N/A

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        10. lift-*.f6467.6

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
      7. Applied rewrites67.6%

        \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

      if -1.20000000000000007e154 < d < -5.99999999999999977e-161 or 1.59999999999999998e-158 < d < 1.4e154

      1. Initial program 75.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites76.0%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6476.0

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites76.0%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}\right)} \cdot h}{\ell}\right) \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \color{blue}{\frac{1}{8}}\right) \cdot h}{\ell}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot {D}^{2}}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        5. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{{M}^{2} \cdot \left(D \cdot D\right)}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        6. associate-*r*N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        7. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left({M}^{2} \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{{d}^{2}} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        11. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{1}{8}\right) \cdot h}{\ell}\right) \]
        12. lower-*.f6470.0

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right) \cdot h}{\ell}\right) \]
      8. Applied rewrites70.0%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d \cdot d} \cdot 0.125\right)} \cdot h}{\ell}\right) \]

      if -5.99999999999999977e-161 < d < -4.999999999999985e-310

      1. Initial program 45.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. 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)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
      4. Applied rewrites43.4%

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
      5. Taylor expanded in d around 0

        \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        6. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        9. pow2N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. pow3N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        12. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        13. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        15. lift-sqrt.f6443.4

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      7. Applied rewrites43.4%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        3. associate-/l*N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        5. lower-/.f6452.3

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      9. Applied rewrites52.3%

        \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

      if -4.999999999999985e-310 < d < 1.59999999999999998e-158

      1. Initial program 42.6%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. 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)} \]
      3. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
        2. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
        3. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \]
        4. associate-/l*N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\color{blue}{{\ell}^{3}}}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\color{blue}{{\ell}^{3}}}} \]
        6. unpow2N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\color{blue}{\ell}}^{3}}} \]
        7. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\color{blue}{\ell}}^{3}}} \]
        8. lower-/.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{\color{blue}{3}}}} \]
        9. unpow2N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        10. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        11. lower-sqrt.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        12. lower-/.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
        13. unpow3N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        14. unpow2N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{2} \cdot \ell}} \]
        15. lower-*.f64N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{2} \cdot \ell}} \]
        16. unpow2N/A

          \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        17. lower-*.f6438.8

          \[\leadsto \left(-0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
      4. Applied rewrites38.8%

        \[\leadsto \color{blue}{\left(-0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]

      if 1.4e154 < d

      1. Initial program 75.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. Taylor expanded in d around inf

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        2. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        6. lower-*.f6422.9

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
      4. Applied rewrites22.9%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      5. Step-by-step derivation
        1. lift-sqrt.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        2. lift-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. lift-/.f64N/A

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. sqrt-divN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
        6. metadata-evalN/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        9. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        10. lift-*.f6422.9

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      6. Applied rewrites22.9%

        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        3. sqrt-prodN/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        4. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        6. lift-*.f6423.3

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      8. Applied rewrites23.3%

        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
    3. Recombined 5 regimes into one program.
    4. Add Preprocessing

    Alternative 15: 56.3% accurate, 0.3× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_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\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-66}:\\ \;\;\;\;t\_1 \cdot \left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+298}:\\ \;\;\;\;t\_1 \cdot 1\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sqrt{\ell \cdot h} \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot -0.125}{\ell \cdot \ell}\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d h l M_m D_m)
     :precision binary64
     (let* ((t_0
             (*
              (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
              (-
               1.0
               (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l)))))
            (t_1 (* (sqrt (/ d l)) (sqrt (/ d h)))))
       (if (<= t_0 -1e-66)
         (* t_1 (* (/ (* (* (* M_m M_m) h) (* D_m D_m)) (* (* d d) l)) -0.125))
         (if (<= t_0 5e+298)
           (* t_1 1.0)
           (if (<= t_0 INFINITY)
             (* (sqrt (/ (/ 1.0 l) h)) d)
             (/
              (* (/ (* (sqrt (* l h)) (* (* (* M_m M_m) D_m) D_m)) d) -0.125)
              (* l l)))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d < h && h < l && l < M_m && M_m < D_m);
    double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
    	double t_1 = sqrt((d / l)) * sqrt((d / h));
    	double tmp;
    	if (t_0 <= -1e-66) {
    		tmp = t_1 * (((((M_m * M_m) * h) * (D_m * D_m)) / ((d * d) * l)) * -0.125);
    	} else if (t_0 <= 5e+298) {
    		tmp = t_1 * 1.0;
    	} else if (t_0 <= ((double) INFINITY)) {
    		tmp = sqrt(((1.0 / l) / h)) * d;
    	} else {
    		tmp = (((sqrt((l * h)) * (((M_m * M_m) * D_m) * D_m)) / d) * -0.125) / (l * l);
    	}
    	return tmp;
    }
    
    M_m = Math.abs(M);
    D_m = Math.abs(D);
    assert d < h && h < l && l < M_m && M_m < D_m;
    public static double code(double d, double h, double l, double M_m, double D_m) {
    	double t_0 = (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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
    	double t_1 = Math.sqrt((d / l)) * Math.sqrt((d / h));
    	double tmp;
    	if (t_0 <= -1e-66) {
    		tmp = t_1 * (((((M_m * M_m) * h) * (D_m * D_m)) / ((d * d) * l)) * -0.125);
    	} else if (t_0 <= 5e+298) {
    		tmp = t_1 * 1.0;
    	} else if (t_0 <= Double.POSITIVE_INFINITY) {
    		tmp = Math.sqrt(((1.0 / l) / h)) * d;
    	} else {
    		tmp = (((Math.sqrt((l * h)) * (((M_m * M_m) * D_m) * D_m)) / d) * -0.125) / (l * l);
    	}
    	return tmp;
    }
    
    M_m = math.fabs(M)
    D_m = math.fabs(D)
    [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
    def code(d, h, l, M_m, D_m):
    	t_0 = (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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
    	t_1 = math.sqrt((d / l)) * math.sqrt((d / h))
    	tmp = 0
    	if t_0 <= -1e-66:
    		tmp = t_1 * (((((M_m * M_m) * h) * (D_m * D_m)) / ((d * d) * l)) * -0.125)
    	elif t_0 <= 5e+298:
    		tmp = t_1 * 1.0
    	elif t_0 <= math.inf:
    		tmp = math.sqrt(((1.0 / l) / h)) * d
    	else:
    		tmp = (((math.sqrt((l * h)) * (((M_m * M_m) * D_m) * D_m)) / d) * -0.125) / (l * l)
    	return tmp
    
    M_m = abs(M)
    D_m = abs(D)
    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
    function code(d, h, l, M_m, D_m)
    	t_0 = 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_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
    	t_1 = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))
    	tmp = 0.0
    	if (t_0 <= -1e-66)
    		tmp = Float64(t_1 * Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * Float64(D_m * D_m)) / Float64(Float64(d * d) * l)) * -0.125));
    	elseif (t_0 <= 5e+298)
    		tmp = Float64(t_1 * 1.0);
    	elseif (t_0 <= Inf)
    		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
    	else
    		tmp = Float64(Float64(Float64(Float64(sqrt(Float64(l * h)) * Float64(Float64(Float64(M_m * M_m) * D_m) * D_m)) / d) * -0.125) / Float64(l * l));
    	end
    	return tmp
    end
    
    M_m = abs(M);
    D_m = abs(D);
    d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
    function tmp_2 = code(d, h, l, M_m, D_m)
    	t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
    	t_1 = sqrt((d / l)) * sqrt((d / h));
    	tmp = 0.0;
    	if (t_0 <= -1e-66)
    		tmp = t_1 * (((((M_m * M_m) * h) * (D_m * D_m)) / ((d * d) * l)) * -0.125);
    	elseif (t_0 <= 5e+298)
    		tmp = t_1 * 1.0;
    	elseif (t_0 <= Inf)
    		tmp = sqrt(((1.0 / l) / h)) * d;
    	else
    		tmp = (((sqrt((l * h)) * (((M_m * M_m) * D_m) * D_m)) / d) * -0.125) / (l * l);
    	end
    	tmp_2 = tmp;
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = 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$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-66], N[(t$95$1 * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+298], N[(t$95$1 * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision], N[(N[(N[(N[(N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_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\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
    t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
    \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-66}:\\
    \;\;\;\;t\_1 \cdot \left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+298}:\\
    \;\;\;\;t\_1 \cdot 1\\
    
    \mathbf{elif}\;t\_0 \leq \infty:\\
    \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\sqrt{\ell \cdot h} \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot -0.125}{\ell \cdot \ell}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.9999999999999998e-67

      1. Initial program 86.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites84.5%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6484.5

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites84.5%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around 0

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right) \]
        3. lower-/.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        5. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        6. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        7. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        9. pow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right) \]
        12. unpow2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot \frac{-1}{8}\right) \]
        13. lower-*.f6452.5

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \]
      8. Applied rewrites52.5%

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)} \]

      if -9.9999999999999998e-67 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000003e298

      1. Initial program 87.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. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        2. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        4. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        8. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
        9. associate-*r/N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        10. lower-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      3. Applied rewrites85.7%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        2. lift-/.f64N/A

          \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        3. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        4. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        6. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        7. lift-/.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        10. *-commutativeN/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        12. pow1/2N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        13. lower-sqrt.f64N/A

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        14. lift-/.f64N/A

          \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        15. pow1/2N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        16. lower-sqrt.f64N/A

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6485.7

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      5. Applied rewrites85.7%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
      6. Taylor expanded in d around inf

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
      7. Step-by-step derivation
        1. Applied rewrites84.8%

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]

        if 5.0000000000000003e298 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

        1. Initial program 51.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. Taylor expanded in d around inf

          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          2. lower-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          4. lower-/.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          5. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          6. lower-*.f6448.2

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. Applied rewrites48.2%

          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          2. lift-/.f64N/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          3. associate-/r*N/A

            \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
          4. lower-/.f64N/A

            \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
          5. lower-/.f6448.2

            \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
        6. Applied rewrites48.2%

          \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]

        if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

        1. Initial program 0.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. Taylor expanded in l around 0

          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{h \cdot \ell}\right) + d \cdot \sqrt{\frac{{\ell}^{3}}{h}}}{{\ell}^{2}}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{h \cdot \ell}\right) + d \cdot \sqrt{\frac{{\ell}^{3}}{h}}}{\color{blue}{{\ell}^{2}}} \]
        4. Applied rewrites11.1%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right) \cdot \sqrt{\ell \cdot h}}{d}, -0.125, \sqrt{\frac{\left(\ell \cdot \ell\right) \cdot \ell}{h}} \cdot d\right)}{\ell \cdot \ell}} \]
        5. Taylor expanded in d around 0

          \[\leadsto \frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{h \cdot \ell}\right)}{\color{blue}{\ell} \cdot \ell} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{h \cdot \ell}\right) \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          2. associate-*l/N/A

            \[\leadsto \frac{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{h \cdot \ell}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          3. *-commutativeN/A

            \[\leadsto \frac{\frac{\left({M}^{2} \cdot {D}^{2}\right) \cdot \sqrt{h \cdot \ell}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          4. pow2N/A

            \[\leadsto \frac{\frac{\left(\left(M \cdot M\right) \cdot {D}^{2}\right) \cdot \sqrt{h \cdot \ell}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          5. pow2N/A

            \[\leadsto \frac{\frac{\left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right) \cdot \sqrt{h \cdot \ell}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          6. *-commutativeN/A

            \[\leadsto \frac{\frac{\left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right) \cdot \sqrt{\ell \cdot h}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
          7. lower-*.f64N/A

            \[\leadsto \frac{\frac{\left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right) \cdot \sqrt{\ell \cdot h}}{d} \cdot \frac{-1}{8}}{\ell \cdot \ell} \]
        7. Applied rewrites15.0%

          \[\leadsto \frac{\frac{\sqrt{\ell \cdot h} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot -0.125}{\color{blue}{\ell} \cdot \ell} \]
      8. Recombined 4 regimes into one program.
      9. Add Preprocessing

      Alternative 16: 49.5% accurate, 2.2× speedup?

      \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{if}\;\ell \leq -1.1 \cdot 10^{+65}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{elif}\;\ell \leq -1.9 \cdot 10^{-304}:\\ \;\;\;\;\frac{0.125 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot t\_0\\ \mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-19}:\\ \;\;\;\;\left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
      M_m = (fabs.f64 M)
      D_m = (fabs.f64 D)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (sqrt (/ h (* (* l l) l)))))
         (if (<= l -1.1e+65)
           (* (- (sqrt (/ 1.0 (* l h)))) d)
           (if (<= l -1.9e-304)
             (* (/ (* 0.125 (* (* (* M_m M_m) D_m) D_m)) d) t_0)
             (if (<= l 1.7e-19)
               (* (* -0.125 (* (* D_m D_m) (/ (* M_m M_m) d))) t_0)
               (* (/ 1.0 (* (sqrt l) (sqrt h))) d))))))
      M_m = fabs(M);
      D_m = fabs(D);
      assert(d < h && h < l && l < M_m && M_m < D_m);
      double code(double d, double h, double l, double M_m, double D_m) {
      	double t_0 = sqrt((h / ((l * l) * l)));
      	double tmp;
      	if (l <= -1.1e+65) {
      		tmp = -sqrt((1.0 / (l * h))) * d;
      	} else if (l <= -1.9e-304) {
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * t_0;
      	} else if (l <= 1.7e-19) {
      		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_0;
      	} else {
      		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
      	}
      	return tmp;
      }
      
      M_m =     private
      D_m =     private
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(d, h, l, m_m, d_m)
      use fmin_fmax_functions
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d_m
          real(8) :: t_0
          real(8) :: tmp
          t_0 = sqrt((h / ((l * l) * l)))
          if (l <= (-1.1d+65)) then
              tmp = -sqrt((1.0d0 / (l * h))) * d
          else if (l <= (-1.9d-304)) then
              tmp = ((0.125d0 * (((m_m * m_m) * d_m) * d_m)) / d) * t_0
          else if (l <= 1.7d-19) then
              tmp = ((-0.125d0) * ((d_m * d_m) * ((m_m * m_m) / d))) * t_0
          else
              tmp = (1.0d0 / (sqrt(l) * sqrt(h))) * d
          end if
          code = tmp
      end function
      
      M_m = Math.abs(M);
      D_m = Math.abs(D);
      assert d < h && h < l && l < M_m && M_m < D_m;
      public static double code(double d, double h, double l, double M_m, double D_m) {
      	double t_0 = Math.sqrt((h / ((l * l) * l)));
      	double tmp;
      	if (l <= -1.1e+65) {
      		tmp = -Math.sqrt((1.0 / (l * h))) * d;
      	} else if (l <= -1.9e-304) {
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * t_0;
      	} else if (l <= 1.7e-19) {
      		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_0;
      	} else {
      		tmp = (1.0 / (Math.sqrt(l) * Math.sqrt(h))) * d;
      	}
      	return tmp;
      }
      
      M_m = math.fabs(M)
      D_m = math.fabs(D)
      [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
      def code(d, h, l, M_m, D_m):
      	t_0 = math.sqrt((h / ((l * l) * l)))
      	tmp = 0
      	if l <= -1.1e+65:
      		tmp = -math.sqrt((1.0 / (l * h))) * d
      	elif l <= -1.9e-304:
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * t_0
      	elif l <= 1.7e-19:
      		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_0
      	else:
      		tmp = (1.0 / (math.sqrt(l) * math.sqrt(h))) * d
      	return tmp
      
      M_m = abs(M)
      D_m = abs(D)
      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
      function code(d, h, l, M_m, D_m)
      	t_0 = sqrt(Float64(h / Float64(Float64(l * l) * l)))
      	tmp = 0.0
      	if (l <= -1.1e+65)
      		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
      	elseif (l <= -1.9e-304)
      		tmp = Float64(Float64(Float64(0.125 * Float64(Float64(Float64(M_m * M_m) * D_m) * D_m)) / d) * t_0);
      	elseif (l <= 1.7e-19)
      		tmp = Float64(Float64(-0.125 * Float64(Float64(D_m * D_m) * Float64(Float64(M_m * M_m) / d))) * t_0);
      	else
      		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
      	end
      	return tmp
      end
      
      M_m = abs(M);
      D_m = abs(D);
      d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
      function tmp_2 = code(d, h, l, M_m, D_m)
      	t_0 = sqrt((h / ((l * l) * l)));
      	tmp = 0.0;
      	if (l <= -1.1e+65)
      		tmp = -sqrt((1.0 / (l * h))) * d;
      	elseif (l <= -1.9e-304)
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * t_0;
      	elseif (l <= 1.7e-19)
      		tmp = (-0.125 * ((D_m * D_m) * ((M_m * M_m) / d))) * t_0;
      	else
      		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
      	end
      	tmp_2 = tmp;
      end
      
      M_m = N[Abs[M], $MachinePrecision]
      D_m = N[Abs[D], $MachinePrecision]
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.1e+65], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], If[LessEqual[l, -1.9e-304], N[(N[(N[(0.125 * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, 1.7e-19], N[(N[(-0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]]
      
      \begin{array}{l}
      M_m = \left|M\right|
      \\
      D_m = \left|D\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
      \mathbf{if}\;\ell \leq -1.1 \cdot 10^{+65}:\\
      \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
      
      \mathbf{elif}\;\ell \leq -1.9 \cdot 10^{-304}:\\
      \;\;\;\;\frac{0.125 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot t\_0\\
      
      \mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-19}:\\
      \;\;\;\;\left(-0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}\right)\right) \cdot t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if l < -1.0999999999999999e65

        1. Initial program 56.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. Taylor expanded in d around inf

          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          2. lower-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          4. lower-/.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          5. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          6. lower-*.f648.0

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. Applied rewrites8.0%

          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
        5. Taylor expanded in h around -inf

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
        6. Step-by-step derivation
          1. sqrt-pow2N/A

            \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
          2. metadata-evalN/A

            \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
          3. metadata-evalN/A

            \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
          4. *-commutativeN/A

            \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
          5. mul-1-negN/A

            \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
          6. lower-neg.f64N/A

            \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
          7. *-commutativeN/A

            \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
          8. lower-sqrt.f64N/A

            \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
          9. lift-/.f64N/A

            \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
          10. lift-*.f6450.4

            \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
        7. Applied rewrites50.4%

          \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

        if -1.0999999999999999e65 < l < -1.8999999999999998e-304

        1. Initial program 73.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. 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)} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
          2. lower-*.f64N/A

            \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        4. Applied rewrites40.2%

          \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
        5. Taylor expanded in d around 0

          \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          2. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          3. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          4. associate-/l*N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          5. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          6. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          7. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          8. lower-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          9. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          10. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          11. pow3N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          12. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          13. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          14. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          15. lift-sqrt.f6440.2

            \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        7. Applied rewrites40.2%

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
        8. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          2. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          3. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          4. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          6. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          7. associate-*r/N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          8. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          9. associate-*r/N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          11. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({M}^{2} \cdot {D}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          13. pow2N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({M}^{2} \cdot \left(D \cdot D\right)\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          14. associate-*l*N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left({M}^{2} \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          15. pow2N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          16. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          17. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          18. lift-*.f6441.3

            \[\leadsto \frac{0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        9. Applied rewrites41.3%

          \[\leadsto \frac{0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

        if -1.8999999999999998e-304 < l < 1.7000000000000001e-19

        1. Initial program 74.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. 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)} \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
          2. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \]
          3. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \]
          4. associate-/l*N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\color{blue}{{\ell}^{3}}}} \]
          5. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\color{blue}{{\ell}^{3}}}} \]
          6. unpow2N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\color{blue}{\ell}}^{3}}} \]
          7. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\color{blue}{\ell}}^{3}}} \]
          8. lower-/.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{\color{blue}{3}}}} \]
          9. unpow2N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          10. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          11. lower-sqrt.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          12. lower-/.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          13. unpow3N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          14. unpow2N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{2} \cdot \ell}} \]
          15. lower-*.f64N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{2} \cdot \ell}} \]
          16. unpow2N/A

            \[\leadsto \left(\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          17. lower-*.f6438.9

            \[\leadsto \left(-0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        4. Applied rewrites38.9%

          \[\leadsto \color{blue}{\left(-0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]

        if 1.7000000000000001e-19 < l

        1. Initial program 59.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. Taylor expanded in d around inf

          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          2. lower-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          4. lower-/.f64N/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          5. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          6. lower-*.f6446.3

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        4. Applied rewrites46.3%

          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
        5. Step-by-step derivation
          1. lift-sqrt.f64N/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          2. lift-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          3. lift-/.f64N/A

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          4. sqrt-divN/A

            \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
          5. *-commutativeN/A

            \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
          6. metadata-evalN/A

            \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
          7. lower-/.f64N/A

            \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
          8. *-commutativeN/A

            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
          9. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
          10. lift-*.f6446.2

            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        6. Applied rewrites46.2%

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
          2. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
          3. sqrt-prodN/A

            \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
          4. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
          5. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
          6. lift-*.f6455.7

            \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
        8. Applied rewrites55.7%

          \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
      3. Recombined 4 regimes into one program.
      4. Add Preprocessing

      Alternative 17: 49.2% accurate, 0.7× speedup?

      \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-209}:\\ \;\;\;\;\frac{0.125 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \end{array} \end{array} \]
      M_m = (fabs.f64 M)
      D_m = (fabs.f64 D)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (if (<=
            (*
             (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
             (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
            -1e-209)
         (* (/ (* 0.125 (* (* (* M_m M_m) D_m) D_m)) d) (sqrt (/ h (* (* l l) l))))
         (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)))
      M_m = fabs(M);
      D_m = fabs(D);
      assert(d < h && h < l && l < M_m && M_m < D_m);
      double code(double d, double h, double l, double M_m, double D_m) {
      	double tmp;
      	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-209) {
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * sqrt((h / ((l * l) * l)));
      	} else {
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	}
      	return tmp;
      }
      
      M_m =     private
      D_m =     private
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(d, h, l, m_m, d_m)
      use fmin_fmax_functions
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d_m
          real(8) :: tmp
          if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-1d-209)) then
              tmp = ((0.125d0 * (((m_m * m_m) * d_m) * d_m)) / d) * sqrt((h / ((l * l) * l)))
          else
              tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
          end if
          code = tmp
      end function
      
      M_m = Math.abs(M);
      D_m = Math.abs(D);
      assert d < h && h < l && l < M_m && M_m < D_m;
      public static double code(double d, double h, double l, double M_m, double D_m) {
      	double tmp;
      	if (((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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-209) {
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * Math.sqrt((h / ((l * l) * l)));
      	} else {
      		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
      	}
      	return tmp;
      }
      
      M_m = math.fabs(M)
      D_m = math.fabs(D)
      [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
      def code(d, h, l, M_m, D_m):
      	tmp = 0
      	if ((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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-209:
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * math.sqrt((h / ((l * l) * l)))
      	else:
      		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
      	return tmp
      
      M_m = abs(M)
      D_m = abs(D)
      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
      function code(d, h, l, M_m, D_m)
      	tmp = 0.0
      	if (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_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -1e-209)
      		tmp = Float64(Float64(Float64(0.125 * Float64(Float64(Float64(M_m * M_m) * D_m) * D_m)) / d) * sqrt(Float64(h / Float64(Float64(l * l) * l))));
      	else
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
      	end
      	return tmp
      end
      
      M_m = abs(M);
      D_m = abs(D);
      d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
      function tmp_2 = code(d, h, l, M_m, D_m)
      	tmp = 0.0;
      	if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -1e-209)
      		tmp = ((0.125 * (((M_m * M_m) * D_m) * D_m)) / d) * sqrt((h / ((l * l) * l)));
      	else
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	end
      	tmp_2 = tmp;
      end
      
      M_m = N[Abs[M], $MachinePrecision]
      D_m = N[Abs[D], $MachinePrecision]
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[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$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-209], N[(N[(N[(0.125 * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]
      
      \begin{array}{l}
      M_m = \left|M\right|
      \\
      D_m = \left|D\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-209}:\\
      \;\;\;\;\frac{0.125 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot D\_m\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-209

        1. Initial program 86.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. 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)} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
          2. lower-*.f64N/A

            \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
        4. Applied rewrites30.4%

          \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
        5. Taylor expanded in d around 0

          \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          2. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          3. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          4. associate-/l*N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          5. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          6. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          7. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          8. lower-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          9. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          10. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
          11. pow3N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          12. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          13. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          14. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          15. lift-sqrt.f6430.4

            \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        7. Applied rewrites30.4%

          \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
        8. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          2. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          3. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          4. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          6. pow2N/A

            \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          7. associate-*r/N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          8. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          9. associate-*r/N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          11. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({M}^{2} \cdot {D}^{2}\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          13. pow2N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left({M}^{2} \cdot \left(D \cdot D\right)\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          14. associate-*l*N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left({M}^{2} \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          15. pow2N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          16. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          17. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          18. lift-*.f6431.7

            \[\leadsto \frac{0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
        9. Applied rewrites31.7%

          \[\leadsto \frac{0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot D\right)}{d} \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

        if -1e-209 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

        1. Initial program 55.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. lift-*.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
          2. lift-*.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
          3. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          4. lift-pow.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
          5. lift-*.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          6. lift-*.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          7. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          8. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
          9. associate-*r/N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          10. lower-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        3. Applied rewrites58.1%

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
        4. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          2. lift-/.f64N/A

            \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          3. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          4. metadata-evalN/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          5. lift-pow.f64N/A

            \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          6. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          7. lift-/.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          8. metadata-evalN/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          9. lift-pow.f64N/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          10. *-commutativeN/A

            \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          11. lower-*.f64N/A

            \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          12. pow1/2N/A

            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          13. lower-sqrt.f64N/A

            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          14. lift-/.f64N/A

            \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          15. pow1/2N/A

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          16. lower-sqrt.f64N/A

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          17. lift-/.f6458.1

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
        5. Applied rewrites58.1%

          \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
        6. Taylor expanded in d around inf

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
        7. Step-by-step derivation
          1. Applied rewrites58.4%

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 18: 46.4% accurate, 0.7× speedup?

        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 0:\\ \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \end{array} \end{array} \]
        M_m = (fabs.f64 M)
        D_m = (fabs.f64 D)
        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        (FPCore (d h l M_m D_m)
         :precision binary64
         (if (<=
              (*
               (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
               (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
              0.0)
           (* (* 0.125 (* (* D_m D_m) (* M_m (/ M_m d)))) (sqrt (/ h (* (* l l) l))))
           (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)))
        M_m = fabs(M);
        D_m = fabs(D);
        assert(d < h && h < l && l < M_m && M_m < D_m);
        double code(double d, double h, double l, double M_m, double D_m) {
        	double tmp;
        	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 0.0) {
        		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * sqrt((h / ((l * l) * l)));
        	} else {
        		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
        	}
        	return tmp;
        }
        
        M_m =     private
        D_m =     private
        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(d, h, l, m_m, d_m)
        use fmin_fmax_functions
            real(8), intent (in) :: d
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: m_m
            real(8), intent (in) :: d_m
            real(8) :: tmp
            if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= 0.0d0) then
                tmp = (0.125d0 * ((d_m * d_m) * (m_m * (m_m / d)))) * sqrt((h / ((l * l) * l)))
            else
                tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
            end if
            code = tmp
        end function
        
        M_m = Math.abs(M);
        D_m = Math.abs(D);
        assert d < h && h < l && l < M_m && M_m < D_m;
        public static double code(double d, double h, double l, double M_m, double D_m) {
        	double tmp;
        	if (((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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 0.0) {
        		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * Math.sqrt((h / ((l * l) * l)));
        	} else {
        		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
        	}
        	return tmp;
        }
        
        M_m = math.fabs(M)
        D_m = math.fabs(D)
        [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
        def code(d, h, l, M_m, D_m):
        	tmp = 0
        	if ((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_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 0.0:
        		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * math.sqrt((h / ((l * l) * l)))
        	else:
        		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
        	return tmp
        
        M_m = abs(M)
        D_m = abs(D)
        d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
        function code(d, h, l, M_m, D_m)
        	tmp = 0.0
        	if (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_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 0.0)
        		tmp = Float64(Float64(0.125 * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(M_m / d)))) * sqrt(Float64(h / Float64(Float64(l * l) * l))));
        	else
        		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
        	end
        	return tmp
        end
        
        M_m = abs(M);
        D_m = abs(D);
        d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
        function tmp_2 = code(d, h, l, M_m, D_m)
        	tmp = 0.0;
        	if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= 0.0)
        		tmp = (0.125 * ((D_m * D_m) * (M_m * (M_m / d)))) * sqrt((h / ((l * l) * l)));
        	else
        		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
        	end
        	tmp_2 = tmp;
        end
        
        M_m = N[Abs[M], $MachinePrecision]
        D_m = N[Abs[D], $MachinePrecision]
        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[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$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(0.125 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]
        
        \begin{array}{l}
        M_m = \left|M\right|
        \\
        D_m = \left|D\right|
        \\
        [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 0:\\
        \;\;\;\;\left(0.125 \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0

          1. Initial program 79.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. 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)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
            2. lower-*.f64N/A

              \[\leadsto \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \color{blue}{\frac{-1}{8}} \]
          4. Applied rewrites31.4%

            \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{-1 \cdot \left(M \cdot M\right)}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\right) \cdot -0.125} \]
          5. Taylor expanded in d around 0

            \[\leadsto \frac{1}{8} \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{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 {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            2. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            3. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            4. associate-/l*N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            5. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left({D}^{2} \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            6. pow2N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            7. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            8. lower-/.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{{M}^{2}}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            9. pow2N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            10. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}} \]
            11. pow3N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            12. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            13. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            14. lift-/.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            15. lift-sqrt.f6431.4

              \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          7. Applied rewrites31.4%

            \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            2. lift-/.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \frac{M \cdot M}{d}\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            3. associate-/l*N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            4. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
            5. lower-/.f6433.4

              \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]
          9. Applied rewrites33.4%

            \[\leadsto \left(0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \]

          if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

          1. Initial program 57.6%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
            2. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
            3. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            4. lift-pow.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
            5. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            6. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            7. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            8. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
            9. associate-*r/N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            10. lower-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          3. Applied rewrites60.7%

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
          4. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            2. lift-/.f64N/A

              \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            3. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            4. metadata-evalN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            5. lift-pow.f64N/A

              \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            6. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            7. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. metadata-evalN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            9. lift-pow.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            10. *-commutativeN/A

              \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            11. lower-*.f64N/A

              \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            12. pow1/2N/A

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            13. lower-sqrt.f64N/A

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            14. lift-/.f64N/A

              \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            15. pow1/2N/A

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            16. lower-sqrt.f64N/A

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6460.7

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
          5. Applied rewrites60.7%

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
          6. Taylor expanded in d around inf

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
          7. Step-by-step derivation
            1. Applied rewrites60.6%

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
          8. Recombined 2 regimes into one program.
          9. Add Preprocessing

          Alternative 19: 45.3% accurate, 3.7× speedup?

          \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{elif}\;d \leq 1.65 \cdot 10^{-281}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
          M_m = (fabs.f64 M)
          D_m = (fabs.f64 D)
          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          (FPCore (d h l M_m D_m)
           :precision binary64
           (if (<= d -2.5e+69)
             (* (- (sqrt (/ 1.0 (* l h)))) d)
             (if (<= d 1.65e-281)
               (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
               (/ (* 1.0 d) (* (sqrt h) (sqrt l))))))
          M_m = fabs(M);
          D_m = fabs(D);
          assert(d < h && h < l && l < M_m && M_m < D_m);
          double code(double d, double h, double l, double M_m, double D_m) {
          	double tmp;
          	if (d <= -2.5e+69) {
          		tmp = -sqrt((1.0 / (l * h))) * d;
          	} else if (d <= 1.65e-281) {
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
          	} else {
          		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
          	}
          	return tmp;
          }
          
          M_m =     private
          D_m =     private
          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m_m, d_m)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m_m
              real(8), intent (in) :: d_m
              real(8) :: tmp
              if (d <= (-2.5d+69)) then
                  tmp = -sqrt((1.0d0 / (l * h))) * d
              else if (d <= 1.65d-281) then
                  tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
              else
                  tmp = (1.0d0 * d) / (sqrt(h) * sqrt(l))
              end if
              code = tmp
          end function
          
          M_m = Math.abs(M);
          D_m = Math.abs(D);
          assert d < h && h < l && l < M_m && M_m < D_m;
          public static double code(double d, double h, double l, double M_m, double D_m) {
          	double tmp;
          	if (d <= -2.5e+69) {
          		tmp = -Math.sqrt((1.0 / (l * h))) * d;
          	} else if (d <= 1.65e-281) {
          		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
          	} else {
          		tmp = (1.0 * d) / (Math.sqrt(h) * Math.sqrt(l));
          	}
          	return tmp;
          }
          
          M_m = math.fabs(M)
          D_m = math.fabs(D)
          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
          def code(d, h, l, M_m, D_m):
          	tmp = 0
          	if d <= -2.5e+69:
          		tmp = -math.sqrt((1.0 / (l * h))) * d
          	elif d <= 1.65e-281:
          		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
          	else:
          		tmp = (1.0 * d) / (math.sqrt(h) * math.sqrt(l))
          	return tmp
          
          M_m = abs(M)
          D_m = abs(D)
          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
          function code(d, h, l, M_m, D_m)
          	tmp = 0.0
          	if (d <= -2.5e+69)
          		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
          	elseif (d <= 1.65e-281)
          		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
          	else
          		tmp = Float64(Float64(1.0 * d) / Float64(sqrt(h) * sqrt(l)));
          	end
          	return tmp
          end
          
          M_m = abs(M);
          D_m = abs(D);
          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
          function tmp_2 = code(d, h, l, M_m, D_m)
          	tmp = 0.0;
          	if (d <= -2.5e+69)
          		tmp = -sqrt((1.0 / (l * h))) * d;
          	elseif (d <= 1.65e-281)
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
          	else
          		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
          	end
          	tmp_2 = tmp;
          end
          
          M_m = N[Abs[M], $MachinePrecision]
          D_m = N[Abs[D], $MachinePrecision]
          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -2.5e+69], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], If[LessEqual[d, 1.65e-281], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(1.0 * d), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          M_m = \left|M\right|
          \\
          D_m = \left|D\right|
          \\
          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;d \leq -2.5 \cdot 10^{+69}:\\
          \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
          
          \mathbf{elif}\;d \leq 1.65 \cdot 10^{-281}:\\
          \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if d < -2.50000000000000018e69

            1. Initial program 75.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. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              6. lower-*.f646.8

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            4. Applied rewrites6.8%

              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
            5. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            6. Step-by-step derivation
              1. sqrt-pow2N/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
              2. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
              3. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
              4. *-commutativeN/A

                \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
              6. lower-neg.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. *-commutativeN/A

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              8. lower-sqrt.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              9. lift-/.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              10. lift-*.f6463.0

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
            7. Applied rewrites63.0%

              \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

            if -2.50000000000000018e69 < d < 1.65e-281

            1. Initial program 60.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. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
              2. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
              3. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              4. lift-pow.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
              5. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              6. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              7. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              8. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{h}{\ell}}\right) \]
              9. associate-*r/N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
              10. lower-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            3. Applied rewrites59.6%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}}\right) \]
            4. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              2. lift-/.f64N/A

                \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              3. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              4. metadata-evalN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              5. lift-pow.f64N/A

                \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              6. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              7. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              8. metadata-evalN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              9. lift-pow.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              10. *-commutativeN/A

                \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              11. lower-*.f64N/A

                \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              12. pow1/2N/A

                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              13. lower-sqrt.f64N/A

                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              14. lift-/.f64N/A

                \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              15. pow1/2N/A

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              16. lower-sqrt.f64N/A

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
              17. lift-/.f6459.6

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
            5. Applied rewrites59.6%

              \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left(\left(\left(M \cdot \frac{D}{d + d}\right) \cdot \left(M \cdot \frac{D}{d + d}\right)\right) \cdot 0.5\right) \cdot h}{\ell}\right) \]
            6. Taylor expanded in d around inf

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
            7. Step-by-step derivation
              1. Applied rewrites28.2%

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]

              if 1.65e-281 < d

              1. Initial program 67.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. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6442.3

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites42.3%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Step-by-step derivation
                1. lift-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                2. lift-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                3. lift-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                4. sqrt-divN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
                6. metadata-evalN/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                8. *-commutativeN/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                9. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                10. lift-*.f6442.4

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              6. Applied rewrites42.4%

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot \color{blue}{d} \]
                2. lift-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                3. lift-*.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                4. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                5. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                6. *-commutativeN/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
                8. lower-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
                9. lower-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                10. lower-*.f6442.4

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
              8. Applied rewrites42.4%

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              9. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                2. lift-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                3. sqrt-prodN/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
                5. lower-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\color{blue}{\ell}}} \]
                6. lower-sqrt.f6450.6

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}} \]
              10. Applied rewrites50.6%

                \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 20: 44.8% accurate, 5.2× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (if (<= l 4.1e-219)
               (* (- (sqrt (/ 1.0 (* l h)))) d)
               (/ (* 1.0 d) (* (sqrt h) (sqrt l)))))
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
            	}
            	return tmp;
            }
            
            M_m =     private
            D_m =     private
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m_m, d_m)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                real(8) :: tmp
                if (l <= 4.1d-219) then
                    tmp = -sqrt((1.0d0 / (l * h))) * d
                else
                    tmp = (1.0d0 * d) / (sqrt(h) * sqrt(l))
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            assert d < h && h < l && l < M_m && M_m < D_m;
            public static double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -Math.sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = (1.0 * d) / (Math.sqrt(h) * Math.sqrt(l));
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
            def code(d, h, l, M_m, D_m):
            	tmp = 0
            	if l <= 4.1e-219:
            		tmp = -math.sqrt((1.0 / (l * h))) * d
            	else:
            		tmp = (1.0 * d) / (math.sqrt(h) * math.sqrt(l))
            	return tmp
            
            M_m = abs(M)
            D_m = abs(D)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	tmp = 0.0
            	if (l <= 4.1e-219)
            		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
            	else
            		tmp = Float64(Float64(1.0 * d) / Float64(sqrt(h) * sqrt(l)));
            	end
            	return tmp
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
            function tmp_2 = code(d, h, l, M_m, D_m)
            	tmp = 0.0;
            	if (l <= 4.1e-219)
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	else
            		tmp = (1.0 * d) / (sqrt(h) * sqrt(l));
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 4.1e-219], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(N[(1.0 * d), $MachinePrecision] / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\
            \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if l < 4.1e-219

              1. Initial program 67.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. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6412.3

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites12.3%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Taylor expanded in h around -inf

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
              6. Step-by-step derivation
                1. sqrt-pow2N/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
                2. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
                3. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
                4. *-commutativeN/A

                  \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                5. mul-1-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
                6. lower-neg.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                7. *-commutativeN/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                8. lower-sqrt.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                9. lift-/.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                10. lift-*.f6439.8

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              7. Applied rewrites39.8%

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

              if 4.1e-219 < l

              1. Initial program 65.3%

                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              2. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6443.9

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites43.9%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Step-by-step derivation
                1. lift-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                2. lift-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                3. lift-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                4. sqrt-divN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
                6. metadata-evalN/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                8. *-commutativeN/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                9. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                10. lift-*.f6443.9

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              6. Applied rewrites43.9%

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot \color{blue}{d} \]
                2. lift-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                3. lift-*.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                4. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                5. associate-*l/N/A

                  \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                6. *-commutativeN/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
                8. lower-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
                9. lower-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                10. lower-*.f6444.0

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
              8. Applied rewrites44.0%

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              9. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                2. lift-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
                3. sqrt-prodN/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
                4. lower-*.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
                5. lower-sqrt.f64N/A

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\color{blue}{\ell}}} \]
                6. lower-sqrt.f6451.9

                  \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \sqrt{\ell}} \]
              10. Applied rewrites51.9%

                \[\leadsto \frac{1 \cdot d}{\sqrt{h} \cdot \color{blue}{\sqrt{\ell}}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 21: 44.8% accurate, 5.2× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (if (<= l 4.1e-219)
               (* (- (sqrt (/ 1.0 (* l h)))) d)
               (* (/ 1.0 (* (sqrt l) (sqrt h))) d)))
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
            	}
            	return tmp;
            }
            
            M_m =     private
            D_m =     private
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m_m, d_m)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                real(8) :: tmp
                if (l <= 4.1d-219) then
                    tmp = -sqrt((1.0d0 / (l * h))) * d
                else
                    tmp = (1.0d0 / (sqrt(l) * sqrt(h))) * d
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            assert d < h && h < l && l < M_m && M_m < D_m;
            public static double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -Math.sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = (1.0 / (Math.sqrt(l) * Math.sqrt(h))) * d;
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
            def code(d, h, l, M_m, D_m):
            	tmp = 0
            	if l <= 4.1e-219:
            		tmp = -math.sqrt((1.0 / (l * h))) * d
            	else:
            		tmp = (1.0 / (math.sqrt(l) * math.sqrt(h))) * d
            	return tmp
            
            M_m = abs(M)
            D_m = abs(D)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	tmp = 0.0
            	if (l <= 4.1e-219)
            		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
            	else
            		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
            	end
            	return tmp
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
            function tmp_2 = code(d, h, l, M_m, D_m)
            	tmp = 0.0;
            	if (l <= 4.1e-219)
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	else
            		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 4.1e-219], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\
            \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if l < 4.1e-219

              1. Initial program 67.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. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6412.3

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites12.3%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Taylor expanded in h around -inf

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
              6. Step-by-step derivation
                1. sqrt-pow2N/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
                2. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
                3. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
                4. *-commutativeN/A

                  \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                5. mul-1-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
                6. lower-neg.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                7. *-commutativeN/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                8. lower-sqrt.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                9. lift-/.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                10. lift-*.f6439.8

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              7. Applied rewrites39.8%

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

              if 4.1e-219 < l

              1. Initial program 65.3%

                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              2. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6443.9

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites43.9%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Step-by-step derivation
                1. lift-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                2. lift-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                3. lift-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                4. sqrt-divN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
                6. metadata-evalN/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                8. *-commutativeN/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                9. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                10. lift-*.f6443.9

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              6. Applied rewrites43.9%

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                2. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                3. sqrt-prodN/A

                  \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                4. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                5. lift-sqrt.f64N/A

                  \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                6. lift-*.f6451.8

                  \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
              8. Applied rewrites51.8%

                \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 22: 41.7% accurate, 5.5× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (if (<= l 4.1e-219)
               (* (- (sqrt (/ 1.0 (* l h)))) d)
               (* (sqrt (/ (/ 1.0 l) h)) d)))
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = sqrt(((1.0 / l) / h)) * d;
            	}
            	return tmp;
            }
            
            M_m =     private
            D_m =     private
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m_m, d_m)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                real(8) :: tmp
                if (l <= 4.1d-219) then
                    tmp = -sqrt((1.0d0 / (l * h))) * d
                else
                    tmp = sqrt(((1.0d0 / l) / h)) * d
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            assert d < h && h < l && l < M_m && M_m < D_m;
            public static double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= 4.1e-219) {
            		tmp = -Math.sqrt((1.0 / (l * h))) * d;
            	} else {
            		tmp = Math.sqrt(((1.0 / l) / h)) * d;
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
            def code(d, h, l, M_m, D_m):
            	tmp = 0
            	if l <= 4.1e-219:
            		tmp = -math.sqrt((1.0 / (l * h))) * d
            	else:
            		tmp = math.sqrt(((1.0 / l) / h)) * d
            	return tmp
            
            M_m = abs(M)
            D_m = abs(D)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	tmp = 0.0
            	if (l <= 4.1e-219)
            		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(l * h)))) * d);
            	else
            		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
            	end
            	return tmp
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
            function tmp_2 = code(d, h, l, M_m, D_m)
            	tmp = 0.0;
            	if (l <= 4.1e-219)
            		tmp = -sqrt((1.0 / (l * h))) * d;
            	else
            		tmp = sqrt(((1.0 / l) / h)) * d;
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 4.1e-219], N[((-N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;\ell \leq 4.1 \cdot 10^{-219}:\\
            \;\;\;\;\left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d\\
            
            \mathbf{else}:\\
            \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if l < 4.1e-219

              1. Initial program 67.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. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6412.3

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites12.3%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Taylor expanded in h around -inf

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
              6. Step-by-step derivation
                1. sqrt-pow2N/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
                2. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
                3. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
                4. *-commutativeN/A

                  \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                5. mul-1-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
                6. lower-neg.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
                7. *-commutativeN/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                8. lower-sqrt.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                9. lift-/.f64N/A

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
                10. lift-*.f6439.8

                  \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]
              7. Applied rewrites39.8%

                \[\leadsto \left(-\sqrt{\frac{1}{\ell \cdot h}}\right) \cdot d \]

              if 4.1e-219 < l

              1. Initial program 65.3%

                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              2. Taylor expanded in d around inf

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                6. lower-*.f6443.9

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. Applied rewrites43.9%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                2. lift-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
                3. associate-/r*N/A

                  \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
                5. lower-/.f6444.4

                  \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
              6. Applied rewrites44.4%

                \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 23: 25.4% accurate, 7.7× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \sqrt{\frac{1}{\ell \cdot h}} \cdot d \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m) :precision binary64 (* (sqrt (/ 1.0 (* l h))) d))
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	return sqrt((1.0 / (l * h))) * d;
            }
            
            M_m =     private
            D_m =     private
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m_m, d_m)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                code = sqrt((1.0d0 / (l * h))) * d
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            assert d < h && h < l && l < M_m && M_m < D_m;
            public static double code(double d, double h, double l, double M_m, double D_m) {
            	return Math.sqrt((1.0 / (l * h))) * d;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
            def code(d, h, l, M_m, D_m):
            	return math.sqrt((1.0 / (l * h))) * d
            
            M_m = abs(M)
            D_m = abs(D)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	return Float64(sqrt(Float64(1.0 / Float64(l * h))) * d)
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
            function tmp = code(d, h, l, M_m, D_m)
            	tmp = sqrt((1.0 / (l * h))) * d;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \sqrt{\frac{1}{\ell \cdot h}} \cdot d
            \end{array}
            
            Derivation
            1. Initial program 66.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. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              6. lower-*.f6425.4

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            4. Applied rewrites25.4%

              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
            5. Add Preprocessing

            Alternative 24: 25.3% accurate, 10.2× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m) :precision binary64 (/ d (sqrt (* l h))))
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	return d / sqrt((l * h));
            }
            
            M_m =     private
            D_m =     private
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m_m, d_m)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                code = d / sqrt((l * h))
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            assert d < h && h < l && l < M_m && M_m < D_m;
            public static double code(double d, double h, double l, double M_m, double D_m) {
            	return d / Math.sqrt((l * h));
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
            def code(d, h, l, M_m, D_m):
            	return d / math.sqrt((l * h))
            
            M_m = abs(M)
            D_m = abs(D)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	return Float64(d / sqrt(Float64(l * h)))
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
            function tmp = code(d, h, l, M_m, D_m)
            	tmp = d / sqrt((l * h));
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \frac{d}{\sqrt{\ell \cdot h}}
            \end{array}
            
            Derivation
            1. Initial program 66.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. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              6. lower-*.f6425.4

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            4. Applied rewrites25.4%

              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
            5. Step-by-step derivation
              1. lift-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              2. lift-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              3. lift-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. sqrt-divN/A

                \[\leadsto \frac{\sqrt{1}}{\sqrt{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
              6. metadata-evalN/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              7. lower-/.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              8. *-commutativeN/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              9. lift-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              10. lift-*.f6425.2

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
            6. Applied rewrites25.2%

              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot \color{blue}{d} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              3. lift-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              4. lift-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              5. associate-*l/N/A

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
              6. *-commutativeN/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
              7. lower-/.f64N/A

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              9. lower-sqrt.f64N/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
              10. lower-*.f6425.3

                \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
            8. Applied rewrites25.3%

              \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
            9. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              2. *-lft-identity25.3

                \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              3. lift-*.f64N/A

                \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
              4. *-commutativeN/A

                \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
              5. lift-*.f6425.3

                \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
            10. Applied rewrites25.3%

              \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
            11. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025115 
            (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)))))