Henrywood and Agarwal, Equation (12)

Percentage Accurate: 35.4% → 75.8%
Time: 12.1s
Alternatives: 18
Speedup: 10.2×

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 18 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: 35.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
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: 75.8% accurate, 1.5× speedup?

\[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h} \cdot \ell}\\ \mathbf{if}\;h \leq -1 \cdot 10^{+225}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(\ell \cdot d\_m\right) \cdot t\_0}, 0.125, \frac{-d\_m}{t\_0 \cdot h}\right)\\ \mathbf{elif}\;h \leq 2.7 \cdot 10^{-298}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{t\_0}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (* (/ 1.0 h) l))))
   (if (<= h -1e+225)
     (fma
      (/ (* (* M_m M_m) (* D_m D_m)) (* (* l d_m) t_0))
      0.125
      (/ (- d_m) (* t_0 h)))
     (if (<= h 2.7e-298)
       (*
        (* (sqrt (/ 1.0 (* l h))) d_m)
        (-
         1.0
         (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0)) (/ h l))))
       (fma
        (* (* (* (/ M_m (* l d_m)) (/ M_m t_0)) -0.125) D_m)
        D_m
        (/ d_m (* (sqrt l) (sqrt h))))))))
d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt(((1.0 / h) * l));
	double tmp;
	if (h <= -1e+225) {
		tmp = fma((((M_m * M_m) * (D_m * D_m)) / ((l * d_m) * t_0)), 0.125, (-d_m / (t_0 * h)));
	} else if (h <= 2.7e-298) {
		tmp = (sqrt((1.0 / (l * h))) * d_m) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
	} else {
		tmp = fma(((((M_m / (l * d_m)) * (M_m / t_0)) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
	}
	return tmp;
}
d_m = abs(d)
M_m = abs(M)
D_m = abs(D)
d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
function code(d_m, h, l, M_m, D_m)
	t_0 = sqrt(Float64(Float64(1.0 / h) * l))
	tmp = 0.0
	if (h <= -1e+225)
		tmp = fma(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(l * d_m) * t_0)), 0.125, Float64(Float64(-d_m) / Float64(t_0 * h)));
	elseif (h <= 2.7e-298)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0)) * Float64(h / l))));
	else
		tmp = fma(Float64(Float64(Float64(Float64(M_m / Float64(l * d_m)) * Float64(M_m / t_0)) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
	end
	return tmp
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1e+225], N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.125 + N[((-d$95$m) / N[(t$95$0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.7e-298], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $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$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / t$95$0), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h} \cdot \ell}\\
\mathbf{if}\;h \leq -1 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(\ell \cdot d\_m\right) \cdot t\_0}, 0.125, \frac{-d\_m}{t\_0 \cdot h}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{t\_0}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -9.99999999999999928e224

    1. Initial program 35.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)}, \frac{1}{8}, -1 \cdot \frac{d}{h \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)}\right) \]
    6. Applied rewrites27.1%

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

    if -9.99999999999999928e224 < h < 2.7000000000000001e-298

    1. Initial program 35.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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 - \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({\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-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) \]
      4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

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

    if 2.7000000000000001e-298 < h

    1. Initial program 35.4%

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

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

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

      \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      9. sqrt-unprodN/A

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      12. lower-/.f6437.6

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    6. Applied rewrites37.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      8. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      17. lift-sqrt.f6441.1

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

      \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 75.7% accurate, 1.5× speedup?

\[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h} \cdot \ell}\\ \mathbf{if}\;h \leq -1 \cdot 10^{+225}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(\ell \cdot d\_m\right) \cdot t\_0}, 0.125, \frac{-d\_m}{t\_0 \cdot h}\right)\\ \mathbf{elif}\;h \leq 2.7 \cdot 10^{-298}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{t\_0}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
d_m = (fabs.f64 d)
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d_m h l M_m D_m)
 :precision binary64
 (let* ((t_0 (sqrt (* (/ 1.0 h) l))))
   (if (<= h -1e+225)
     (fma
      (/ (* (* M_m M_m) (* D_m D_m)) (* (* l d_m) t_0))
      0.125
      (/ (- d_m) (* t_0 h)))
     (if (<= h 2.7e-298)
       (*
        (/ (fabs d_m) (sqrt (* l h)))
        (-
         1.0
         (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0)) (/ h l))))
       (fma
        (* (* (* (/ M_m (* l d_m)) (/ M_m t_0)) -0.125) D_m)
        D_m
        (/ d_m (* (sqrt l) (sqrt h))))))))
d_m = fabs(d);
M_m = fabs(M);
D_m = fabs(D);
assert(d_m < h && h < l && l < M_m && M_m < D_m);
double code(double d_m, double h, double l, double M_m, double D_m) {
	double t_0 = sqrt(((1.0 / h) * l));
	double tmp;
	if (h <= -1e+225) {
		tmp = fma((((M_m * M_m) * (D_m * D_m)) / ((l * d_m) * t_0)), 0.125, (-d_m / (t_0 * h)));
	} else if (h <= 2.7e-298) {
		tmp = (fabs(d_m) / sqrt((l * h))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
	} else {
		tmp = fma(((((M_m / (l * d_m)) * (M_m / t_0)) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
	}
	return tmp;
}
d_m = abs(d)
M_m = abs(M)
D_m = abs(D)
d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
function code(d_m, h, l, M_m, D_m)
	t_0 = sqrt(Float64(Float64(1.0 / h) * l))
	tmp = 0.0
	if (h <= -1e+225)
		tmp = fma(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(l * d_m) * t_0)), 0.125, Float64(Float64(-d_m) / Float64(t_0 * h)));
	elseif (h <= 2.7e-298)
		tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) ^ 2.0)) * Float64(h / l))));
	else
		tmp = fma(Float64(Float64(Float64(Float64(M_m / Float64(l * d_m)) * Float64(M_m / t_0)) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
	end
	return tmp
end
d_m = N[Abs[d], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1e+225], N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.125 + N[((-d$95$m) / N[(t$95$0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.7e-298], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $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$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / t$95$0), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
d_m = \left|d\right|
\\
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{h} \cdot \ell}\\
\mathbf{if}\;h \leq -1 \cdot 10^{+225}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(\ell \cdot d\_m\right) \cdot t\_0}, 0.125, \frac{-d\_m}{t\_0 \cdot h}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{t\_0}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -9.99999999999999928e224

    1. Initial program 35.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)}, \frac{1}{8}, -1 \cdot \frac{d}{h \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)}\right) \]
    6. Applied rewrites27.1%

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

    if -9.99999999999999928e224 < h < 2.7000000000000001e-298

    1. Initial program 35.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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 - \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({\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-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) \]
      4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

        \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      19. lower-*.f6469.6

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

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

    if 2.7000000000000001e-298 < h

    1. Initial program 35.4%

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

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

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

      \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      9. sqrt-unprodN/A

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      12. lower-/.f6437.6

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    6. Applied rewrites37.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      8. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      17. lift-sqrt.f6441.1

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

      \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 75.5% accurate, 1.6× speedup?

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

\mathbf{elif}\;h \leq 2.7 \cdot 10^{-298}:\\
\;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \left(1 - \left(\frac{1}{2} \cdot \left(t\_1 \cdot t\_1\right)\right) \cdot \frac{h}{\ell}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{t\_0}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -9.99999999999999928e224

    1. Initial program 35.4%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{D}^{2} \cdot {M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)}, \frac{1}{8}, -1 \cdot \frac{d}{h \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)}\right) \]
    6. Applied rewrites27.1%

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

    if -9.99999999999999928e224 < h < 2.7000000000000001e-298

    1. Initial program 35.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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 - \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({\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-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) \]
      4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

        \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      19. lower-*.f6469.6

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

      \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \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) \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \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) \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \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) \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \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. unpow2N/A

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

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

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

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

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \left(1 - \left(\frac{1}{2} \cdot \left(\left(M \cdot \color{blue}{\frac{D}{2 \cdot d}}\right) \cdot \frac{M \cdot D}{2 \cdot d}\right)\right) \cdot \frac{h}{\ell}\right) \]
      10. count-2-revN/A

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

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

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

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

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

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

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

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

    if 2.7000000000000001e-298 < h

    1. Initial program 35.4%

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

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

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

      \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      9. sqrt-unprodN/A

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      12. lower-/.f6437.6

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    6. Applied rewrites37.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      8. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      17. lift-sqrt.f6441.1

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

      \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 69.8% accurate, 1.7× speedup?

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

\mathbf{elif}\;h \leq -2 \cdot 10^{-226}:\\
\;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-302}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -5.00000000000000001e-168

    1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

    if -5.00000000000000001e-168 < h < -1.99999999999999984e-226

    1. Initial program 35.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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 - \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({\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-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) \]
      4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

        \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      19. lower-*.f6469.6

        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

      \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, \color{blue}{h}, 1\right) \]
    8. Applied rewrites49.1%

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

    if -1.99999999999999984e-226 < h < -1.9999999999999999e-302

    1. Initial program 35.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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 - \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({\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-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) \]
      4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

        \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

      \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
    8. Step-by-step derivation
      1. Applied rewrites42.7%

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

      if -1.9999999999999999e-302 < h

      1. Initial program 35.4%

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      5. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        9. sqrt-unprodN/A

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

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

          \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        12. lower-/.f6437.6

          \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      6. Applied rewrites37.6%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        8. times-fracN/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        17. lift-sqrt.f6441.1

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

        \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
    9. Recombined 4 regimes into one program.
    10. Add Preprocessing

    Alternative 5: 69.3% accurate, 1.7× speedup?

    \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{+85}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-122}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \left(D\_m \cdot D\_m\right)}{t\_0 \cdot d\_m}, -0.125, \frac{\ell \cdot d\_m}{t\_0}\right)}{\ell}\\ \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-308}:\\ \;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
    d_m = (fabs.f64 d)
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    (FPCore (d_m h l M_m D_m)
     :precision binary64
     (let* ((t_0 (sqrt (* l h))))
       (if (<= l -1e+85)
         (* (* (sqrt (/ 1.0 (* l h))) d_m) 1.0)
         (if (<= l -5e-122)
           (/
            (fma
             (/ (* (* (* M_m M_m) h) (* D_m D_m)) (* t_0 d_m))
             -0.125
             (/ (* l d_m) t_0))
            l)
           (if (<= l 9.5e-308)
             (*
              (/ (fabs d_m) t_0)
              (fma
               (* (/ (* (* M_m M_m) (* D_m D_m)) (* (* d_m d_m) l)) -0.125)
               h
               1.0))
             (fma
              (*
               (* (* (/ M_m (* l d_m)) (/ M_m (sqrt (* (/ 1.0 h) l)))) -0.125)
               D_m)
              D_m
              (/ d_m (* (sqrt l) (sqrt h)))))))))
    d_m = fabs(d);
    M_m = fabs(M);
    D_m = fabs(D);
    assert(d_m < h && h < l && l < M_m && M_m < D_m);
    double code(double d_m, double h, double l, double M_m, double D_m) {
    	double t_0 = sqrt((l * h));
    	double tmp;
    	if (l <= -1e+85) {
    		tmp = (sqrt((1.0 / (l * h))) * d_m) * 1.0;
    	} else if (l <= -5e-122) {
    		tmp = fma(((((M_m * M_m) * h) * (D_m * D_m)) / (t_0 * d_m)), -0.125, ((l * d_m) / t_0)) / l;
    	} else if (l <= 9.5e-308) {
    		tmp = (fabs(d_m) / t_0) * fma(((((M_m * M_m) * (D_m * D_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
    	} else {
    		tmp = fma(((((M_m / (l * d_m)) * (M_m / sqrt(((1.0 / h) * l)))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
    	}
    	return tmp;
    }
    
    d_m = abs(d)
    M_m = abs(M)
    D_m = abs(D)
    d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
    function code(d_m, h, l, M_m, D_m)
    	t_0 = sqrt(Float64(l * h))
    	tmp = 0.0
    	if (l <= -1e+85)
    		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * 1.0);
    	elseif (l <= -5e-122)
    		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * M_m) * h) * Float64(D_m * D_m)) / Float64(t_0 * d_m)), -0.125, Float64(Float64(l * d_m) / t_0)) / l);
    	elseif (l <= 9.5e-308)
    		tmp = Float64(Float64(abs(d_m) / t_0) * fma(Float64(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0));
    	else
    		tmp = fma(Float64(Float64(Float64(Float64(M_m / Float64(l * d_m)) * Float64(M_m / sqrt(Float64(Float64(1.0 / h) * l)))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
    	end
    	return tmp
    end
    
    d_m = N[Abs[d], $MachinePrecision]
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
    code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e+85], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, -5e-122], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125 + N[(N[(l * d$95$m), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[l, 9.5e-308], N[(N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    d_m = \left|d\right|
    \\
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
    \\
    \begin{array}{l}
    t_0 := \sqrt{\ell \cdot h}\\
    \mathbf{if}\;\ell \leq -1 \cdot 10^{+85}:\\
    \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\
    
    \mathbf{elif}\;\ell \leq -5 \cdot 10^{-122}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \left(D\_m \cdot D\_m\right)}{t\_0 \cdot d\_m}, -0.125, \frac{\ell \cdot d\_m}{t\_0}\right)}{\ell}\\
    
    \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-308}:\\
    \;\;\;\;\frac{\left|d\_m\right|}{t\_0} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if l < -1e85

      1. Initial program 35.4%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Step-by-step derivation
        1. 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 - \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({\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-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) \]
        4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

        \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
        1. times-fracN/A

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

          \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

        \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
      8. Step-by-step derivation
        1. Applied rewrites42.7%

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

        if -1e85 < l < -4.9999999999999999e-122

        1. Initial program 35.4%

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

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

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

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

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

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

        if -4.9999999999999999e-122 < l < 9.49999999999999963e-308

        1. Initial program 35.4%

          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        2. Step-by-step derivation
          1. 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 - \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({\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-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) \]
          4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

          \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
          1. lift-sqrt.f64N/A

            \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

            \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

            \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

            \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          19. lower-*.f6469.6

            \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

          \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, \color{blue}{h}, 1\right) \]
        8. Applied rewrites49.1%

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

        if 9.49999999999999963e-308 < l

        1. Initial program 35.4%

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        5. Step-by-step derivation
          1. lower-/.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          9. sqrt-unprodN/A

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          12. lower-/.f6437.6

            \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        6. Applied rewrites37.6%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          8. times-fracN/A

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          17. lift-sqrt.f6441.1

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

          \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
      9. Recombined 4 regimes into one program.
      10. Add Preprocessing

      Alternative 6: 67.9% accurate, 1.8× speedup?

      \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-308}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
      d_m = (fabs.f64 d)
      M_m = (fabs.f64 M)
      D_m = (fabs.f64 D)
      NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d_m h l M_m D_m)
       :precision binary64
       (if (<= l -1e-21)
         (* (* (sqrt (/ 1.0 (* l h))) d_m) 1.0)
         (if (<= l 9.5e-308)
           (*
            (/ (fabs d_m) (sqrt (* l h)))
            (fma (* (/ (* (* M_m M_m) (* D_m D_m)) (* (* d_m d_m) l)) -0.125) h 1.0))
           (fma
            (* (* (* (/ M_m (* l d_m)) (/ M_m (sqrt (* (/ 1.0 h) l)))) -0.125) D_m)
            D_m
            (/ d_m (* (sqrt l) (sqrt h)))))))
      d_m = fabs(d);
      M_m = fabs(M);
      D_m = fabs(D);
      assert(d_m < h && h < l && l < M_m && M_m < D_m);
      double code(double d_m, double h, double l, double M_m, double D_m) {
      	double tmp;
      	if (l <= -1e-21) {
      		tmp = (sqrt((1.0 / (l * h))) * d_m) * 1.0;
      	} else if (l <= 9.5e-308) {
      		tmp = (fabs(d_m) / sqrt((l * h))) * fma(((((M_m * M_m) * (D_m * D_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
      	} else {
      		tmp = fma(((((M_m / (l * d_m)) * (M_m / sqrt(((1.0 / h) * l)))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
      	}
      	return tmp;
      }
      
      d_m = abs(d)
      M_m = abs(M)
      D_m = abs(D)
      d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
      function code(d_m, h, l, M_m, D_m)
      	tmp = 0.0
      	if (l <= -1e-21)
      		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * 1.0);
      	elseif (l <= 9.5e-308)
      		tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0));
      	else
      		tmp = fma(Float64(Float64(Float64(Float64(M_m / Float64(l * d_m)) * Float64(M_m / sqrt(Float64(Float64(1.0 / h) * l)))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
      	end
      	return tmp
      end
      
      d_m = N[Abs[d], $MachinePrecision]
      M_m = N[Abs[M], $MachinePrecision]
      D_m = N[Abs[D], $MachinePrecision]
      NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1e-21], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, 9.5e-308], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      d_m = \left|d\right|
      \\
      M_m = \left|M\right|
      \\
      D_m = \left|D\right|
      \\
      [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\
      \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\
      
      \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-308}:\\
      \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{M\_m}{\ell \cdot d\_m} \cdot \frac{M\_m}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if l < -9.99999999999999908e-22

        1. Initial program 35.4%

          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        2. Step-by-step derivation
          1. 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 - \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({\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-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) \]
          4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

          \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

          \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
          1. times-fracN/A

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

            \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

            \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

          \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

          \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
        8. Step-by-step derivation
          1. Applied rewrites42.7%

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

          if -9.99999999999999908e-22 < l < 9.49999999999999963e-308

          1. Initial program 35.4%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Step-by-step derivation
            1. 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 - \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({\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-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) \]
            4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

            \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
            1. lift-sqrt.f64N/A

              \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

              \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

              \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

              \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            19. lower-*.f6469.6

              \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

            \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, \color{blue}{h}, 1\right) \]
          8. Applied rewrites49.1%

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

          if 9.49999999999999963e-308 < l

          1. Initial program 35.4%

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          5. Step-by-step derivation
            1. lower-/.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            9. sqrt-unprodN/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            12. lower-/.f6437.6

              \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          6. Applied rewrites37.6%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            8. times-fracN/A

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            17. lift-sqrt.f6441.1

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

            \[\leadsto \mathsf{fma}\left(\left(\left(\frac{M}{\ell \cdot d} \cdot \frac{M}{\sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
        9. Recombined 3 regimes into one program.
        10. Add Preprocessing

        Alternative 7: 65.8% accurate, 1.9× speedup?

        \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq 1.06 \cdot 10^{-259}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M\_m \cdot \frac{M\_m}{\left(\sqrt{\frac{1}{h} \cdot \ell} \cdot \ell\right) \cdot d\_m}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
        d_m = (fabs.f64 d)
        M_m = (fabs.f64 M)
        D_m = (fabs.f64 D)
        NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        (FPCore (d_m h l M_m D_m)
         :precision binary64
         (if (<= l -1e-21)
           (* (* (sqrt (/ 1.0 (* l h))) d_m) 1.0)
           (if (<= l 1.06e-259)
             (*
              (/ (fabs d_m) (sqrt (* l h)))
              (fma (* (/ (* (* M_m M_m) (* D_m D_m)) (* (* d_m d_m) l)) -0.125) h 1.0))
             (fma
              (* (* (* M_m (/ M_m (* (* (sqrt (* (/ 1.0 h) l)) l) d_m))) -0.125) D_m)
              D_m
              (/ d_m (* (sqrt l) (sqrt h)))))))
        d_m = fabs(d);
        M_m = fabs(M);
        D_m = fabs(D);
        assert(d_m < h && h < l && l < M_m && M_m < D_m);
        double code(double d_m, double h, double l, double M_m, double D_m) {
        	double tmp;
        	if (l <= -1e-21) {
        		tmp = (sqrt((1.0 / (l * h))) * d_m) * 1.0;
        	} else if (l <= 1.06e-259) {
        		tmp = (fabs(d_m) / sqrt((l * h))) * fma(((((M_m * M_m) * (D_m * D_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
        	} else {
        		tmp = fma((((M_m * (M_m / ((sqrt(((1.0 / h) * l)) * l) * d_m))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
        	}
        	return tmp;
        }
        
        d_m = abs(d)
        M_m = abs(M)
        D_m = abs(D)
        d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
        function code(d_m, h, l, M_m, D_m)
        	tmp = 0.0
        	if (l <= -1e-21)
        		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * 1.0);
        	elseif (l <= 1.06e-259)
        		tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0));
        	else
        		tmp = fma(Float64(Float64(Float64(M_m * Float64(M_m / Float64(Float64(sqrt(Float64(Float64(1.0 / h) * l)) * l) * d_m))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
        	end
        	return tmp
        end
        
        d_m = N[Abs[d], $MachinePrecision]
        M_m = N[Abs[M], $MachinePrecision]
        D_m = N[Abs[D], $MachinePrecision]
        NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1e-21], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, 1.06e-259], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(M$95$m * N[(M$95$m / N[(N[(N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision] * d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        d_m = \left|d\right|
        \\
        M_m = \left|M\right|
        \\
        D_m = \left|D\right|
        \\
        [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\
        \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\
        
        \mathbf{elif}\;\ell \leq 1.06 \cdot 10^{-259}:\\
        \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\left(\left(M\_m \cdot \frac{M\_m}{\left(\sqrt{\frac{1}{h} \cdot \ell} \cdot \ell\right) \cdot d\_m}\right) \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if l < -9.99999999999999908e-22

          1. Initial program 35.4%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Step-by-step derivation
            1. 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 - \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({\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-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) \]
            4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

            \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

            \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
            1. times-fracN/A

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

              \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

            \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

            \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
          8. Step-by-step derivation
            1. Applied rewrites42.7%

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

            if -9.99999999999999908e-22 < l < 1.06e-259

            1. Initial program 35.4%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Step-by-step derivation
              1. 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 - \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({\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-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) \]
              4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

              \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
              1. lift-sqrt.f64N/A

                \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

                \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

                \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

                \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              19. lower-*.f6469.6

                \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

              \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, \color{blue}{h}, 1\right) \]
            8. Applied rewrites49.1%

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

            if 1.06e-259 < l

            1. Initial program 35.4%

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            5. Step-by-step derivation
              1. lower-/.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              9. sqrt-unprodN/A

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              12. lower-/.f6437.6

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            6. Applied rewrites37.6%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot \frac{M}{\left(d \cdot \ell\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}}\right) \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              11. sqrt-prodN/A

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot \frac{M}{\left(\sqrt{\frac{1}{h} \cdot \ell} \cdot \ell\right) \cdot d}\right) \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
          9. Recombined 3 regimes into one program.
          10. Add Preprocessing

          Alternative 8: 64.5% accurate, 2.0× speedup?

          \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq 1.62 \cdot 10^{-257}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
          d_m = (fabs.f64 d)
          M_m = (fabs.f64 M)
          D_m = (fabs.f64 D)
          NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          (FPCore (d_m h l M_m D_m)
           :precision binary64
           (if (<= l -1e-21)
             (* (* (sqrt (/ 1.0 (* l h))) d_m) 1.0)
             (if (<= l 1.62e-257)
               (*
                (/ (fabs d_m) (sqrt (* l h)))
                (fma (* (/ (* (* M_m M_m) (* D_m D_m)) (* (* d_m d_m) l)) -0.125) h 1.0))
               (fma
                (* (* (/ (* M_m M_m) (* (* l d_m) (sqrt (/ l h)))) -0.125) D_m)
                D_m
                (/ d_m (* (sqrt l) (sqrt h)))))))
          d_m = fabs(d);
          M_m = fabs(M);
          D_m = fabs(D);
          assert(d_m < h && h < l && l < M_m && M_m < D_m);
          double code(double d_m, double h, double l, double M_m, double D_m) {
          	double tmp;
          	if (l <= -1e-21) {
          		tmp = (sqrt((1.0 / (l * h))) * d_m) * 1.0;
          	} else if (l <= 1.62e-257) {
          		tmp = (fabs(d_m) / sqrt((l * h))) * fma(((((M_m * M_m) * (D_m * D_m)) / ((d_m * d_m) * l)) * -0.125), h, 1.0);
          	} else {
          		tmp = fma(((((M_m * M_m) / ((l * d_m) * sqrt((l / h)))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
          	}
          	return tmp;
          }
          
          d_m = abs(d)
          M_m = abs(M)
          D_m = abs(D)
          d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
          function code(d_m, h, l, M_m, D_m)
          	tmp = 0.0
          	if (l <= -1e-21)
          		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * 1.0);
          	elseif (l <= 1.62e-257)
          		tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(Float64(M_m * M_m) * Float64(D_m * D_m)) / Float64(Float64(d_m * d_m) * l)) * -0.125), h, 1.0));
          	else
          		tmp = fma(Float64(Float64(Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) * sqrt(Float64(l / h)))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
          	end
          	return tmp
          end
          
          d_m = N[Abs[d], $MachinePrecision]
          M_m = N[Abs[M], $MachinePrecision]
          D_m = N[Abs[D], $MachinePrecision]
          NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1e-21], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, 1.62e-257], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          d_m = \left|d\right|
          \\
          M_m = \left|M\right|
          \\
          D_m = \left|D\right|
          \\
          [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\
          \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\
          
          \mathbf{elif}\;\ell \leq 1.62 \cdot 10^{-257}:\\
          \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot D\_m\right)}{\left(d\_m \cdot d\_m\right) \cdot \ell} \cdot -0.125, h, 1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if l < -9.99999999999999908e-22

            1. Initial program 35.4%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Step-by-step derivation
              1. 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 - \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({\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-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) \]
              4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

              \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

              \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
              1. times-fracN/A

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

                \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

              \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

              \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
            8. Step-by-step derivation
              1. Applied rewrites42.7%

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

              if -9.99999999999999908e-22 < l < 1.6200000000000001e-257

              1. Initial program 35.4%

                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              2. Step-by-step derivation
                1. 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 - \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({\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-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) \]
                4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
                1. lift-sqrt.f64N/A

                  \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

                  \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

                  \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

                  \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                19. lower-*.f6469.6

                  \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

                \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, \color{blue}{h}, 1\right) \]
              8. Applied rewrites49.1%

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

              if 1.6200000000000001e-257 < l

              1. Initial program 35.4%

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              5. Step-by-step derivation
                1. lower-/.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                9. sqrt-unprodN/A

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

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

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                12. lower-/.f6437.6

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              6. Applied rewrites37.6%

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              7. Taylor expanded in h around 0

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              8. Step-by-step derivation
                1. lower-/.f6437.6

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              9. Applied rewrites37.6%

                \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
            9. Recombined 3 regimes into one program.
            10. Add Preprocessing

            Alternative 9: 64.1% accurate, 2.0× speedup?

            \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq 1.62 \cdot 10^{-257}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{\left(d\_m \cdot d\_m\right) \cdot \ell}\right) \cdot -0.125, D\_m \cdot D\_m, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
            d_m = (fabs.f64 d)
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d_m h l M_m D_m)
             :precision binary64
             (if (<= l -1e-21)
               (* (* (sqrt (/ 1.0 (* l h))) d_m) 1.0)
               (if (<= l 1.62e-257)
                 (*
                  (/ (fabs d_m) (sqrt (* l h)))
                  (fma (* (* (* M_m M_m) (/ h (* (* d_m d_m) l))) -0.125) (* D_m D_m) 1.0))
                 (fma
                  (* (* (/ (* M_m M_m) (* (* l d_m) (sqrt (/ l h)))) -0.125) D_m)
                  D_m
                  (/ d_m (* (sqrt l) (sqrt h)))))))
            d_m = fabs(d);
            M_m = fabs(M);
            D_m = fabs(D);
            assert(d_m < h && h < l && l < M_m && M_m < D_m);
            double code(double d_m, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (l <= -1e-21) {
            		tmp = (sqrt((1.0 / (l * h))) * d_m) * 1.0;
            	} else if (l <= 1.62e-257) {
            		tmp = (fabs(d_m) / sqrt((l * h))) * fma((((M_m * M_m) * (h / ((d_m * d_m) * l))) * -0.125), (D_m * D_m), 1.0);
            	} else {
            		tmp = fma(((((M_m * M_m) / ((l * d_m) * sqrt((l / h)))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
            	}
            	return tmp;
            }
            
            d_m = abs(d)
            M_m = abs(M)
            D_m = abs(D)
            d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
            function code(d_m, h, l, M_m, D_m)
            	tmp = 0.0
            	if (l <= -1e-21)
            		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * d_m) * 1.0);
            	elseif (l <= 1.62e-257)
            		tmp = Float64(Float64(abs(d_m) / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(M_m * M_m) * Float64(h / Float64(Float64(d_m * d_m) * l))) * -0.125), Float64(D_m * D_m), 1.0));
            	else
            		tmp = fma(Float64(Float64(Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) * sqrt(Float64(l / h)))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
            	end
            	return tmp
            end
            
            d_m = N[Abs[d], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, -1e-21], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, 1.62e-257], N[(N[(N[Abs[d$95$m], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(h / N[(N[(d$95$m * d$95$m), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            d_m = \left|d\right|
            \\
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\
            \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\_m\right) \cdot 1\\
            
            \mathbf{elif}\;\ell \leq 1.62 \cdot 10^{-257}:\\
            \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{\left(d\_m \cdot d\_m\right) \cdot \ell}\right) \cdot -0.125, D\_m \cdot D\_m, 1\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if l < -9.99999999999999908e-22

              1. Initial program 35.4%

                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              2. Step-by-step derivation
                1. 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 - \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({\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-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) \]
                4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

                \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
                1. times-fracN/A

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

                  \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

                  \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

                \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

                \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
              8. Step-by-step derivation
                1. Applied rewrites42.7%

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

                if -9.99999999999999908e-22 < l < 1.6200000000000001e-257

                1. Initial program 35.4%

                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                2. Step-by-step derivation
                  1. 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 - \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({\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-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) \]
                  4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                  \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Step-by-step derivation
                  1. lift-sqrt.f64N/A

                    \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \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-*.f64N/A

                    \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \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. lift-*.f64N/A

                    \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \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. pow2N/A

                    \[\leadsto \sqrt{\frac{\color{blue}{{d}^{2}}}{h \cdot \ell}} \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 \color{blue}{\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  19. lower-*.f6469.6

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{\ell \cdot h}}} \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. Applied rewrites69.6%

                  \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in D around inf

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, \color{blue}{{D}^{2}}, 1\right) \]
                8. Applied rewrites48.1%

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

                if 1.6200000000000001e-257 < l

                1. Initial program 35.4%

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                5. Step-by-step derivation
                  1. lower-/.f64N/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  9. sqrt-unprodN/A

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

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

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  12. lower-/.f6437.6

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                6. Applied rewrites37.6%

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                7. Taylor expanded in h around 0

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                8. Step-by-step derivation
                  1. lower-/.f6437.6

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                9. Applied rewrites37.6%

                  \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
              9. Recombined 3 regimes into one program.
              10. Add Preprocessing

              Alternative 10: 60.0% accurate, 1.8× speedup?

              \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\left(t\_0 \cdot d\_m\right) \cdot 1\\ \mathbf{elif}\;\ell \leq -2 \cdot 10^{-304}:\\ \;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot t\_0\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\ \mathbf{elif}\;\ell \leq 4.3 \cdot 10^{-260}:\\ \;\;\;\;\frac{\sqrt{h \cdot \left(d\_m \cdot \frac{d\_m}{\ell}\right)}}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\ \end{array} \end{array} \]
              d_m = (fabs.f64 d)
              M_m = (fabs.f64 M)
              D_m = (fabs.f64 D)
              NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              (FPCore (d_m h l M_m D_m)
               :precision binary64
               (let* ((t_0 (sqrt (/ 1.0 (* l h)))))
                 (if (<= l -1e-21)
                   (* (* t_0 d_m) 1.0)
                   (if (<= l -2e-304)
                     (* (/ (* (* (* (* M_m M_m) h) t_0) (* D_m D_m)) (* l d_m)) -0.125)
                     (if (<= l 4.3e-260)
                       (/ (sqrt (* h (* d_m (/ d_m l)))) h)
                       (fma
                        (* (* (/ (* M_m M_m) (* (* l d_m) (sqrt (/ l h)))) -0.125) D_m)
                        D_m
                        (/ d_m (* (sqrt l) (sqrt h)))))))))
              d_m = fabs(d);
              M_m = fabs(M);
              D_m = fabs(D);
              assert(d_m < h && h < l && l < M_m && M_m < D_m);
              double code(double d_m, double h, double l, double M_m, double D_m) {
              	double t_0 = sqrt((1.0 / (l * h)));
              	double tmp;
              	if (l <= -1e-21) {
              		tmp = (t_0 * d_m) * 1.0;
              	} else if (l <= -2e-304) {
              		tmp = (((((M_m * M_m) * h) * t_0) * (D_m * D_m)) / (l * d_m)) * -0.125;
              	} else if (l <= 4.3e-260) {
              		tmp = sqrt((h * (d_m * (d_m / l)))) / h;
              	} else {
              		tmp = fma(((((M_m * M_m) / ((l * d_m) * sqrt((l / h)))) * -0.125) * D_m), D_m, (d_m / (sqrt(l) * sqrt(h))));
              	}
              	return tmp;
              }
              
              d_m = abs(d)
              M_m = abs(M)
              D_m = abs(D)
              d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
              function code(d_m, h, l, M_m, D_m)
              	t_0 = sqrt(Float64(1.0 / Float64(l * h)))
              	tmp = 0.0
              	if (l <= -1e-21)
              		tmp = Float64(Float64(t_0 * d_m) * 1.0);
              	elseif (l <= -2e-304)
              		tmp = Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * t_0) * Float64(D_m * D_m)) / Float64(l * d_m)) * -0.125);
              	elseif (l <= 4.3e-260)
              		tmp = Float64(sqrt(Float64(h * Float64(d_m * Float64(d_m / l)))) / h);
              	else
              		tmp = fma(Float64(Float64(Float64(Float64(M_m * M_m) / Float64(Float64(l * d_m) * sqrt(Float64(l / h)))) * -0.125) * D_m), D_m, Float64(d_m / Float64(sqrt(l) * sqrt(h))));
              	end
              	return tmp
              end
              
              d_m = N[Abs[d], $MachinePrecision]
              M_m = N[Abs[M], $MachinePrecision]
              D_m = N[Abs[D], $MachinePrecision]
              NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1e-21], N[(N[(t$95$0 * d$95$m), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[l, -2e-304], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision], If[LessEqual[l, 4.3e-260], N[(N[Sqrt[N[(h * N[(d$95$m * N[(d$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * D$95$m), $MachinePrecision] * D$95$m + N[(d$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
              
              \begin{array}{l}
              d_m = \left|d\right|
              \\
              M_m = \left|M\right|
              \\
              D_m = \left|D\right|
              \\
              [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
              \\
              \begin{array}{l}
              t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
              \mathbf{if}\;\ell \leq -1 \cdot 10^{-21}:\\
              \;\;\;\;\left(t\_0 \cdot d\_m\right) \cdot 1\\
              
              \mathbf{elif}\;\ell \leq -2 \cdot 10^{-304}:\\
              \;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot t\_0\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\
              
              \mathbf{elif}\;\ell \leq 4.3 \cdot 10^{-260}:\\
              \;\;\;\;\frac{\sqrt{h \cdot \left(d\_m \cdot \frac{d\_m}{\ell}\right)}}{h}\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m \cdot M\_m}{\left(\ell \cdot d\_m\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D\_m, D\_m, \frac{d\_m}{\sqrt{\ell} \cdot \sqrt{h}}\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if l < -9.99999999999999908e-22

                1. Initial program 35.4%

                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                2. Step-by-step derivation
                  1. 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 - \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({\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-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) \]
                  4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                  \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

                  \[\leadsto \color{blue}{\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \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. Step-by-step derivation
                  1. times-fracN/A

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \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-/.f64N/A

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-unprodN/A

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

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. sqrt-undivN/A

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. pow1/2N/A

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

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. metadata-evalN/A

                    \[\leadsto \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \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. *-commutativeN/A

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

                    \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d}\right) \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. Applied rewrites69.3%

                  \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \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. Taylor expanded in d around inf

                  \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \color{blue}{1} \]
                8. Step-by-step derivation
                  1. Applied rewrites42.7%

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

                  if -9.99999999999999908e-22 < l < -1.99999999999999994e-304

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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 - \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({\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-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) \]
                    4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                    \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

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

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

                  if -1.99999999999999994e-304 < l < 4.30000000000000021e-260

                  1. Initial program 35.4%

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

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

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

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

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

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

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

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    7. lift-/.f6421.4

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                  4. Applied rewrites21.4%

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

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

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

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

                      \[\leadsto \frac{\sqrt{h \cdot \left(d \cdot \frac{d}{\ell}\right)}}{h} \]
                    5. lower-*.f6420.8

                      \[\leadsto \frac{\sqrt{h \cdot \left(d \cdot \frac{d}{\ell}\right)}}{h} \]
                  6. Applied rewrites20.8%

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

                  if 4.30000000000000021e-260 < l

                  1. Initial program 35.4%

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

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

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

                    \[\leadsto \mathsf{fma}\left(\left(\frac{{M}^{2}}{d \cdot \left(\ell \cdot \left(\sqrt{\ell} \cdot \sqrt{\frac{1}{h}}\right)\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  5. Step-by-step derivation
                    1. lower-/.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \left(\sqrt{\frac{1}{h}} \cdot \sqrt{\ell}\right)} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                    9. sqrt-unprodN/A

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

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

                      \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                    12. lower-/.f6437.6

                      \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  6. Applied rewrites37.6%

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{1}{h} \cdot \ell}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  7. Taylor expanded in h around 0

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot \frac{-1}{8}\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  8. Step-by-step derivation
                    1. lower-/.f6437.6

                      \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                  9. Applied rewrites37.6%

                    \[\leadsto \mathsf{fma}\left(\left(\frac{M \cdot M}{\left(\ell \cdot d\right) \cdot \sqrt{\frac{\ell}{h}}} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right) \]
                9. Recombined 4 regimes into one program.
                10. Add Preprocessing

                Alternative 11: 59.1% accurate, 2.5× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 7.6 \cdot 10^{-50}:\\ \;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\ \end{array} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m)
                 :precision binary64
                 (if (<= M_m 7.6e-50)
                   (/ d_m (sqrt (* l h)))
                   (*
                    (/ (* (* (* (* M_m M_m) h) (sqrt (/ 1.0 (* l h)))) (* D_m D_m)) (* l d_m))
                    -0.125)))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	double tmp;
                	if (M_m <= 7.6e-50) {
                		tmp = d_m / sqrt((l * h));
                	} else {
                		tmp = (((((M_m * M_m) * h) * sqrt((1.0 / (l * h)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
                	}
                	return tmp;
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    real(8) :: tmp
                    if (m_m <= 7.6d-50) then
                        tmp = d_m / sqrt((l * h))
                    else
                        tmp = (((((m_m * m_m) * h) * sqrt((1.0d0 / (l * h)))) * (d_m_1 * d_m_1)) / (l * d_m)) * (-0.125d0)
                    end if
                    code = tmp
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	double tmp;
                	if (M_m <= 7.6e-50) {
                		tmp = d_m / Math.sqrt((l * h));
                	} else {
                		tmp = (((((M_m * M_m) * h) * Math.sqrt((1.0 / (l * h)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
                	}
                	return tmp;
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	tmp = 0
                	if M_m <= 7.6e-50:
                		tmp = d_m / math.sqrt((l * h))
                	else:
                		tmp = (((((M_m * M_m) * h) * math.sqrt((1.0 / (l * h)))) * (D_m * D_m)) / (l * d_m)) * -0.125
                	return tmp
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	tmp = 0.0
                	if (M_m <= 7.6e-50)
                		tmp = Float64(d_m / sqrt(Float64(l * h)));
                	else
                		tmp = Float64(Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(D_m * D_m)) / Float64(l * d_m)) * -0.125);
                	end
                	return tmp
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp_2 = code(d_m, h, l, M_m, D_m)
                	tmp = 0.0;
                	if (M_m <= 7.6e-50)
                		tmp = d_m / sqrt((l * h));
                	else
                		tmp = (((((M_m * M_m) * h) * sqrt((1.0 / (l * h)))) * (D_m * D_m)) / (l * d_m)) * -0.125;
                	end
                	tmp_2 = tmp;
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[M$95$m, 7.6e-50], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * d$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;M\_m \leq 7.6 \cdot 10^{-50}:\\
                \;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\left(\left(\left(M\_m \cdot M\_m\right) \cdot h\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right) \cdot \left(D\_m \cdot D\_m\right)}{\ell \cdot d\_m} \cdot -0.125\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if M < 7.5999999999999998e-50

                  1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]

                  if 7.5999999999999998e-50 < M

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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 - \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({\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-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) \]
                    4. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \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 rewrites42.3%

                    \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \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. Taylor expanded in d around 0

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

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

                Alternative 12: 58.7% accurate, 2.5× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+112}:\\ \;\;\;\;\frac{d\_m}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\left(\ell \cdot d\_m\right) \cdot t\_0}\right) \cdot -0.125\\ \end{array} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m)
                 :precision binary64
                 (let* ((t_0 (sqrt (* l h))))
                   (if (<= (* M_m D_m) 2e+112)
                     (/ d_m t_0)
                     (* (* (* D_m D_m) (/ (* (* M_m M_m) h) (* (* l d_m) t_0))) -0.125))))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = sqrt((l * h));
                	double tmp;
                	if ((M_m * D_m) <= 2e+112) {
                		tmp = d_m / t_0;
                	} else {
                		tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((l * d_m) * t_0))) * -0.125;
                	}
                	return tmp;
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = sqrt((l * h))
                    if ((m_m * d_m_1) <= 2d+112) then
                        tmp = d_m / t_0
                    else
                        tmp = ((d_m_1 * d_m_1) * (((m_m * m_m) * h) / ((l * d_m) * t_0))) * (-0.125d0)
                    end if
                    code = tmp
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = Math.sqrt((l * h));
                	double tmp;
                	if ((M_m * D_m) <= 2e+112) {
                		tmp = d_m / t_0;
                	} else {
                		tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((l * d_m) * t_0))) * -0.125;
                	}
                	return tmp;
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	t_0 = math.sqrt((l * h))
                	tmp = 0
                	if (M_m * D_m) <= 2e+112:
                		tmp = d_m / t_0
                	else:
                		tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((l * d_m) * t_0))) * -0.125
                	return tmp
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt(Float64(l * h))
                	tmp = 0.0
                	if (Float64(M_m * D_m) <= 2e+112)
                		tmp = Float64(d_m / t_0);
                	else
                		tmp = Float64(Float64(Float64(D_m * D_m) * Float64(Float64(Float64(M_m * M_m) * h) / Float64(Float64(l * d_m) * t_0))) * -0.125);
                	end
                	return tmp
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp_2 = code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt((l * h));
                	tmp = 0.0;
                	if ((M_m * D_m) <= 2e+112)
                		tmp = d_m / t_0;
                	else
                		tmp = ((D_m * D_m) * (((M_m * M_m) * h) / ((l * d_m) * t_0))) * -0.125;
                	end
                	tmp_2 = tmp;
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e+112], N[(d$95$m / t$95$0), $MachinePrecision], N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(N[(l * d$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]]]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \begin{array}{l}
                t_0 := \sqrt{\ell \cdot h}\\
                \mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+112}:\\
                \;\;\;\;\frac{d\_m}{t\_0}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(\left(D\_m \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\left(\ell \cdot d\_m\right) \cdot t\_0}\right) \cdot -0.125\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 M D) < 1.9999999999999999e112

                  1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]

                  if 1.9999999999999999e112 < (*.f64 M D)

                  1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

                Alternative 13: 56.4% accurate, 0.5× speedup?

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

                  1. Initial program 35.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -9.9999999999999999e-110 < (*.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.99999999999999925e125

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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. frac-2negN/A

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

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

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

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

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

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

                      \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-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) \]
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-1 \cdot h}}} \]
                  5. Applied rewrites42.9%

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

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

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

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

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{\color{blue}{h}}} \]
                    5. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    6. lift-*.f6425.0

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                  7. Applied rewrites25.0%

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                  if 9.99999999999999925e125 < (*.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 35.4%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

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

                Alternative 14: 49.5% accurate, 0.5× speedup?

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

                  1. Initial program 35.4%

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

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

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

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

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

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

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

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    7. lift-/.f6421.4

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                  4. Applied rewrites21.4%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                    13. lift-*.f6418.9

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                  6. Applied rewrites18.9%

                    \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                  7. Taylor expanded in h around -inf

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

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

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

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

                      \[\leadsto -\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}} \]
                    5. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}} \]
                    6. frac-timesN/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    7. sqrt-prodN/A

                      \[\leadsto -\frac{\sqrt{d \cdot d}}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    8. rem-sqrt-square-revN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    9. sqrt-prodN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    10. lift-sqrt.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    11. lift-*.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    12. lift-/.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    13. lift-fabs.f649.6

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    14. lift-*.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    15. *-commutativeN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    16. lower-*.f649.6

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                  9. Applied rewrites9.6%

                    \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                  10. Step-by-step derivation
                    1. lift-fabs.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    2. lift-/.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    3. rem-sqrt-square-revN/A

                      \[\leadsto -\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \]
                    4. sqrt-prodN/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
                    5. lift-*.f64N/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
                    6. lift-sqrt.f64N/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h \cdot \ell}} \]
                    7. sqrt-prodN/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \]
                    8. frac-timesN/A

                      \[\leadsto -\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}} \]
                    9. sqrt-divN/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}} \]
                    10. frac-2negN/A

                      \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}} \]
                    11. sqrt-undivN/A

                      \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}} \]
                    12. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}} \]
                    13. associate-*l/N/A

                      \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \]
                    14. sqrt-unprodN/A

                      \[\leadsto -\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \]
                    15. sqrt-undivN/A

                      \[\leadsto -\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    16. lower-sqrt.f64N/A

                      \[\leadsto -\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    17. lower-/.f64N/A

                      \[\leadsto -\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    18. lower-*.f64N/A

                      \[\leadsto -\sqrt{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    19. lower-neg.f64N/A

                      \[\leadsto -\sqrt{\frac{\left(-d\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    20. lift-/.f64N/A

                      \[\leadsto -\sqrt{\frac{\left(-d\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}} \]
                    21. lower-neg.f6411.5

                      \[\leadsto -\sqrt{\frac{\left(-d\right) \cdot \frac{d}{\ell}}{-h}} \]
                  11. Applied rewrites11.5%

                    \[\leadsto -\sqrt{\frac{\left(-d\right) \cdot \frac{d}{\ell}}{-h}} \]

                  if -9.9999999999999999e-110 < (*.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.99999999999999925e125

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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. frac-2negN/A

                      \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. sqrt-divN/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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-/.f64N/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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.f64N/A

                      \[\leadsto \left(\frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    10. lower-neg.f64N/A

                      \[\leadsto \left(\frac{\sqrt{\color{blue}{-d}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    11. lower-sqrt.f64N/A

                      \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    12. lower-neg.f640.0

                      \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-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) \]
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-1 \cdot h}}} \]
                  5. Applied rewrites42.9%

                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \]
                  6. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    2. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    3. sqrt-prodN/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                    4. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{\color{blue}{h}}} \]
                    5. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    6. lift-*.f6425.0

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                  7. Applied rewrites25.0%

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                  if 9.99999999999999925e125 < (*.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 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in l around inf

                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right)}{{d}^{2} \cdot \ell} + \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
                  3. Applied rewrites28.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot h\right) \cdot M\right) \cdot M}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \]
                  4. Taylor expanded in D around inf

                    \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right)} \]
                  5. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                  6. Applied rewrites43.5%

                    \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\left(\sqrt{\ell \cdot h} \cdot \ell\right) \cdot d}, -0.125, \frac{d}{\sqrt{\ell \cdot h} \cdot \left(D \cdot D\right)}\right) \cdot \color{blue}{\left(D \cdot D\right)} \]
                  7. Taylor expanded in d around inf

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
                  8. Step-by-step derivation
                    1. sqrt-prodN/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    2. lower-/.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    3. lift-sqrt.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 15: 49.4% accurate, 0.5× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-109}:\\ \;\;\;\;-\sqrt{\frac{d\_m \cdot d\_m}{\ell \cdot h}}\\ \mathbf{elif}\;t\_0 \leq 10^{+126}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m)
                 :precision binary64
                 (let* ((t_0
                         (*
                          (* (pow (/ d_m h) (/ 1.0 2.0)) (pow (/ d_m l) (/ 1.0 2.0)))
                          (-
                           1.0
                           (*
                            (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0))
                            (/ h l))))))
                   (if (<= t_0 -1e-109)
                     (- (sqrt (/ (* d_m d_m) (* l h))))
                     (if (<= t_0 1e+126)
                       (/ (fabs d_m) (* (sqrt l) (sqrt h)))
                       (/ d_m (sqrt (* l h)))))))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = (pow((d_m / h), (1.0 / 2.0)) * pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
                	double tmp;
                	if (t_0 <= -1e-109) {
                		tmp = -sqrt(((d_m * d_m) / (l * h)));
                	} else if (t_0 <= 1e+126) {
                		tmp = fabs(d_m) / (sqrt(l) * sqrt(h));
                	} else {
                		tmp = d_m / sqrt((l * h));
                	}
                	return tmp;
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = (((d_m / h) ** (1.0d0 / 2.0d0)) * ((d_m / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m_1) / (2.0d0 * d_m)) ** 2.0d0)) * (h / l)))
                    if (t_0 <= (-1d-109)) then
                        tmp = -sqrt(((d_m * d_m) / (l * h)))
                    else if (t_0 <= 1d+126) then
                        tmp = abs(d_m) / (sqrt(l) * sqrt(h))
                    else
                        tmp = d_m / sqrt((l * h))
                    end if
                    code = tmp
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = (Math.pow((d_m / h), (1.0 / 2.0)) * Math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
                	double tmp;
                	if (t_0 <= -1e-109) {
                		tmp = -Math.sqrt(((d_m * d_m) / (l * h)));
                	} else if (t_0 <= 1e+126) {
                		tmp = Math.abs(d_m) / (Math.sqrt(l) * Math.sqrt(h));
                	} else {
                		tmp = d_m / Math.sqrt((l * h));
                	}
                	return tmp;
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	t_0 = (math.pow((d_m / h), (1.0 / 2.0)) * math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))
                	tmp = 0
                	if t_0 <= -1e-109:
                		tmp = -math.sqrt(((d_m * d_m) / (l * h)))
                	elif t_0 <= 1e+126:
                		tmp = math.fabs(d_m) / (math.sqrt(l) * math.sqrt(h))
                	else:
                		tmp = d_m / math.sqrt((l * h))
                	return tmp
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	t_0 = Float64(Float64((Float64(d_m / h) ^ Float64(1.0 / 2.0)) * (Float64(d_m / 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_m)) ^ 2.0)) * Float64(h / l))))
                	tmp = 0.0
                	if (t_0 <= -1e-109)
                		tmp = Float64(-sqrt(Float64(Float64(d_m * d_m) / Float64(l * h))));
                	elseif (t_0 <= 1e+126)
                		tmp = Float64(abs(d_m) / Float64(sqrt(l) * sqrt(h)));
                	else
                		tmp = Float64(d_m / sqrt(Float64(l * h)));
                	end
                	return tmp
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp_2 = code(d_m, h, l, M_m, D_m)
                	t_0 = (((d_m / h) ^ (1.0 / 2.0)) * ((d_m / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d_m)) ^ 2.0)) * (h / l)));
                	tmp = 0.0;
                	if (t_0 <= -1e-109)
                		tmp = -sqrt(((d_m * d_m) / (l * h)));
                	elseif (t_0 <= 1e+126)
                		tmp = abs(d_m) / (sqrt(l) * sqrt(h));
                	else
                		tmp = d_m / sqrt((l * h));
                	end
                	tmp_2 = tmp;
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d$95$m / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d$95$m / 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$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-109], (-N[Sqrt[N[(N[(d$95$m * d$95$m), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$0, 1e+126], N[(N[Abs[d$95$m], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \begin{array}{l}
                t_0 := \left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-109}:\\
                \;\;\;\;-\sqrt{\frac{d\_m \cdot d\_m}{\ell \cdot h}}\\
                
                \mathbf{elif}\;t\_0 \leq 10^{+126}:\\
                \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell} \cdot \sqrt{h}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{d\_m}{\sqrt{\ell \cdot h}}\\
                
                
                \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)))) < -9.9999999999999999e-110

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{\color{blue}{h}} \]
                    2. sqrt-unprodN/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    4. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    6. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    7. lift-/.f6421.4

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                  4. Applied rewrites21.4%

                    \[\leadsto \color{blue}{\frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h}} \]
                  5. Step-by-step derivation
                    1. lift-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    2. lift-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    3. lift-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    4. sqrt-prodN/A

                      \[\leadsto \frac{\sqrt{h \cdot d} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
                    6. lift-/.f64N/A

                      \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
                    7. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{d \cdot h}}{h} \]
                    8. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{d \cdot h}}{h} \]
                    9. lift-/.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{d \cdot h}}{h} \]
                    10. lift-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{d \cdot h}}{h} \]
                    11. lower-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{d \cdot h}}{h} \]
                    12. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                    13. lift-*.f6418.9

                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                  6. Applied rewrites18.9%

                    \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{h \cdot d}}{h} \]
                  7. Taylor expanded in h around -inf

                    \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
                  8. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \]
                    2. lower-neg.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
                    3. *-commutativeN/A

                      \[\leadsto -\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}} \]
                    4. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \sqrt{\frac{d}{h}} \]
                    5. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}} \]
                    6. frac-timesN/A

                      \[\leadsto -\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    7. sqrt-prodN/A

                      \[\leadsto -\frac{\sqrt{d \cdot d}}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    8. rem-sqrt-square-revN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    9. sqrt-prodN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    10. lift-sqrt.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    11. lift-*.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    12. lift-/.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    13. lift-fabs.f649.6

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    14. lift-*.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    15. *-commutativeN/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    16. lower-*.f649.6

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                  9. Applied rewrites9.6%

                    \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                  10. Step-by-step derivation
                    1. lift-fabs.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    2. lift-/.f64N/A

                      \[\leadsto -\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                    3. rem-sqrt-square-revN/A

                      \[\leadsto -\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \]
                    4. pow2N/A

                      \[\leadsto -\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}} \]
                    5. lift-*.f64N/A

                      \[\leadsto -\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}} \]
                    6. lift-sqrt.f64N/A

                      \[\leadsto -\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}} \]
                    7. sqrt-undivN/A

                      \[\leadsto -\sqrt{\frac{{d}^{2}}{h \cdot \ell}} \]
                    8. pow2N/A

                      \[\leadsto -\sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                    9. frac-timesN/A

                      \[\leadsto -\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
                    10. rem-square-sqrtN/A

                      \[\leadsto -\sqrt{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
                    11. sqrt-unprodN/A

                      \[\leadsto -\sqrt{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
                    12. frac-2negN/A

                      \[\leadsto -\sqrt{\left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
                    13. sqrt-undivN/A

                      \[\leadsto -\sqrt{\left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
                    14. associate-*l/N/A

                      \[\leadsto -\sqrt{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
                    15. sqrt-unprodN/A

                      \[\leadsto -\sqrt{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
                    16. frac-2negN/A

                      \[\leadsto -\sqrt{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \left(\sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
                    17. sqrt-undivN/A

                      \[\leadsto -\sqrt{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \left(\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
                    18. associate-*l/N/A

                      \[\leadsto -\sqrt{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}}} \]
                  11. Applied rewrites11.5%

                    \[\leadsto -\sqrt{\frac{d \cdot d}{\ell \cdot h}} \]

                  if -9.9999999999999999e-110 < (*.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.99999999999999925e125

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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. frac-2negN/A

                      \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. sqrt-divN/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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-/.f64N/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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.f64N/A

                      \[\leadsto \left(\frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    10. lower-neg.f64N/A

                      \[\leadsto \left(\frac{\sqrt{\color{blue}{-d}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    11. lower-sqrt.f64N/A

                      \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    12. lower-neg.f640.0

                      \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-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) \]
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-1 \cdot h}}} \]
                  5. Applied rewrites42.9%

                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \]
                  6. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    2. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    3. sqrt-prodN/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                    4. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{\color{blue}{h}}} \]
                    5. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    6. lift-*.f6425.0

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                  7. Applied rewrites25.0%

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                  if 9.99999999999999925e125 < (*.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 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in l around inf

                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right)}{{d}^{2} \cdot \ell} + \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
                  3. Applied rewrites28.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot h\right) \cdot M\right) \cdot M}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \]
                  4. Taylor expanded in D around inf

                    \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right)} \]
                  5. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                  6. Applied rewrites43.5%

                    \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\left(\sqrt{\ell \cdot h} \cdot \ell\right) \cdot d}, -0.125, \frac{d}{\sqrt{\ell \cdot h} \cdot \left(D \cdot D\right)}\right) \cdot \color{blue}{\left(D \cdot D\right)} \]
                  7. Taylor expanded in d around inf

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
                  8. Step-by-step derivation
                    1. sqrt-prodN/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    2. lower-/.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    3. lift-sqrt.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 16: 48.5% accurate, 0.5× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ t_1 := \left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-109}:\\ \;\;\;\;-\frac{\left|d\_m\right|}{t\_0}\\ \mathbf{elif}\;t\_1 \leq 10^{+126}:\\ \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d\_m}{t\_0}\\ \end{array} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m)
                 :precision binary64
                 (let* ((t_0 (sqrt (* l h)))
                        (t_1
                         (*
                          (* (pow (/ d_m h) (/ 1.0 2.0)) (pow (/ d_m l) (/ 1.0 2.0)))
                          (-
                           1.0
                           (*
                            (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0))
                            (/ h l))))))
                   (if (<= t_1 -1e-109)
                     (- (/ (fabs d_m) t_0))
                     (if (<= t_1 1e+126) (/ (fabs d_m) (* (sqrt l) (sqrt h))) (/ d_m t_0)))))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = sqrt((l * h));
                	double t_1 = (pow((d_m / h), (1.0 / 2.0)) * pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
                	double tmp;
                	if (t_1 <= -1e-109) {
                		tmp = -(fabs(d_m) / t_0);
                	} else if (t_1 <= 1e+126) {
                		tmp = fabs(d_m) / (sqrt(l) * sqrt(h));
                	} else {
                		tmp = d_m / t_0;
                	}
                	return tmp;
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    real(8) :: t_0
                    real(8) :: t_1
                    real(8) :: tmp
                    t_0 = sqrt((l * h))
                    t_1 = (((d_m / h) ** (1.0d0 / 2.0d0)) * ((d_m / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m_1) / (2.0d0 * d_m)) ** 2.0d0)) * (h / l)))
                    if (t_1 <= (-1d-109)) then
                        tmp = -(abs(d_m) / t_0)
                    else if (t_1 <= 1d+126) then
                        tmp = abs(d_m) / (sqrt(l) * sqrt(h))
                    else
                        tmp = d_m / t_0
                    end if
                    code = tmp
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = Math.sqrt((l * h));
                	double t_1 = (Math.pow((d_m / h), (1.0 / 2.0)) * Math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)));
                	double tmp;
                	if (t_1 <= -1e-109) {
                		tmp = -(Math.abs(d_m) / t_0);
                	} else if (t_1 <= 1e+126) {
                		tmp = Math.abs(d_m) / (Math.sqrt(l) * Math.sqrt(h));
                	} else {
                		tmp = d_m / t_0;
                	}
                	return tmp;
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	t_0 = math.sqrt((l * h))
                	t_1 = (math.pow((d_m / h), (1.0 / 2.0)) * math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))
                	tmp = 0
                	if t_1 <= -1e-109:
                		tmp = -(math.fabs(d_m) / t_0)
                	elif t_1 <= 1e+126:
                		tmp = math.fabs(d_m) / (math.sqrt(l) * math.sqrt(h))
                	else:
                		tmp = d_m / t_0
                	return tmp
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt(Float64(l * h))
                	t_1 = Float64(Float64((Float64(d_m / h) ^ Float64(1.0 / 2.0)) * (Float64(d_m / 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_m)) ^ 2.0)) * Float64(h / l))))
                	tmp = 0.0
                	if (t_1 <= -1e-109)
                		tmp = Float64(-Float64(abs(d_m) / t_0));
                	elseif (t_1 <= 1e+126)
                		tmp = Float64(abs(d_m) / Float64(sqrt(l) * sqrt(h)));
                	else
                		tmp = Float64(d_m / t_0);
                	end
                	return tmp
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp_2 = code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt((l * h));
                	t_1 = (((d_m / h) ^ (1.0 / 2.0)) * ((d_m / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d_m)) ^ 2.0)) * (h / l)));
                	tmp = 0.0;
                	if (t_1 <= -1e-109)
                		tmp = -(abs(d_m) / t_0);
                	elseif (t_1 <= 1e+126)
                		tmp = abs(d_m) / (sqrt(l) * sqrt(h));
                	else
                		tmp = d_m / t_0;
                	end
                	tmp_2 = tmp;
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d$95$m / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d$95$m / 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$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-109], (-N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[t$95$1, 1e+126], N[(N[Abs[d$95$m], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d$95$m / t$95$0), $MachinePrecision]]]]]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \begin{array}{l}
                t_0 := \sqrt{\ell \cdot h}\\
                t_1 := \left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-109}:\\
                \;\;\;\;-\frac{\left|d\_m\right|}{t\_0}\\
                
                \mathbf{elif}\;t\_1 \leq 10^{+126}:\\
                \;\;\;\;\frac{\left|d\_m\right|}{\sqrt{\ell} \cdot \sqrt{h}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{d\_m}{t\_0}\\
                
                
                \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)))) < -9.9999999999999999e-110

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{\color{blue}{h}} \]
                    2. sqrt-unprodN/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    4. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    6. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    7. lift-/.f6421.4

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                  4. Applied rewrites21.4%

                    \[\leadsto \color{blue}{\frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h}} \]
                  5. Taylor expanded in h around -inf

                    \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{{d}^{2}}{h \cdot \ell}}} \]
                  6. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{{d}^{2}}{h \cdot \ell}}\right) \]
                    2. pow2N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
                    3. times-fracN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right) \]
                    4. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right) \]
                    5. sqrt-unprodN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \]
                    6. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \]
                    7. lower-neg.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
                    8. lift-/.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
                    9. sqrt-unprodN/A

                      \[\leadsto -\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
                    10. lift-/.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
                    11. times-fracN/A

                      \[\leadsto -\sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                    12. pow2N/A

                      \[\leadsto -\sqrt{\frac{{d}^{2}}{h \cdot \ell}} \]
                    13. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}} \]
                    14. pow1/2N/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\frac{1}{2}}}{\sqrt{h \cdot \ell}} \]
                    15. metadata-evalN/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt{h \cdot \ell}} \]
                    16. sqrt-unprodN/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt{h} \cdot \sqrt{\ell}} \]
                  7. Applied rewrites9.6%

                    \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]

                  if -9.9999999999999999e-110 < (*.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.99999999999999925e125

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Step-by-step derivation
                    1. 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. frac-2negN/A

                      \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. sqrt-divN/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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-/.f64N/A

                      \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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.f64N/A

                      \[\leadsto \left(\frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    10. lower-neg.f64N/A

                      \[\leadsto \left(\frac{\sqrt{\color{blue}{-d}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    11. lower-sqrt.f64N/A

                      \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                    12. lower-neg.f640.0

                      \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-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) \]
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-1 \cdot h}}} \]
                  5. Applied rewrites42.9%

                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{\ell \cdot h}}} \]
                  6. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    2. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]
                    3. sqrt-prodN/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                    4. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{\color{blue}{h}}} \]
                    5. lift-sqrt.f64N/A

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \sqrt{h}} \]
                    6. lift-*.f6425.0

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                  7. Applied rewrites25.0%

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                  if 9.99999999999999925e125 < (*.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 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in l around inf

                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right)}{{d}^{2} \cdot \ell} + \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
                  3. Applied rewrites28.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot h\right) \cdot M\right) \cdot M}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \]
                  4. Taylor expanded in D around inf

                    \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right)} \]
                  5. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                  6. Applied rewrites43.5%

                    \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\left(\sqrt{\ell \cdot h} \cdot \ell\right) \cdot d}, -0.125, \frac{d}{\sqrt{\ell \cdot h} \cdot \left(D \cdot D\right)}\right) \cdot \color{blue}{\left(D \cdot D\right)} \]
                  7. Taylor expanded in d around inf

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
                  8. Step-by-step derivation
                    1. sqrt-prodN/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    2. lower-/.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    3. lift-sqrt.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 17: 46.2% accurate, 0.9× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\ell \cdot h}\\ \mathbf{if}\;\left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-109}:\\ \;\;\;\;-\frac{\left|d\_m\right|}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{d\_m}{t\_0}\\ \end{array} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m)
                 :precision binary64
                 (let* ((t_0 (sqrt (* l h))))
                   (if (<=
                        (*
                         (* (pow (/ d_m h) (/ 1.0 2.0)) (pow (/ d_m l) (/ 1.0 2.0)))
                         (-
                          1.0
                          (* (* (/ 1.0 2.0) (pow (/ (* M_m D_m) (* 2.0 d_m)) 2.0)) (/ h l))))
                        -1e-109)
                     (- (/ (fabs d_m) t_0))
                     (/ d_m t_0))))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = sqrt((l * h));
                	double tmp;
                	if (((pow((d_m / h), (1.0 / 2.0)) * pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -1e-109) {
                		tmp = -(fabs(d_m) / t_0);
                	} else {
                		tmp = d_m / t_0;
                	}
                	return tmp;
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = sqrt((l * h))
                    if (((((d_m / h) ** (1.0d0 / 2.0d0)) * ((d_m / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m_m * d_m_1) / (2.0d0 * d_m)) ** 2.0d0)) * (h / l)))) <= (-1d-109)) then
                        tmp = -(abs(d_m) / t_0)
                    else
                        tmp = d_m / t_0
                    end if
                    code = tmp
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	double t_0 = Math.sqrt((l * h));
                	double tmp;
                	if (((Math.pow((d_m / h), (1.0 / 2.0)) * Math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -1e-109) {
                		tmp = -(Math.abs(d_m) / t_0);
                	} else {
                		tmp = d_m / t_0;
                	}
                	return tmp;
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	t_0 = math.sqrt((l * h))
                	tmp = 0
                	if ((math.pow((d_m / h), (1.0 / 2.0)) * math.pow((d_m / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M_m * D_m) / (2.0 * d_m)), 2.0)) * (h / l)))) <= -1e-109:
                		tmp = -(math.fabs(d_m) / t_0)
                	else:
                		tmp = d_m / t_0
                	return tmp
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt(Float64(l * h))
                	tmp = 0.0
                	if (Float64(Float64((Float64(d_m / h) ^ Float64(1.0 / 2.0)) * (Float64(d_m / 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_m)) ^ 2.0)) * Float64(h / l)))) <= -1e-109)
                		tmp = Float64(-Float64(abs(d_m) / t_0));
                	else
                		tmp = Float64(d_m / t_0);
                	end
                	return tmp
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp_2 = code(d_m, h, l, M_m, D_m)
                	t_0 = sqrt((l * h));
                	tmp = 0.0;
                	if (((((d_m / h) ^ (1.0 / 2.0)) * ((d_m / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M_m * D_m) / (2.0 * d_m)) ^ 2.0)) * (h / l)))) <= -1e-109)
                		tmp = -(abs(d_m) / t_0);
                	else
                		tmp = d_m / t_0;
                	end
                	tmp_2 = tmp;
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d$95$m / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d$95$m / 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$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-109], (-N[(N[Abs[d$95$m], $MachinePrecision] / t$95$0), $MachinePrecision]), N[(d$95$m / t$95$0), $MachinePrecision]]]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \begin{array}{l}
                t_0 := \sqrt{\ell \cdot h}\\
                \mathbf{if}\;\left({\left(\frac{d\_m}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d\_m}{\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\_m}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-109}:\\
                \;\;\;\;-\frac{\left|d\_m\right|}{t\_0}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{d\_m}{t\_0}\\
                
                
                \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)))) < -9.9999999999999999e-110

                  1. Initial program 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{\color{blue}{h}} \]
                    2. sqrt-unprodN/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    4. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                    5. *-commutativeN/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    6. lower-*.f64N/A

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                    7. lift-/.f6421.4

                      \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                  4. Applied rewrites21.4%

                    \[\leadsto \color{blue}{\frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h}} \]
                  5. Taylor expanded in h around -inf

                    \[\leadsto -1 \cdot \color{blue}{\sqrt{\frac{{d}^{2}}{h \cdot \ell}}} \]
                  6. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{{d}^{2}}{h \cdot \ell}}\right) \]
                    2. pow2N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
                    3. times-fracN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right) \]
                    4. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\right) \]
                    5. sqrt-unprodN/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \]
                    6. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \]
                    7. lower-neg.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
                    8. lift-/.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}} \]
                    9. sqrt-unprodN/A

                      \[\leadsto -\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
                    10. lift-/.f64N/A

                      \[\leadsto -\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \]
                    11. times-fracN/A

                      \[\leadsto -\sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                    12. pow2N/A

                      \[\leadsto -\sqrt{\frac{{d}^{2}}{h \cdot \ell}} \]
                    13. sqrt-divN/A

                      \[\leadsto -\frac{\sqrt{{d}^{2}}}{\sqrt{h \cdot \ell}} \]
                    14. pow1/2N/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\frac{1}{2}}}{\sqrt{h \cdot \ell}} \]
                    15. metadata-evalN/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt{h \cdot \ell}} \]
                    16. sqrt-unprodN/A

                      \[\leadsto -\frac{{\left({d}^{2}\right)}^{\left(\frac{1}{2}\right)}}{\sqrt{h} \cdot \sqrt{\ell}} \]
                  7. Applied rewrites9.6%

                    \[\leadsto -\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \]

                  if -9.9999999999999999e-110 < (*.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 35.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Taylor expanded in l around inf

                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right)}{{d}^{2} \cdot \ell} + \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
                  3. Applied rewrites28.1%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot h\right) \cdot M\right) \cdot M}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \]
                  4. Taylor expanded in D around inf

                    \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right)} \]
                  5. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                  6. Applied rewrites43.5%

                    \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\left(\sqrt{\ell \cdot h} \cdot \ell\right) \cdot d}, -0.125, \frac{d}{\sqrt{\ell \cdot h} \cdot \left(D \cdot D\right)}\right) \cdot \color{blue}{\left(D \cdot D\right)} \]
                  7. Taylor expanded in d around inf

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
                  8. Step-by-step derivation
                    1. sqrt-prodN/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    2. lower-/.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    3. lift-sqrt.f64N/A

                      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                    5. lift-*.f6442.9

                      \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  9. Applied rewrites42.9%

                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 18: 42.9% accurate, 10.2× speedup?

                \[\begin{array}{l} d_m = \left|d\right| \\ M_m = \left|M\right| \\ D_m = \left|D\right| \\ [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\ \\ \frac{d\_m}{\sqrt{\ell \cdot h}} \end{array} \]
                d_m = (fabs.f64 d)
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                (FPCore (d_m h l M_m D_m) :precision binary64 (/ d_m (sqrt (* l h))))
                d_m = fabs(d);
                M_m = fabs(M);
                D_m = fabs(D);
                assert(d_m < h && h < l && l < M_m && M_m < D_m);
                double code(double d_m, double h, double l, double M_m, double D_m) {
                	return d_m / sqrt((l * h));
                }
                
                d_m =     private
                M_m =     private
                D_m =     private
                NOTE: d_m, 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_m, h, l, m_m, d_m_1)
                use fmin_fmax_functions
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m_1
                    code = d_m / sqrt((l * h))
                end function
                
                d_m = Math.abs(d);
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                assert d_m < h && h < l && l < M_m && M_m < D_m;
                public static double code(double d_m, double h, double l, double M_m, double D_m) {
                	return d_m / Math.sqrt((l * h));
                }
                
                d_m = math.fabs(d)
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                [d_m, h, l, M_m, D_m] = sort([d_m, h, l, M_m, D_m])
                def code(d_m, h, l, M_m, D_m):
                	return d_m / math.sqrt((l * h))
                
                d_m = abs(d)
                M_m = abs(M)
                D_m = abs(D)
                d_m, h, l, M_m, D_m = sort([d_m, h, l, M_m, D_m])
                function code(d_m, h, l, M_m, D_m)
                	return Float64(d_m / sqrt(Float64(l * h)))
                end
                
                d_m = abs(d);
                M_m = abs(M);
                D_m = abs(D);
                d_m, h, l, M_m, D_m = num2cell(sort([d_m, h, l, M_m, D_m])){:}
                function tmp = code(d_m, h, l, M_m, D_m)
                	tmp = d_m / sqrt((l * h));
                end
                
                d_m = N[Abs[d], $MachinePrecision]
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                NOTE: d_m, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                code[d$95$m_, h_, l_, M$95$m_, D$95$m_] := N[(d$95$m / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                d_m = \left|d\right|
                \\
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                [d_m, h, l, M_m, D_m] = \mathsf{sort}([d_m, h, l, M_m, D_m])\\
                \\
                \frac{d\_m}{\sqrt{\ell \cdot h}}
                \end{array}
                
                Derivation
                1. Initial program 35.4%

                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                2. Taylor expanded in l around inf

                  \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\right)\right)}{{d}^{2} \cdot \ell} + \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
                3. Applied rewrites28.1%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{\left(\left(\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot h\right) \cdot M\right) \cdot M}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot D, D, \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \]
                4. Taylor expanded in D around inf

                  \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right)} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{d \cdot \left(\ell \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)\right)} + \frac{d}{{D}^{2} \cdot \left(\sqrt{h} \cdot \sqrt{\ell}\right)}\right) \cdot {D}^{\color{blue}{2}} \]
                6. Applied rewrites43.5%

                  \[\leadsto \mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\left(\sqrt{\ell \cdot h} \cdot \ell\right) \cdot d}, -0.125, \frac{d}{\sqrt{\ell \cdot h} \cdot \left(D \cdot D\right)}\right) \cdot \color{blue}{\left(D \cdot D\right)} \]
                7. Taylor expanded in d around inf

                  \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
                8. Step-by-step derivation
                  1. sqrt-prodN/A

                    \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                  2. lower-/.f64N/A

                    \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                  3. lift-sqrt.f64N/A

                    \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                  4. *-commutativeN/A

                    \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                  5. lift-*.f6442.9

                    \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \]
                9. Applied rewrites42.9%

                  \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                10. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2025140 
                (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)))))