Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.2% → 77.7%
Time: 19.5s
Alternatives: 24
Speedup: 1.8×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 alternatives:

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

Initial Program: 66.2% accurate, 1.0× speedup?

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

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

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

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

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

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


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

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < d < 7.1999999999999996e165

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{{\left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)}^{2} \cdot \left(\frac{1}{2} \cdot h\right)}{\ell}\right) \]
      17. lower-*.f6459.5

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \left(\color{blue}{\frac{1}{2}} \cdot h\right)}{\ell}\right) \]
      19. metadata-eval59.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.1999999999999996e165 < d

    1. Initial program 68.2%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
    5. Applied rewrites77.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    6. Step-by-step derivation
      1. Applied rewrites94.6%

        \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]
    7. Recombined 3 regimes into one program.
    8. Final simplification80.9%

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

    Alternative 2: 54.3% accurate, 0.2× speedup?

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

      1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
        22. lift-*.f6463.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(M \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{d \cdot \left(2 \cdot \left(d \cdot 2\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
        18. lower-*.f6452.1

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

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

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

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

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

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

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

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

      if -2.0000000000000001e-173 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e-165

      1. Initial program 67.2%

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

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

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

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

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

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

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

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
      5. Applied rewrites67.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      6. Step-by-step derivation
        1. Applied rewrites67.1%

          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
        2. Step-by-step derivation
          1. Applied rewrites67.2%

            \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]

          if 1e-165 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000002e166

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
            22. lift-*.f6493.3

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

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

            \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
          8. Step-by-step derivation
            1. Applied rewrites93.3%

              \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

            if 5.0000000000000002e166 < (*.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 28.1%

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

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

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

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
            5. Applied rewrites37.1%

              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
            6. Step-by-step derivation
              1. Applied rewrites37.1%

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              2. Step-by-step derivation
                1. Applied rewrites37.7%

                  \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
              3. Recombined 4 regimes into one program.
              4. Final simplification57.6%

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

              Alternative 3: 54.1% accurate, 0.2× speedup?

              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+118}:\\ \;\;\;\;t\_0 \cdot \left(\left(\frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell} \cdot -0.125\right) \cdot \frac{\frac{D\_m \cdot D\_m}{d}}{d}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{-165}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+166}:\\ \;\;\;\;1 \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
              D_m = (fabs.f64 D)
              M_m = (fabs.f64 M)
              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              (FPCore (d h l M_m D_m)
               :precision binary64
               (let* ((t_0 (sqrt (* (/ d l) (/ d h))))
                      (t_1
                       (*
                        (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                        (-
                         1.0
                         (*
                          (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                          (/ h l))))))
                 (if (<= t_1 -1e+118)
                   (* t_0 (* (* (/ (* (* M_m M_m) h) l) -0.125) (/ (/ (* D_m D_m) d) d)))
                   (if (<= t_1 1e-165)
                     (/ d (sqrt (* l h)))
                     (if (<= t_1 5e+166)
                       (* 1.0 t_0)
                       (* (pow (* (sqrt l) (sqrt h)) -1.0) d))))))
              D_m = fabs(D);
              M_m = fabs(M);
              assert(d < h && h < l && l < M_m && M_m < D_m);
              double code(double d, double h, double l, double M_m, double D_m) {
              	double t_0 = sqrt(((d / l) * (d / h)));
              	double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
              	double tmp;
              	if (t_1 <= -1e+118) {
              		tmp = t_0 * (((((M_m * M_m) * h) / l) * -0.125) * (((D_m * D_m) / d) / d));
              	} else if (t_1 <= 1e-165) {
              		tmp = d / sqrt((l * h));
              	} else if (t_1 <= 5e+166) {
              		tmp = 1.0 * t_0;
              	} else {
              		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
              	}
              	return tmp;
              }
              
              D_m =     private
              M_m =     private
              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(d, h, l, m_m, d_m)
              use fmin_fmax_functions
                  real(8), intent (in) :: d
                  real(8), intent (in) :: h
                  real(8), intent (in) :: l
                  real(8), intent (in) :: m_m
                  real(8), intent (in) :: d_m
                  real(8) :: t_0
                  real(8) :: t_1
                  real(8) :: tmp
                  t_0 = sqrt(((d / l) * (d / h)))
                  t_1 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                  if (t_1 <= (-1d+118)) then
                      tmp = t_0 * (((((m_m * m_m) * h) / l) * (-0.125d0)) * (((d_m * d_m) / d) / d))
                  else if (t_1 <= 1d-165) then
                      tmp = d / sqrt((l * h))
                  else if (t_1 <= 5d+166) then
                      tmp = 1.0d0 * t_0
                  else
                      tmp = ((sqrt(l) * sqrt(h)) ** (-1.0d0)) * d
                  end if
                  code = tmp
              end function
              
              D_m = Math.abs(D);
              M_m = Math.abs(M);
              assert d < h && h < l && l < M_m && M_m < D_m;
              public static double code(double d, double h, double l, double M_m, double D_m) {
              	double t_0 = Math.sqrt(((d / l) * (d / h)));
              	double t_1 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
              	double tmp;
              	if (t_1 <= -1e+118) {
              		tmp = t_0 * (((((M_m * M_m) * h) / l) * -0.125) * (((D_m * D_m) / d) / d));
              	} else if (t_1 <= 1e-165) {
              		tmp = d / Math.sqrt((l * h));
              	} else if (t_1 <= 5e+166) {
              		tmp = 1.0 * t_0;
              	} else {
              		tmp = Math.pow((Math.sqrt(l) * Math.sqrt(h)), -1.0) * d;
              	}
              	return tmp;
              }
              
              D_m = math.fabs(D)
              M_m = math.fabs(M)
              [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
              def code(d, h, l, M_m, D_m):
              	t_0 = math.sqrt(((d / l) * (d / h)))
              	t_1 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
              	tmp = 0
              	if t_1 <= -1e+118:
              		tmp = t_0 * (((((M_m * M_m) * h) / l) * -0.125) * (((D_m * D_m) / d) / d))
              	elif t_1 <= 1e-165:
              		tmp = d / math.sqrt((l * h))
              	elif t_1 <= 5e+166:
              		tmp = 1.0 * t_0
              	else:
              		tmp = math.pow((math.sqrt(l) * math.sqrt(h)), -1.0) * d
              	return tmp
              
              D_m = abs(D)
              M_m = abs(M)
              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
              function code(d, h, l, M_m, D_m)
              	t_0 = sqrt(Float64(Float64(d / l) * Float64(d / h)))
              	t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
              	tmp = 0.0
              	if (t_1 <= -1e+118)
              		tmp = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(M_m * M_m) * h) / l) * -0.125) * Float64(Float64(Float64(D_m * D_m) / d) / d)));
              	elseif (t_1 <= 1e-165)
              		tmp = Float64(d / sqrt(Float64(l * h)));
              	elseif (t_1 <= 5e+166)
              		tmp = Float64(1.0 * t_0);
              	else
              		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
              	end
              	return tmp
              end
              
              D_m = abs(D);
              M_m = abs(M);
              d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
              function tmp_2 = code(d, h, l, M_m, D_m)
              	t_0 = sqrt(((d / l) * (d / h)));
              	t_1 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
              	tmp = 0.0;
              	if (t_1 <= -1e+118)
              		tmp = t_0 * (((((M_m * M_m) * h) / l) * -0.125) * (((D_m * D_m) / d) / d));
              	elseif (t_1 <= 1e-165)
              		tmp = d / sqrt((l * h));
              	elseif (t_1 <= 5e+166)
              		tmp = 1.0 * t_0;
              	else
              		tmp = ((sqrt(l) * sqrt(h)) ^ -1.0) * d;
              	end
              	tmp_2 = tmp;
              end
              
              D_m = N[Abs[D], $MachinePrecision]
              M_m = N[Abs[M], $MachinePrecision]
              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+118], N[(t$95$0 * N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-165], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+166], N[(1.0 * t$95$0), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              D_m = \left|D\right|
              \\
              M_m = \left|M\right|
              \\
              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
              \\
              \begin{array}{l}
              t_0 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
              t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+118}:\\
              \;\;\;\;t\_0 \cdot \left(\left(\frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell} \cdot -0.125\right) \cdot \frac{\frac{D\_m \cdot D\_m}{d}}{d}\right)\\
              
              \mathbf{elif}\;t\_1 \leq 10^{-165}:\\
              \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
              
              \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+166}:\\
              \;\;\;\;1 \cdot t\_0\\
              
              \mathbf{else}:\\
              \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.99999999999999967e117

                1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -9.99999999999999967e117 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e-165

                  1. Initial program 76.2%

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

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

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

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

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

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

                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                    6. lower-*.f6448.9

                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                  5. Applied rewrites48.9%

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

                      \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                    2. Step-by-step derivation
                      1. Applied rewrites49.0%

                        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]

                      if 1e-165 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000002e166

                      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                        22. lift-*.f6493.3

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

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

                        \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                      8. Step-by-step derivation
                        1. Applied rewrites93.3%

                          \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                        if 5.0000000000000002e166 < (*.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 28.1%

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

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

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

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

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

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

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

                            \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                        5. Applied rewrites37.1%

                          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                        6. Step-by-step derivation
                          1. Applied rewrites37.1%

                            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                          2. Step-by-step derivation
                            1. Applied rewrites37.7%

                              \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                          3. Recombined 4 regimes into one program.
                          4. Final simplification53.7%

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

                          Alternative 4: 51.2% accurate, 0.2× speedup?

                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-122}:\\ \;\;\;\;\left(\left(h \cdot -0.125\right) \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot \frac{D\_m}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{-165}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+166}:\\ \;\;\;\;1 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                          D_m = (fabs.f64 D)
                          M_m = (fabs.f64 M)
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          (FPCore (d h l M_m D_m)
                           :precision binary64
                           (let* ((t_0
                                   (*
                                    (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                    (-
                                     1.0
                                     (*
                                      (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                      (/ h l)))))
                                  (t_1 (sqrt (* (/ d l) (/ d h)))))
                             (if (<= t_0 -2e-122)
                               (* (* (* h -0.125) (* (* (* M_m M_m) D_m) (/ D_m (* (* d d) l)))) t_1)
                               (if (<= t_0 1e-165)
                                 (/ d (sqrt (* l h)))
                                 (if (<= t_0 5e+166)
                                   (* 1.0 t_1)
                                   (* (pow (* (sqrt l) (sqrt h)) -1.0) d))))))
                          D_m = fabs(D);
                          M_m = fabs(M);
                          assert(d < h && h < l && l < M_m && M_m < D_m);
                          double code(double d, double h, double l, double M_m, double D_m) {
                          	double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                          	double t_1 = sqrt(((d / l) * (d / h)));
                          	double tmp;
                          	if (t_0 <= -2e-122) {
                          		tmp = ((h * -0.125) * (((M_m * M_m) * D_m) * (D_m / ((d * d) * l)))) * t_1;
                          	} else if (t_0 <= 1e-165) {
                          		tmp = d / sqrt((l * h));
                          	} else if (t_0 <= 5e+166) {
                          		tmp = 1.0 * t_1;
                          	} else {
                          		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                          	}
                          	return tmp;
                          }
                          
                          D_m =     private
                          M_m =     private
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(d, h, l, m_m, d_m)
                          use fmin_fmax_functions
                              real(8), intent (in) :: d
                              real(8), intent (in) :: h
                              real(8), intent (in) :: l
                              real(8), intent (in) :: m_m
                              real(8), intent (in) :: d_m
                              real(8) :: t_0
                              real(8) :: t_1
                              real(8) :: tmp
                              t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                              t_1 = sqrt(((d / l) * (d / h)))
                              if (t_0 <= (-2d-122)) then
                                  tmp = ((h * (-0.125d0)) * (((m_m * m_m) * d_m) * (d_m / ((d * d) * l)))) * t_1
                              else if (t_0 <= 1d-165) then
                                  tmp = d / sqrt((l * h))
                              else if (t_0 <= 5d+166) then
                                  tmp = 1.0d0 * t_1
                              else
                                  tmp = ((sqrt(l) * sqrt(h)) ** (-1.0d0)) * d
                              end if
                              code = tmp
                          end function
                          
                          D_m = Math.abs(D);
                          M_m = Math.abs(M);
                          assert d < h && h < l && l < M_m && M_m < D_m;
                          public static double code(double d, double h, double l, double M_m, double D_m) {
                          	double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                          	double t_1 = Math.sqrt(((d / l) * (d / h)));
                          	double tmp;
                          	if (t_0 <= -2e-122) {
                          		tmp = ((h * -0.125) * (((M_m * M_m) * D_m) * (D_m / ((d * d) * l)))) * t_1;
                          	} else if (t_0 <= 1e-165) {
                          		tmp = d / Math.sqrt((l * h));
                          	} else if (t_0 <= 5e+166) {
                          		tmp = 1.0 * t_1;
                          	} else {
                          		tmp = Math.pow((Math.sqrt(l) * Math.sqrt(h)), -1.0) * d;
                          	}
                          	return tmp;
                          }
                          
                          D_m = math.fabs(D)
                          M_m = math.fabs(M)
                          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                          def code(d, h, l, M_m, D_m):
                          	t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
                          	t_1 = math.sqrt(((d / l) * (d / h)))
                          	tmp = 0
                          	if t_0 <= -2e-122:
                          		tmp = ((h * -0.125) * (((M_m * M_m) * D_m) * (D_m / ((d * d) * l)))) * t_1
                          	elif t_0 <= 1e-165:
                          		tmp = d / math.sqrt((l * h))
                          	elif t_0 <= 5e+166:
                          		tmp = 1.0 * t_1
                          	else:
                          		tmp = math.pow((math.sqrt(l) * math.sqrt(h)), -1.0) * d
                          	return tmp
                          
                          D_m = abs(D)
                          M_m = abs(M)
                          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                          function code(d, h, l, M_m, D_m)
                          	t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                          	t_1 = sqrt(Float64(Float64(d / l) * Float64(d / h)))
                          	tmp = 0.0
                          	if (t_0 <= -2e-122)
                          		tmp = Float64(Float64(Float64(h * -0.125) * Float64(Float64(Float64(M_m * M_m) * D_m) * Float64(D_m / Float64(Float64(d * d) * l)))) * t_1);
                          	elseif (t_0 <= 1e-165)
                          		tmp = Float64(d / sqrt(Float64(l * h)));
                          	elseif (t_0 <= 5e+166)
                          		tmp = Float64(1.0 * t_1);
                          	else
                          		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                          	end
                          	return tmp
                          end
                          
                          D_m = abs(D);
                          M_m = abs(M);
                          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                          function tmp_2 = code(d, h, l, M_m, D_m)
                          	t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
                          	t_1 = sqrt(((d / l) * (d / h)));
                          	tmp = 0.0;
                          	if (t_0 <= -2e-122)
                          		tmp = ((h * -0.125) * (((M_m * M_m) * D_m) * (D_m / ((d * d) * l)))) * t_1;
                          	elseif (t_0 <= 1e-165)
                          		tmp = d / sqrt((l * h));
                          	elseif (t_0 <= 5e+166)
                          		tmp = 1.0 * t_1;
                          	else
                          		tmp = ((sqrt(l) * sqrt(h)) ^ -1.0) * d;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          D_m = N[Abs[D], $MachinePrecision]
                          M_m = N[Abs[M], $MachinePrecision]
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -2e-122], N[(N[(N[(h * -0.125), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(D$95$m / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1e-165], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+166], N[(1.0 * t$95$1), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]]]]]
                          
                          \begin{array}{l}
                          D_m = \left|D\right|
                          \\
                          M_m = \left|M\right|
                          \\
                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                          \\
                          \begin{array}{l}
                          t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                          t_1 := \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
                          \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-122}:\\
                          \;\;\;\;\left(\left(h \cdot -0.125\right) \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot D\_m\right) \cdot \frac{D\_m}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot t\_1\\
                          
                          \mathbf{elif}\;t\_0 \leq 10^{-165}:\\
                          \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
                          
                          \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+166}:\\
                          \;\;\;\;1 \cdot t\_1\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.00000000000000012e-122

                            1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                              22. lift-*.f6464.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(\left(h \cdot -0.125\right) \cdot \left(\left(\left(M \cdot M\right) \cdot D\right) \cdot \frac{D}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                            9. Applied rewrites43.3%

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

                            if -2.00000000000000012e-122 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e-165

                            1. Initial program 69.1%

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

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

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

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

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

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

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                              6. lower-*.f6463.7

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                            5. Applied rewrites63.7%

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                            6. Step-by-step derivation
                              1. Applied rewrites63.7%

                                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                              2. Step-by-step derivation
                                1. Applied rewrites63.7%

                                  \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]

                                if 1e-165 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000002e166

                                1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                  22. lift-*.f6493.3

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

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

                                  \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                8. Step-by-step derivation
                                  1. Applied rewrites93.3%

                                    \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                  if 5.0000000000000002e166 < (*.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 28.1%

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

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

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

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

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

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

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

                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                  5. Applied rewrites37.1%

                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites37.1%

                                      \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites37.7%

                                        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                    3. Recombined 4 regimes into one program.
                                    4. Final simplification54.5%

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

                                    Alternative 5: 69.2% accurate, 0.3× speedup?

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

                                      1. Initial program 87.4%

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

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

                                          \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                        4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{d \cdot 2}}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                        9. lower-*.f6487.4

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

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

                                      if 4.99999999999999983e218 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

                                      1. Initial program 53.7%

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

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

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

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

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

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

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

                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                      5. Applied rewrites64.4%

                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites66.6%

                                          \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]

                                        if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

                                        1. Initial program 0.0%

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(M \cdot M\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right), \sqrt{\frac{h}{{\ell}^{3}}}, \sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \]
                                        5. Step-by-step derivation
                                          1. Applied rewrites19.4%

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

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\left(\left(\frac{D}{d} \cdot D\right) \cdot -0.125\right) \cdot M\right), M, \frac{d}{\sqrt{\ell \cdot h}}\right)} \]
                                        6. Recombined 3 regimes into one program.
                                        7. Final simplification74.0%

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

                                        Alternative 6: 68.4% accurate, 0.3× speedup?

                                        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{\frac{D\_m}{d}}{2} \cdot M\_m\\ t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+218}:\\ \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\left(\left(\frac{D\_m}{d} \cdot D\_m\right) \cdot -0.125\right) \cdot M\_m\right), M\_m, \frac{d}{\sqrt{\ell \cdot h}}\right)\\ \end{array} \end{array} \]
                                        D_m = (fabs.f64 D)
                                        M_m = (fabs.f64 M)
                                        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                        (FPCore (d h l M_m D_m)
                                         :precision binary64
                                         (let* ((t_0 (* (/ (/ D_m d) 2.0) M_m))
                                                (t_1
                                                 (*
                                                  (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                  (-
                                                   1.0
                                                   (*
                                                    (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                                    (/ h l))))))
                                           (if (<= t_1 5e+218)
                                             (*
                                              (* (fma (* t_0 (* t_0 -0.5)) (/ h l) 1.0) (sqrt (/ d h)))
                                              (sqrt (/ d l)))
                                             (if (<= t_1 INFINITY)
                                               (* (/ (sqrt (pow l -1.0)) (sqrt h)) d)
                                               (fma
                                                (* (/ (sqrt h) (pow l 1.5)) (* (* (* (/ D_m d) D_m) -0.125) M_m))
                                                M_m
                                                (/ d (sqrt (* l h))))))))
                                        D_m = fabs(D);
                                        M_m = fabs(M);
                                        assert(d < h && h < l && l < M_m && M_m < D_m);
                                        double code(double d, double h, double l, double M_m, double D_m) {
                                        	double t_0 = ((D_m / d) / 2.0) * M_m;
                                        	double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                                        	double tmp;
                                        	if (t_1 <= 5e+218) {
                                        		tmp = (fma((t_0 * (t_0 * -0.5)), (h / l), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                        	} else if (t_1 <= ((double) INFINITY)) {
                                        		tmp = (sqrt(pow(l, -1.0)) / sqrt(h)) * d;
                                        	} else {
                                        		tmp = fma(((sqrt(h) / pow(l, 1.5)) * ((((D_m / d) * D_m) * -0.125) * M_m)), M_m, (d / sqrt((l * h))));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        D_m = abs(D)
                                        M_m = abs(M)
                                        d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                        function code(d, h, l, M_m, D_m)
                                        	t_0 = Float64(Float64(Float64(D_m / d) / 2.0) * M_m)
                                        	t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                                        	tmp = 0.0
                                        	if (t_1 <= 5e+218)
                                        		tmp = Float64(Float64(fma(Float64(t_0 * Float64(t_0 * -0.5)), Float64(h / l), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                        	elseif (t_1 <= Inf)
                                        		tmp = Float64(Float64(sqrt((l ^ -1.0)) / sqrt(h)) * d);
                                        	else
                                        		tmp = fma(Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(Float64(Float64(Float64(D_m / d) * D_m) * -0.125) * M_m)), M_m, Float64(d / sqrt(Float64(l * h))));
                                        	end
                                        	return tmp
                                        end
                                        
                                        D_m = N[Abs[D], $MachinePrecision]
                                        M_m = N[Abs[M], $MachinePrecision]
                                        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                        code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(D$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision] * M$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+218], N[(N[(N[(N[(t$95$0 * N[(t$95$0 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[Sqrt[N[Power[l, -1.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(D$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * M$95$m + N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                        
                                        \begin{array}{l}
                                        D_m = \left|D\right|
                                        \\
                                        M_m = \left|M\right|
                                        \\
                                        [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                        \\
                                        \begin{array}{l}
                                        t_0 := \frac{\frac{D\_m}{d}}{2} \cdot M\_m\\
                                        t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                                        \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+218}:\\
                                        \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                        
                                        \mathbf{elif}\;t\_1 \leq \infty:\\
                                        \;\;\;\;\frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\left(\left(\frac{D\_m}{d} \cdot D\_m\right) \cdot -0.125\right) \cdot M\_m\right), M\_m, \frac{d}{\sqrt{\ell \cdot h}}\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999983e218

                                          1. Initial program 87.4%

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

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

                                              \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                            4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{\color{blue}{\frac{D}{d}}}{2} \cdot M\right) \cdot \left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                            19. lower-*.f6486.2

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

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

                                          if 4.99999999999999983e218 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

                                          1. Initial program 53.7%

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

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

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

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

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

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

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

                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                          5. Applied rewrites64.4%

                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites66.6%

                                              \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]

                                            if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

                                            1. Initial program 0.0%

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

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

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(M \cdot M\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right), \sqrt{\frac{h}{{\ell}^{3}}}, \sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites19.4%

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

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(\left(\left(\frac{D}{d} \cdot D\right) \cdot -0.125\right) \cdot M\right), M, \frac{d}{\sqrt{\ell \cdot h}}\right)} \]
                                            6. Recombined 3 regimes into one program.
                                            7. Final simplification73.6%

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

                                            Alternative 7: 68.4% accurate, 0.3× speedup?

                                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{\frac{D\_m}{d}}{2} \cdot M\_m\\ t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+218}:\\ \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot M\_m, \left(\left(\frac{D\_m}{d} \cdot D\_m\right) \cdot -0.125\right) \cdot M\_m, \frac{d}{\sqrt{\ell \cdot h}}\right)\\ \end{array} \end{array} \]
                                            D_m = (fabs.f64 D)
                                            M_m = (fabs.f64 M)
                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                            (FPCore (d h l M_m D_m)
                                             :precision binary64
                                             (let* ((t_0 (* (/ (/ D_m d) 2.0) M_m))
                                                    (t_1
                                                     (*
                                                      (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                      (-
                                                       1.0
                                                       (*
                                                        (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                                        (/ h l))))))
                                               (if (<= t_1 5e+218)
                                                 (*
                                                  (* (fma (* t_0 (* t_0 -0.5)) (/ h l) 1.0) (sqrt (/ d h)))
                                                  (sqrt (/ d l)))
                                                 (if (<= t_1 INFINITY)
                                                   (* (/ (sqrt (pow l -1.0)) (sqrt h)) d)
                                                   (fma
                                                    (* (/ (sqrt h) (pow l 1.5)) M_m)
                                                    (* (* (* (/ D_m d) D_m) -0.125) M_m)
                                                    (/ d (sqrt (* l h))))))))
                                            D_m = fabs(D);
                                            M_m = fabs(M);
                                            assert(d < h && h < l && l < M_m && M_m < D_m);
                                            double code(double d, double h, double l, double M_m, double D_m) {
                                            	double t_0 = ((D_m / d) / 2.0) * M_m;
                                            	double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                                            	double tmp;
                                            	if (t_1 <= 5e+218) {
                                            		tmp = (fma((t_0 * (t_0 * -0.5)), (h / l), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                            	} else if (t_1 <= ((double) INFINITY)) {
                                            		tmp = (sqrt(pow(l, -1.0)) / sqrt(h)) * d;
                                            	} else {
                                            		tmp = fma(((sqrt(h) / pow(l, 1.5)) * M_m), ((((D_m / d) * D_m) * -0.125) * M_m), (d / sqrt((l * h))));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            D_m = abs(D)
                                            M_m = abs(M)
                                            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                            function code(d, h, l, M_m, D_m)
                                            	t_0 = Float64(Float64(Float64(D_m / d) / 2.0) * M_m)
                                            	t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                                            	tmp = 0.0
                                            	if (t_1 <= 5e+218)
                                            		tmp = Float64(Float64(fma(Float64(t_0 * Float64(t_0 * -0.5)), Float64(h / l), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                            	elseif (t_1 <= Inf)
                                            		tmp = Float64(Float64(sqrt((l ^ -1.0)) / sqrt(h)) * d);
                                            	else
                                            		tmp = fma(Float64(Float64(sqrt(h) / (l ^ 1.5)) * M_m), Float64(Float64(Float64(Float64(D_m / d) * D_m) * -0.125) * M_m), Float64(d / sqrt(Float64(l * h))));
                                            	end
                                            	return tmp
                                            end
                                            
                                            D_m = N[Abs[D], $MachinePrecision]
                                            M_m = N[Abs[M], $MachinePrecision]
                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(D$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision] * M$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+218], N[(N[(N[(N[(t$95$0 * N[(t$95$0 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[Sqrt[N[Power[l, -1.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], N[(N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[(N[(N[(D$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * M$95$m), $MachinePrecision] + N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                            
                                            \begin{array}{l}
                                            D_m = \left|D\right|
                                            \\
                                            M_m = \left|M\right|
                                            \\
                                            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{\frac{D\_m}{d}}{2} \cdot M\_m\\
                                            t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                                            \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+218}:\\
                                            \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                            
                                            \mathbf{elif}\;t\_1 \leq \infty:\\
                                            \;\;\;\;\frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot M\_m, \left(\left(\frac{D\_m}{d} \cdot D\_m\right) \cdot -0.125\right) \cdot M\_m, \frac{d}{\sqrt{\ell \cdot h}}\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999983e218

                                              1. Initial program 87.4%

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

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

                                                  \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{\color{blue}{\frac{D}{d}}}{2} \cdot M\right) \cdot \left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                19. lower-*.f6486.2

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

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

                                              if 4.99999999999999983e218 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

                                              1. Initial program 53.7%

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

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

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

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

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

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

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

                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                              5. Applied rewrites64.4%

                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites66.6%

                                                  \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]

                                                if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

                                                1. Initial program 0.0%

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

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

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(M \cdot M\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right), \sqrt{\frac{h}{{\ell}^{3}}}, \sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)} \]
                                                5. Step-by-step derivation
                                                  1. Applied rewrites19.4%

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

                                                    \[\leadsto \mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot M, \color{blue}{\left(\left(\frac{D}{d} \cdot D\right) \cdot -0.125\right) \cdot M}, \frac{d}{\sqrt{\ell \cdot h}}\right) \]
                                                6. Recombined 3 regimes into one program.
                                                7. Final simplification73.5%

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

                                                Alternative 8: 66.7% accurate, 0.5× speedup?

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

                                                  1. Initial program 87.4%

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

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

                                                      \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                    4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{\color{blue}{\frac{D}{d}}}{2} \cdot M\right) \cdot \left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                    19. lower-*.f6486.2

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

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

                                                  if 4.99999999999999983e218 < (*.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 25.6%

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

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

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

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

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

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

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

                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                  5. Applied rewrites37.2%

                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites38.0%

                                                      \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]
                                                  7. Recombined 2 regimes into one program.
                                                  8. Final simplification70.0%

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

                                                  Alternative 9: 66.7% accurate, 0.5× speedup?

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

                                                    1. Initial program 87.4%

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

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

                                                        \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                      4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left(\mathsf{fma}\left(\left(\frac{\color{blue}{\frac{D}{d}}}{2} \cdot M\right) \cdot \left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                      19. lower-*.f6486.2

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

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

                                                    if 4.99999999999999983e218 < (*.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 25.6%

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

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

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

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

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

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

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

                                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                    5. Applied rewrites37.2%

                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites37.2%

                                                        \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites37.8%

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

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

                                                      Alternative 10: 57.5% accurate, 0.5× speedup?

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

                                                        1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                          22. lift-*.f6470.7

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 5.0000000000000002e166 < (*.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 28.1%

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

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

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

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

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

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

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

                                                            \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                        5. Applied rewrites37.1%

                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites37.1%

                                                            \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites37.7%

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

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

                                                          Alternative 11: 71.2% accurate, 1.2× speedup?

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

                                                            1. Initial program 71.9%

                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                            2. Add Preprocessing
                                                            3. 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. *-commutativeN/A

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

                                                                \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                              4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{d \cdot 2}}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                              9. lower-*.f6471.9

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

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

                                                            if 4.3000000000000002e-308 < d < 7.1999999999999996e165

                                                            1. Initial program 59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \left(\color{blue}{\frac{1}{2}} \cdot h\right)}{\ell}\right) \]
                                                              19. metadata-eval60.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            if 7.1999999999999996e165 < d

                                                            1. Initial program 68.2%

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

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

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

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

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

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

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

                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                            5. Applied rewrites77.4%

                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites94.6%

                                                                \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]
                                                            7. Recombined 3 regimes into one program.
                                                            8. Final simplification76.7%

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

                                                            Alternative 12: 59.2% accurate, 1.8× speedup?

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

                                                              1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                22. lift-*.f6464.6

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

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

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

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

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

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

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

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

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

                                                              if -1.07999999999999996e-244 < d < 1.05000000000000004e-87

                                                              1. Initial program 44.7%

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

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

                                                                  \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              if 6.8000000000000001e167 < d

                                                              1. Initial program 67.4%

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

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

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

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

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

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

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

                                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                              5. Applied rewrites79.3%

                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites79.3%

                                                                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites79.3%

                                                                    \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                  2. Step-by-step derivation
                                                                    1. Applied rewrites94.4%

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

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.08 \cdot 10^{-244}:\\ \;\;\;\;\left(\left(-h\right) \cdot \left(\frac{0.125}{\ell} \cdot \left(\left(\frac{D}{d} \cdot M\right) \cdot \left(\frac{D}{d} \cdot M\right)\right) - {h}^{-1}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{-87}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq 6.8 \cdot 10^{+167}:\\ \;\;\;\;\left(\left(-h\right) \cdot \left(\frac{0.125}{\ell} \cdot \left(\left(\frac{D}{d} \cdot M\right) \cdot \left(\frac{D}{d} \cdot M\right)\right) - {h}^{-1}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                  5. Add Preprocessing

                                                                  Alternative 13: 70.0% accurate, 1.8× speedup?

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

                                                                    1. Initial program 71.9%

                                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                    2. Add Preprocessing
                                                                    3. 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. *-commutativeN/A

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

                                                                        \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                      4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{d \cdot 2}}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                      9. lower-*.f6471.9

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

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

                                                                    if 4.3000000000000002e-308 < d < 7.09999999999999976e165

                                                                    1. Initial program 59.8%

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

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

                                                                        \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                      4. associate-*r*N/A

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

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

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

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

                                                                    if 7.09999999999999976e165 < d

                                                                    1. Initial program 68.2%

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

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

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

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

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

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

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

                                                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                    5. Applied rewrites77.4%

                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites94.6%

                                                                        \[\leadsto \frac{\sqrt{{\ell}^{-1}}}{\sqrt{h}} \cdot d \]
                                                                    7. Recombined 3 regimes into one program.
                                                                    8. Add Preprocessing

                                                                    Alternative 14: 57.0% accurate, 2.9× speedup?

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

                                                                      1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(\frac{M}{d} \cdot D\right)}}{2 \cdot 2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                        16. metadata-eval64.7

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

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

                                                                      if -1.04000000000000003e-244 < d < 4.6e64

                                                                      1. Initial program 57.0%

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

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

                                                                          \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                        4. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                        12. lower-*.f6446.2

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

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

                                                                      if 4.6e64 < d

                                                                      1. Initial program 67.0%

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

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

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

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

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

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

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

                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                      5. Applied rewrites67.8%

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

                                                                          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                        2. Step-by-step derivation
                                                                          1. Applied rewrites84.2%

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

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

                                                                        Alternative 15: 56.8% accurate, 2.9× speedup?

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

                                                                          1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            16. lower-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            17. lift-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            18. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            19. lower-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            20. lower-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            21. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            22. lift-*.f6463.6

                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                          6. Applied rewrites63.6%

                                                                            \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                          7. Step-by-step derivation
                                                                            1. lift-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            2. lift-/.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\color{blue}{\frac{M}{d}} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            3. associate-*l/N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\frac{M \cdot D}{d}} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            4. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\frac{\color{blue}{D \cdot M}}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            5. lift-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\frac{\color{blue}{D \cdot M}}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            6. lower-/.f6463.7

                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\color{blue}{\frac{D \cdot M}{d}} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            7. lift-*.f64N/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\frac{\color{blue}{D \cdot M}}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            8. *-commutativeN/A

                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\frac{\color{blue}{M \cdot D}}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                            9. lower-*.f6463.7

                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\frac{\color{blue}{M \cdot D}}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                          8. Applied rewrites63.7%

                                                                            \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\color{blue}{\frac{M \cdot D}{d}} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                                                          if -1.04000000000000003e-244 < d < 4.6e64

                                                                          1. Initial program 57.0%

                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Step-by-step derivation
                                                                            1. 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. *-commutativeN/A

                                                                              \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                            3. lift-*.f64N/A

                                                                              \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                            4. associate-*r*N/A

                                                                              \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                            5. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                          4. Applied rewrites57.0%

                                                                            \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                          5. Taylor expanded in d around 0

                                                                            \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                          6. Step-by-step derivation
                                                                            1. associate-/l*N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{{d}^{2}}\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            2. associate-*r*N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            3. lower-*.f64N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            4. lower-*.f64N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right)} \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            5. unpow2N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            6. lower-*.f64N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            7. unpow2N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{{M}^{2}}{\color{blue}{d \cdot d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            8. associate-/r*N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            9. lower-/.f64N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            10. lower-/.f64N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{\frac{{M}^{2}}{d}}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            11. unpow2N/A

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                            12. lower-*.f6446.2

                                                                              \[\leadsto \left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                          7. Applied rewrites46.2%

                                                                            \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                          if 4.6e64 < d

                                                                          1. Initial program 67.0%

                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in d around inf

                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                          4. Step-by-step derivation
                                                                            1. *-commutativeN/A

                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                            2. lower-*.f64N/A

                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                            3. lower-sqrt.f64N/A

                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                            4. lower-/.f64N/A

                                                                              \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                            5. *-commutativeN/A

                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                            6. lower-*.f6467.8

                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                          5. Applied rewrites67.8%

                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                          6. Step-by-step derivation
                                                                            1. Applied rewrites67.9%

                                                                              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                            2. Step-by-step derivation
                                                                              1. Applied rewrites84.2%

                                                                                \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                                                            3. Recombined 3 regimes into one program.
                                                                            4. Final simplification61.3%

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.04 \cdot 10^{-244}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\frac{M \cdot D}{d} \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                                            5. Add Preprocessing

                                                                            Alternative 16: 56.6% accurate, 2.9× speedup?

                                                                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -1.04 \cdot 10^{-244}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M\_m}{d} \cdot D\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{\frac{M\_m \cdot M\_m}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                                                                            D_m = (fabs.f64 D)
                                                                            M_m = (fabs.f64 M)
                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                            (FPCore (d h l M_m D_m)
                                                                             :precision binary64
                                                                             (if (<= d -1.04e-244)
                                                                               (*
                                                                                (fma
                                                                                 (* -0.5 (/ (* (* (/ M_m d) D_m) (* D_m M_m)) (* 2.0 (* d 2.0))))
                                                                                 (/ h l)
                                                                                 1.0)
                                                                                (sqrt (* (/ d l) (/ d h))))
                                                                               (if (<= d 4.6e+64)
                                                                                 (*
                                                                                  (*
                                                                                   (fma (* (* -0.125 (* D_m D_m)) (/ (/ (* M_m M_m) d) d)) (/ h l) 1.0)
                                                                                   (sqrt (/ d h)))
                                                                                  (sqrt (/ d l)))
                                                                                 (* (pow (* (sqrt l) (sqrt h)) -1.0) d))))
                                                                            D_m = fabs(D);
                                                                            M_m = fabs(M);
                                                                            assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                            double code(double d, double h, double l, double M_m, double D_m) {
                                                                            	double tmp;
                                                                            	if (d <= -1.04e-244) {
                                                                            		tmp = fma((-0.5 * ((((M_m / d) * D_m) * (D_m * M_m)) / (2.0 * (d * 2.0)))), (h / l), 1.0) * sqrt(((d / l) * (d / h)));
                                                                            	} else if (d <= 4.6e+64) {
                                                                            		tmp = (fma(((-0.125 * (D_m * D_m)) * (((M_m * M_m) / d) / d)), (h / l), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                                                            	} else {
                                                                            		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            D_m = abs(D)
                                                                            M_m = abs(M)
                                                                            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                            function code(d, h, l, M_m, D_m)
                                                                            	tmp = 0.0
                                                                            	if (d <= -1.04e-244)
                                                                            		tmp = Float64(fma(Float64(-0.5 * Float64(Float64(Float64(Float64(M_m / d) * D_m) * Float64(D_m * M_m)) / Float64(2.0 * Float64(d * 2.0)))), Float64(h / l), 1.0) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
                                                                            	elseif (d <= 4.6e+64)
                                                                            		tmp = Float64(Float64(fma(Float64(Float64(-0.125 * Float64(D_m * D_m)) * Float64(Float64(Float64(M_m * M_m) / d) / d)), Float64(h / l), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                                                            	else
                                                                            		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                                                                            	end
                                                                            	return tmp
                                                                            end
                                                                            
                                                                            D_m = N[Abs[D], $MachinePrecision]
                                                                            M_m = N[Abs[M], $MachinePrecision]
                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                            code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -1.04e-244], N[(N[(N[(-0.5 * N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e+64], N[(N[(N[(N[(N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]]
                                                                            
                                                                            \begin{array}{l}
                                                                            D_m = \left|D\right|
                                                                            \\
                                                                            M_m = \left|M\right|
                                                                            \\
                                                                            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                            \\
                                                                            \begin{array}{l}
                                                                            \mathbf{if}\;d \leq -1.04 \cdot 10^{-244}:\\
                                                                            \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M\_m}{d} \cdot D\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
                                                                            
                                                                            \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\
                                                                            \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{\frac{M\_m \cdot M\_m}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 3 regimes
                                                                            2. if d < -1.04000000000000003e-244

                                                                              1. Initial program 75.5%

                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Step-by-step derivation
                                                                                1. 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. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                3. lower-*.f6475.5

                                                                                  \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                              4. Applied rewrites64.7%

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                              5. Step-by-step derivation
                                                                                1. lift-pow.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                2. unpow2N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                3. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                4. lift-/.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                5. associate-*l/N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{D \cdot \frac{M}{d}}{2}} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                6. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                7. lift-/.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                8. lift-/.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                9. frac-timesN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                10. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                11. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                12. frac-timesN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                13. lower-/.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                14. lower-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                15. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                16. lower-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                17. lift-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                18. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                19. lower-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                20. lower-*.f64N/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                21. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                22. lift-*.f6463.6

                                                                                  \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                              6. Applied rewrites63.6%

                                                                                \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                                                              if -1.04000000000000003e-244 < d < 4.6e64

                                                                              1. Initial program 57.0%

                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Step-by-step derivation
                                                                                1. 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. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                3. lift-*.f64N/A

                                                                                  \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                                4. associate-*r*N/A

                                                                                  \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                5. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                              4. Applied rewrites57.0%

                                                                                \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                              5. Taylor expanded in d around 0

                                                                                \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                              6. Step-by-step derivation
                                                                                1. associate-/l*N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{{d}^{2}}\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                2. associate-*r*N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                3. lower-*.f64N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                4. lower-*.f64N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right)} \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                5. unpow2N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                6. lower-*.f64N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                7. unpow2N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{{M}^{2}}{\color{blue}{d \cdot d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                8. associate-/r*N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                9. lower-/.f64N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                10. lower-/.f64N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{\frac{{M}^{2}}{d}}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                11. unpow2N/A

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                12. lower-*.f6446.2

                                                                                  \[\leadsto \left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                              7. Applied rewrites46.2%

                                                                                \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                              if 4.6e64 < d

                                                                              1. Initial program 67.0%

                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in d around inf

                                                                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                2. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                3. lower-sqrt.f64N/A

                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                4. lower-/.f64N/A

                                                                                  \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                5. *-commutativeN/A

                                                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                6. lower-*.f6467.8

                                                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                              5. Applied rewrites67.8%

                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                              6. Step-by-step derivation
                                                                                1. Applied rewrites67.9%

                                                                                  \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                2. Step-by-step derivation
                                                                                  1. Applied rewrites84.2%

                                                                                    \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                                                                3. Recombined 3 regimes into one program.
                                                                                4. Final simplification61.3%

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.04 \cdot 10^{-244}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                                                5. Add Preprocessing

                                                                                Alternative 17: 57.6% accurate, 2.9× speedup?

                                                                                \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -3.1 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{D\_m}{4 \cdot d}\right)}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{\frac{M\_m \cdot M\_m}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                                                                                D_m = (fabs.f64 D)
                                                                                M_m = (fabs.f64 M)
                                                                                NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                (FPCore (d h l M_m D_m)
                                                                                 :precision binary64
                                                                                 (if (<= d -3.1e-11)
                                                                                   (*
                                                                                    (fma (* -0.5 (/ (* (* M_m D_m) (* M_m (/ D_m (* 4.0 d)))) d)) (/ h l) 1.0)
                                                                                    (sqrt (* (/ d l) (/ d h))))
                                                                                   (if (<= d 4.6e+64)
                                                                                     (*
                                                                                      (*
                                                                                       (fma (* (* -0.125 (* D_m D_m)) (/ (/ (* M_m M_m) d) d)) (/ h l) 1.0)
                                                                                       (sqrt (/ d h)))
                                                                                      (sqrt (/ d l)))
                                                                                     (* (pow (* (sqrt l) (sqrt h)) -1.0) d))))
                                                                                D_m = fabs(D);
                                                                                M_m = fabs(M);
                                                                                assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                double code(double d, double h, double l, double M_m, double D_m) {
                                                                                	double tmp;
                                                                                	if (d <= -3.1e-11) {
                                                                                		tmp = fma((-0.5 * (((M_m * D_m) * (M_m * (D_m / (4.0 * d)))) / d)), (h / l), 1.0) * sqrt(((d / l) * (d / h)));
                                                                                	} else if (d <= 4.6e+64) {
                                                                                		tmp = (fma(((-0.125 * (D_m * D_m)) * (((M_m * M_m) / d) / d)), (h / l), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                                                                	} else {
                                                                                		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                D_m = abs(D)
                                                                                M_m = abs(M)
                                                                                d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                function code(d, h, l, M_m, D_m)
                                                                                	tmp = 0.0
                                                                                	if (d <= -3.1e-11)
                                                                                		tmp = Float64(fma(Float64(-0.5 * Float64(Float64(Float64(M_m * D_m) * Float64(M_m * Float64(D_m / Float64(4.0 * d)))) / d)), Float64(h / l), 1.0) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
                                                                                	elseif (d <= 4.6e+64)
                                                                                		tmp = Float64(Float64(fma(Float64(Float64(-0.125 * Float64(D_m * D_m)) * Float64(Float64(Float64(M_m * M_m) / d) / d)), Float64(h / l), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                                                                	else
                                                                                		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                D_m = N[Abs[D], $MachinePrecision]
                                                                                M_m = N[Abs[M], $MachinePrecision]
                                                                                NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -3.1e-11], N[(N[(N[(-0.5 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(D$95$m / N[(4.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e+64], N[(N[(N[(N[(N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                D_m = \left|D\right|
                                                                                \\
                                                                                M_m = \left|M\right|
                                                                                \\
                                                                                [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;d \leq -3.1 \cdot 10^{-11}:\\
                                                                                \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \frac{D\_m}{4 \cdot d}\right)}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
                                                                                
                                                                                \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\
                                                                                \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{\frac{M\_m \cdot M\_m}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 3 regimes
                                                                                2. if d < -3.10000000000000028e-11

                                                                                  1. Initial program 78.0%

                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. 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. *-commutativeN/A

                                                                                      \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                    3. lower-*.f6478.0

                                                                                      \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                  4. Applied rewrites69.1%

                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                                  5. Step-by-step derivation
                                                                                    1. lift-pow.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    2. unpow2N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    3. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    4. lift-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    5. associate-*l/N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{D \cdot \frac{M}{d}}{2}} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    6. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    7. lift-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    8. lift-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    9. frac-timesN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    10. *-commutativeN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    11. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    12. frac-timesN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    13. lower-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    14. lower-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    15. *-commutativeN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    16. lower-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    17. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    18. *-commutativeN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    19. lower-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    20. lower-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    21. *-commutativeN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    22. lift-*.f6467.1

                                                                                      \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                  6. Applied rewrites67.1%

                                                                                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. lift-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    2. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    3. associate-/l*N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{M}{d} \cdot D\right) \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    4. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    5. lift-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{M}{d}} \cdot D\right) \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    6. associate-*l/N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{M \cdot D}{d}} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    7. *-commutativeN/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{\color{blue}{D \cdot M}}{d} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    8. lift-*.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{\color{blue}{D \cdot M}}{d} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    9. associate-*l/N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot M\right) \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                    10. lower-/.f64N/A

                                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot M\right) \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                  8. Applied rewrites67.2%

                                                                                    \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{4 \cdot d}\right)}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                                                                  if -3.10000000000000028e-11 < d < 4.6e64

                                                                                  1. Initial program 61.6%

                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. Step-by-step derivation
                                                                                    1. 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. *-commutativeN/A

                                                                                      \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                    3. lift-*.f64N/A

                                                                                      \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \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)} \]
                                                                                    4. associate-*r*N/A

                                                                                      \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                    5. lower-*.f64N/A

                                                                                      \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                  4. Applied rewrites61.6%

                                                                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                                  5. Taylor expanded in d around 0

                                                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                  6. Step-by-step derivation
                                                                                    1. associate-/l*N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2}}{{d}^{2}}\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    2. associate-*r*N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    3. lower-*.f64N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2}}{{d}^{2}}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    4. lower-*.f64N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right)} \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    5. unpow2N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    6. lower-*.f64N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \frac{{M}^{2}}{{d}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    7. unpow2N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{{M}^{2}}{\color{blue}{d \cdot d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    8. associate-/r*N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    9. lower-/.f64N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{\frac{{M}^{2}}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    10. lower-/.f64N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{\frac{{M}^{2}}{d}}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    11. unpow2N/A

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                    12. lower-*.f6448.5

                                                                                      \[\leadsto \left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                  7. Applied rewrites48.5%

                                                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                                  if 4.6e64 < d

                                                                                  1. Initial program 67.0%

                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in d around inf

                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. *-commutativeN/A

                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                    2. lower-*.f64N/A

                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                    3. lower-sqrt.f64N/A

                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                    4. lower-/.f64N/A

                                                                                      \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                    5. *-commutativeN/A

                                                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                    6. lower-*.f6467.8

                                                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                  5. Applied rewrites67.8%

                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                  6. Step-by-step derivation
                                                                                    1. Applied rewrites67.9%

                                                                                      \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                    2. Step-by-step derivation
                                                                                      1. Applied rewrites84.2%

                                                                                        \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                                                                    3. Recombined 3 regimes into one program.
                                                                                    4. Final simplification60.4%

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.1 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{4 \cdot d}\right)}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+64}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                                                    5. Add Preprocessing

                                                                                    Alternative 18: 65.4% accurate, 3.0× speedup?

                                                                                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M\_m}{d} \cdot D\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                                                                                    D_m = (fabs.f64 D)
                                                                                    M_m = (fabs.f64 M)
                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                    (FPCore (d h l M_m D_m)
                                                                                     :precision binary64
                                                                                     (if (<= d 6.4e+94)
                                                                                       (*
                                                                                        (fma
                                                                                         (* -0.5 (/ (* (* (/ M_m d) D_m) (* D_m M_m)) (* 2.0 (* d 2.0))))
                                                                                         (/ h l)
                                                                                         1.0)
                                                                                        (* (sqrt (/ d l)) (sqrt (/ d h))))
                                                                                       (* (pow (* (sqrt l) (sqrt h)) -1.0) d)))
                                                                                    D_m = fabs(D);
                                                                                    M_m = fabs(M);
                                                                                    assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                    double code(double d, double h, double l, double M_m, double D_m) {
                                                                                    	double tmp;
                                                                                    	if (d <= 6.4e+94) {
                                                                                    		tmp = fma((-0.5 * ((((M_m / d) * D_m) * (D_m * M_m)) / (2.0 * (d * 2.0)))), (h / l), 1.0) * (sqrt((d / l)) * sqrt((d / h)));
                                                                                    	} else {
                                                                                    		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    D_m = abs(D)
                                                                                    M_m = abs(M)
                                                                                    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                    function code(d, h, l, M_m, D_m)
                                                                                    	tmp = 0.0
                                                                                    	if (d <= 6.4e+94)
                                                                                    		tmp = Float64(fma(Float64(-0.5 * Float64(Float64(Float64(Float64(M_m / d) * D_m) * Float64(D_m * M_m)) / Float64(2.0 * Float64(d * 2.0)))), Float64(h / l), 1.0) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))));
                                                                                    	else
                                                                                    		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    D_m = N[Abs[D], $MachinePrecision]
                                                                                    M_m = N[Abs[M], $MachinePrecision]
                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                    code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, 6.4e+94], N[(N[(N[(-0.5 * N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    D_m = \left|D\right|
                                                                                    \\
                                                                                    M_m = \left|M\right|
                                                                                    \\
                                                                                    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\
                                                                                    \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M\_m}{d} \cdot D\_m\right) \cdot \left(D\_m \cdot M\_m\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if d < 6.40000000000000028e94

                                                                                      1. Initial program 66.1%

                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                      2. Add Preprocessing
                                                                                      3. 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. *-commutativeN/A

                                                                                          \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                        3. lower-*.f6466.1

                                                                                          \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                      4. Applied rewrites52.7%

                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                                      5. Step-by-step derivation
                                                                                        1. lift-pow.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        2. unpow2N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        3. lift-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        4. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        5. associate-*l/N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{D \cdot \frac{M}{d}}{2}} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        6. lift-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        7. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        8. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        9. frac-timesN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        10. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        11. lift-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        12. frac-timesN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        13. lower-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        14. lower-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        15. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        16. lower-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        17. lift-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        18. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        19. lower-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        20. lower-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        21. *-commutativeN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                        22. lift-*.f6452.2

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                      6. Applied rewrites52.2%

                                                                                        \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. lift-sqrt.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                                        2. pow1/2N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{\frac{1}{2}}} \]
                                                                                        3. lift-*.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot {\color{blue}{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}}^{\frac{1}{2}} \]
                                                                                        4. unpow-prod-downN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\frac{1}{2}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right)} \]
                                                                                        5. lift-pow.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \]
                                                                                        6. metadata-evalN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \]
                                                                                        7. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{h}\right)}^{\frac{1}{2}}\right) \]
                                                                                        8. lift-pow.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}}\right) \]
                                                                                        9. metadata-evalN/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \]
                                                                                        10. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \]
                                                                                        11. lower-*.f6465.6

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                        12. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \]
                                                                                        13. metadata-eval65.6

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \]
                                                                                        14. lift-pow.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \]
                                                                                        15. unpow1/2N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \]
                                                                                        16. lower-sqrt.f6465.6

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \]
                                                                                        17. lift-/.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \]
                                                                                        18. metadata-eval65.6

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{0.5}}\right) \]
                                                                                        19. lift-pow.f64N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}}\right) \]
                                                                                        20. unpow1/2N/A

                                                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \]
                                                                                        21. lower-sqrt.f6465.6

                                                                                          \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \]
                                                                                      8. Applied rewrites65.6%

                                                                                        \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \]

                                                                                      if 6.40000000000000028e94 < d

                                                                                      1. Initial program 66.4%

                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in d around inf

                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. *-commutativeN/A

                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                        2. lower-*.f64N/A

                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                        3. lower-sqrt.f64N/A

                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                        4. lower-/.f64N/A

                                                                                          \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                        5. *-commutativeN/A

                                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                        6. lower-*.f6469.0

                                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                      5. Applied rewrites69.0%

                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                      6. Step-by-step derivation
                                                                                        1. Applied rewrites69.0%

                                                                                          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                        2. Step-by-step derivation
                                                                                          1. Applied rewrites84.8%

                                                                                            \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                                                                        3. Recombined 2 regimes into one program.
                                                                                        4. Final simplification69.6%

                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                                                        5. Add Preprocessing

                                                                                        Alternative 19: 55.4% accurate, 3.0× speedup?

                                                                                        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(D\_m \cdot \left(\frac{M\_m}{d} \cdot \left(M\_m \cdot \frac{D\_m}{4 \cdot d}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                                                                                        D_m = (fabs.f64 D)
                                                                                        M_m = (fabs.f64 M)
                                                                                        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                        (FPCore (d h l M_m D_m)
                                                                                         :precision binary64
                                                                                         (if (<= d 6.4e+94)
                                                                                           (*
                                                                                            (fma (* -0.5 (* D_m (* (/ M_m d) (* M_m (/ D_m (* 4.0 d)))))) (/ h l) 1.0)
                                                                                            (sqrt (* (/ d l) (/ d h))))
                                                                                           (* (pow (* (sqrt l) (sqrt h)) -1.0) d)))
                                                                                        D_m = fabs(D);
                                                                                        M_m = fabs(M);
                                                                                        assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                        double code(double d, double h, double l, double M_m, double D_m) {
                                                                                        	double tmp;
                                                                                        	if (d <= 6.4e+94) {
                                                                                        		tmp = fma((-0.5 * (D_m * ((M_m / d) * (M_m * (D_m / (4.0 * d)))))), (h / l), 1.0) * sqrt(((d / l) * (d / h)));
                                                                                        	} else {
                                                                                        		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        D_m = abs(D)
                                                                                        M_m = abs(M)
                                                                                        d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                        function code(d, h, l, M_m, D_m)
                                                                                        	tmp = 0.0
                                                                                        	if (d <= 6.4e+94)
                                                                                        		tmp = Float64(fma(Float64(-0.5 * Float64(D_m * Float64(Float64(M_m / d) * Float64(M_m * Float64(D_m / Float64(4.0 * d)))))), Float64(h / l), 1.0) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
                                                                                        	else
                                                                                        		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                                                                                        	end
                                                                                        	return tmp
                                                                                        end
                                                                                        
                                                                                        D_m = N[Abs[D], $MachinePrecision]
                                                                                        M_m = N[Abs[M], $MachinePrecision]
                                                                                        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                        code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, 6.4e+94], N[(N[(N[(-0.5 * N[(D$95$m * N[(N[(M$95$m / d), $MachinePrecision] * N[(M$95$m * N[(D$95$m / N[(4.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        D_m = \left|D\right|
                                                                                        \\
                                                                                        M_m = \left|M\right|
                                                                                        \\
                                                                                        [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\
                                                                                        \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(D\_m \cdot \left(\frac{M\_m}{d} \cdot \left(M\_m \cdot \frac{D\_m}{4 \cdot d}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                                                                                        
                                                                                        
                                                                                        \end{array}
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Split input into 2 regimes
                                                                                        2. if d < 6.40000000000000028e94

                                                                                          1. Initial program 66.1%

                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                          2. Add Preprocessing
                                                                                          3. 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. *-commutativeN/A

                                                                                              \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                            3. lower-*.f6466.1

                                                                                              \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                          4. Applied rewrites52.7%

                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                                          5. Step-by-step derivation
                                                                                            1. lift-pow.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            2. unpow2N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            3. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            4. lift-/.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            5. associate-*l/N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{D \cdot \frac{M}{d}}{2}} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            6. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            7. lift-/.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            8. lift-/.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            9. frac-timesN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            10. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            11. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            12. frac-timesN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            13. lower-/.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            14. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            15. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            16. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            17. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            18. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            19. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            20. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            21. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            22. lift-*.f6452.2

                                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                          6. Applied rewrites52.2%

                                                                                            \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                          7. Step-by-step derivation
                                                                                            1. lift-/.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            2. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}}{2 \cdot \left(d \cdot 2\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            3. associate-/l*N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{M}{d} \cdot D\right) \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            4. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            5. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(D \cdot \frac{M}{d}\right)} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            6. associate-*l*N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            7. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            8. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{D \cdot M}{2 \cdot \left(d \cdot 2\right)}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            9. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{\color{blue}{D \cdot M}}{2 \cdot \left(d \cdot 2\right)}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            10. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot \left(d \cdot 2\right)}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            11. associate-/l*N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \color{blue}{\left(M \cdot \frac{D}{2 \cdot \left(d \cdot 2\right)}\right)}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            12. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \color{blue}{\left(M \cdot \frac{D}{2 \cdot \left(d \cdot 2\right)}\right)}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            13. lower-/.f6450.7

                                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \color{blue}{\frac{D}{2 \cdot \left(d \cdot 2\right)}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            14. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{\color{blue}{2 \cdot \left(d \cdot 2\right)}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            15. lift-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            16. *-commutativeN/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{2 \cdot \color{blue}{\left(2 \cdot d\right)}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            17. associate-*r*N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{\color{blue}{\left(2 \cdot 2\right) \cdot d}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            18. lower-*.f64N/A

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{\color{blue}{\left(2 \cdot 2\right) \cdot d}}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                            19. metadata-eval50.7

                                                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{\color{blue}{4} \cdot d}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                          8. Applied rewrites50.7%

                                                                                            \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{4 \cdot d}\right)\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                                                                          if 6.40000000000000028e94 < d

                                                                                          1. Initial program 66.4%

                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in d around inf

                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. *-commutativeN/A

                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                            2. lower-*.f64N/A

                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                            3. lower-sqrt.f64N/A

                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                            4. lower-/.f64N/A

                                                                                              \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                            5. *-commutativeN/A

                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                            6. lower-*.f6469.0

                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                          5. Applied rewrites69.0%

                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                          6. Step-by-step derivation
                                                                                            1. Applied rewrites69.0%

                                                                                              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                            2. Step-by-step derivation
                                                                                              1. Applied rewrites84.8%

                                                                                                \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
                                                                                            3. Recombined 2 regimes into one program.
                                                                                            4. Final simplification57.9%

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 6.4 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(D \cdot \left(\frac{M}{d} \cdot \left(M \cdot \frac{D}{4 \cdot d}\right)\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                                                            5. Add Preprocessing

                                                                                            Alternative 20: 46.0% accurate, 3.0× speedup?

                                                                                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -1.45 \cdot 10^{+49}:\\ \;\;\;\;1 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;h \leq 2.4 \cdot 10^{-296}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                            D_m = (fabs.f64 D)
                                                                                            M_m = (fabs.f64 M)
                                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                            (FPCore (d h l M_m D_m)
                                                                                             :precision binary64
                                                                                             (if (<= h -1.45e+49)
                                                                                               (* 1.0 (sqrt (* (/ d l) (/ d h))))
                                                                                               (if (<= h 2.4e-296)
                                                                                                 (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                                                 (/ d (* (sqrt l) (sqrt h))))))
                                                                                            D_m = fabs(D);
                                                                                            M_m = fabs(M);
                                                                                            assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                            double code(double d, double h, double l, double M_m, double D_m) {
                                                                                            	double tmp;
                                                                                            	if (h <= -1.45e+49) {
                                                                                            		tmp = 1.0 * sqrt(((d / l) * (d / h)));
                                                                                            	} else if (h <= 2.4e-296) {
                                                                                            		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                                            	} else {
                                                                                            		tmp = d / (sqrt(l) * sqrt(h));
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            D_m =     private
                                                                                            M_m =     private
                                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                            module fmin_fmax_functions
                                                                                                implicit none
                                                                                                private
                                                                                                public fmax
                                                                                                public fmin
                                                                                            
                                                                                                interface fmax
                                                                                                    module procedure fmax88
                                                                                                    module procedure fmax44
                                                                                                    module procedure fmax84
                                                                                                    module procedure fmax48
                                                                                                end interface
                                                                                                interface fmin
                                                                                                    module procedure fmin88
                                                                                                    module procedure fmin44
                                                                                                    module procedure fmin84
                                                                                                    module procedure fmin48
                                                                                                end interface
                                                                                            contains
                                                                                                real(8) function fmax88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmax44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmax48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin88(x, y) result (res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(4) function fmin44(x, y) result (res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin84(x, y) result(res)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(4), intent (in) :: y
                                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                end function
                                                                                                real(8) function fmin48(x, y) result(res)
                                                                                                    real(4), intent (in) :: x
                                                                                                    real(8), intent (in) :: y
                                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                end function
                                                                                            end module
                                                                                            
                                                                                            real(8) function code(d, h, l, m_m, d_m)
                                                                                            use fmin_fmax_functions
                                                                                                real(8), intent (in) :: d
                                                                                                real(8), intent (in) :: h
                                                                                                real(8), intent (in) :: l
                                                                                                real(8), intent (in) :: m_m
                                                                                                real(8), intent (in) :: d_m
                                                                                                real(8) :: tmp
                                                                                                if (h <= (-1.45d+49)) then
                                                                                                    tmp = 1.0d0 * sqrt(((d / l) * (d / h)))
                                                                                                else if (h <= 2.4d-296) then
                                                                                                    tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                                                else
                                                                                                    tmp = d / (sqrt(l) * sqrt(h))
                                                                                                end if
                                                                                                code = tmp
                                                                                            end function
                                                                                            
                                                                                            D_m = Math.abs(D);
                                                                                            M_m = Math.abs(M);
                                                                                            assert d < h && h < l && l < M_m && M_m < D_m;
                                                                                            public static double code(double d, double h, double l, double M_m, double D_m) {
                                                                                            	double tmp;
                                                                                            	if (h <= -1.45e+49) {
                                                                                            		tmp = 1.0 * Math.sqrt(((d / l) * (d / h)));
                                                                                            	} else if (h <= 2.4e-296) {
                                                                                            		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                                            	} else {
                                                                                            		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            D_m = math.fabs(D)
                                                                                            M_m = math.fabs(M)
                                                                                            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                                                                            def code(d, h, l, M_m, D_m):
                                                                                            	tmp = 0
                                                                                            	if h <= -1.45e+49:
                                                                                            		tmp = 1.0 * math.sqrt(((d / l) * (d / h)))
                                                                                            	elif h <= 2.4e-296:
                                                                                            		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                                            	else:
                                                                                            		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                                            	return tmp
                                                                                            
                                                                                            D_m = abs(D)
                                                                                            M_m = abs(M)
                                                                                            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                            function code(d, h, l, M_m, D_m)
                                                                                            	tmp = 0.0
                                                                                            	if (h <= -1.45e+49)
                                                                                            		tmp = Float64(1.0 * sqrt(Float64(Float64(d / l) * Float64(d / h))));
                                                                                            	elseif (h <= 2.4e-296)
                                                                                            		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                                            	else
                                                                                            		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                            	end
                                                                                            	return tmp
                                                                                            end
                                                                                            
                                                                                            D_m = abs(D);
                                                                                            M_m = abs(M);
                                                                                            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                                                                            function tmp_2 = code(d, h, l, M_m, D_m)
                                                                                            	tmp = 0.0;
                                                                                            	if (h <= -1.45e+49)
                                                                                            		tmp = 1.0 * sqrt(((d / l) * (d / h)));
                                                                                            	elseif (h <= 2.4e-296)
                                                                                            		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                                            	else
                                                                                            		tmp = d / (sqrt(l) * sqrt(h));
                                                                                            	end
                                                                                            	tmp_2 = tmp;
                                                                                            end
                                                                                            
                                                                                            D_m = N[Abs[D], $MachinePrecision]
                                                                                            M_m = N[Abs[M], $MachinePrecision]
                                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                            code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -1.45e+49], N[(1.0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.4e-296], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            D_m = \left|D\right|
                                                                                            \\
                                                                                            M_m = \left|M\right|
                                                                                            \\
                                                                                            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;h \leq -1.45 \cdot 10^{+49}:\\
                                                                                            \;\;\;\;1 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
                                                                                            
                                                                                            \mathbf{elif}\;h \leq 2.4 \cdot 10^{-296}:\\
                                                                                            \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 3 regimes
                                                                                            2. if h < -1.45e49

                                                                                              1. Initial program 64.5%

                                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                              2. Add Preprocessing
                                                                                              3. Step-by-step derivation
                                                                                                1. 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. *-commutativeN/A

                                                                                                  \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                3. lower-*.f6464.5

                                                                                                  \[\leadsto \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                              4. Applied rewrites56.3%

                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
                                                                                              5. Step-by-step derivation
                                                                                                1. lift-pow.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                2. unpow2N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                3. lift-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                4. lift-/.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                5. associate-*l/N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{D \cdot \frac{M}{d}}{2}} \cdot \left(\frac{D}{2} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                6. lift-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\left(\frac{D}{2} \cdot \frac{M}{d}\right)}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                7. lift-/.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\color{blue}{\frac{D}{2}} \cdot \frac{M}{d}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                8. lift-/.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \left(\frac{D}{2} \cdot \color{blue}{\frac{M}{d}}\right)\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                9. frac-timesN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                10. *-commutativeN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                11. lift-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\frac{D \cdot \frac{M}{d}}{2} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right), \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                12. frac-timesN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                13. lower-/.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\frac{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                14. lower-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(D \cdot \frac{M}{d}\right) \cdot \left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                15. *-commutativeN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                16. lower-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \left(M \cdot D\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                17. lift-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(M \cdot D\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                18. *-commutativeN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                19. lower-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(D \cdot M\right)}}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                20. lower-*.f64N/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{\color{blue}{2 \cdot \left(2 \cdot d\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                21. *-commutativeN/A

                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                                22. lift-*.f6454.3

                                                                                                  \[\leadsto \mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \color{blue}{\left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                              6. Applied rewrites54.3%

                                                                                                \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(d \cdot 2\right)}}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                              7. Taylor expanded in d around inf

                                                                                                \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]
                                                                                              8. Step-by-step derivation
                                                                                                1. Applied rewrites29.2%

                                                                                                  \[\leadsto \color{blue}{1} \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \]

                                                                                                if -1.45e49 < h < 2.39999999999999996e-296

                                                                                                1. Initial program 79.9%

                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in l around -inf

                                                                                                  \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. *-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                                                                                                  2. unpow2N/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \]
                                                                                                  3. rem-square-sqrtN/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{-1}\right) \]
                                                                                                  4. *-commutativeN/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-1 \cdot d\right)} \]
                                                                                                  5. mul-1-negN/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                  6. *-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                  7. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                  8. lower-neg.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                  9. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                  10. lower-/.f64N/A

                                                                                                    \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                  11. *-commutativeN/A

                                                                                                    \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                  12. lower-*.f6458.4

                                                                                                    \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                5. Applied rewrites58.4%

                                                                                                  \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                                                                if 2.39999999999999996e-296 < h

                                                                                                1. Initial program 60.9%

                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in d around inf

                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. *-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                  2. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                  3. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                  4. lower-/.f64N/A

                                                                                                    \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                  5. *-commutativeN/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                  6. lower-*.f6441.1

                                                                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                5. Applied rewrites41.1%

                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                6. Step-by-step derivation
                                                                                                  1. Applied rewrites41.1%

                                                                                                    \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                                  2. Step-by-step derivation
                                                                                                    1. Applied rewrites41.1%

                                                                                                      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                                                    2. Step-by-step derivation
                                                                                                      1. Applied rewrites51.4%

                                                                                                        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                    3. Recombined 3 regimes into one program.
                                                                                                    4. Final simplification49.0%

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.45 \cdot 10^{+49}:\\ \;\;\;\;1 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;h \leq 2.4 \cdot 10^{-296}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                                    5. Add Preprocessing

                                                                                                    Alternative 21: 46.5% accurate, 3.2× speedup?

                                                                                                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq 2.4 \cdot 10^{-296}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                    D_m = (fabs.f64 D)
                                                                                                    M_m = (fabs.f64 M)
                                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                    (FPCore (d h l M_m D_m)
                                                                                                     :precision binary64
                                                                                                     (if (<= h 2.4e-296)
                                                                                                       (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                                                       (/ d (* (sqrt l) (sqrt h)))))
                                                                                                    D_m = fabs(D);
                                                                                                    M_m = fabs(M);
                                                                                                    assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                    double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                    	double tmp;
                                                                                                    	if (h <= 2.4e-296) {
                                                                                                    		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                                                    	} else {
                                                                                                    		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    D_m =     private
                                                                                                    M_m =     private
                                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                    module fmin_fmax_functions
                                                                                                        implicit none
                                                                                                        private
                                                                                                        public fmax
                                                                                                        public fmin
                                                                                                    
                                                                                                        interface fmax
                                                                                                            module procedure fmax88
                                                                                                            module procedure fmax44
                                                                                                            module procedure fmax84
                                                                                                            module procedure fmax48
                                                                                                        end interface
                                                                                                        interface fmin
                                                                                                            module procedure fmin88
                                                                                                            module procedure fmin44
                                                                                                            module procedure fmin84
                                                                                                            module procedure fmin48
                                                                                                        end interface
                                                                                                    contains
                                                                                                        real(8) function fmax88(x, y) result (res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(4) function fmax44(x, y) result (res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmax84(x, y) result(res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmax48(x, y) result(res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin88(x, y) result (res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(4) function fmin44(x, y) result (res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin84(x, y) result(res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin48(x, y) result(res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                        end function
                                                                                                    end module
                                                                                                    
                                                                                                    real(8) function code(d, h, l, m_m, d_m)
                                                                                                    use fmin_fmax_functions
                                                                                                        real(8), intent (in) :: d
                                                                                                        real(8), intent (in) :: h
                                                                                                        real(8), intent (in) :: l
                                                                                                        real(8), intent (in) :: m_m
                                                                                                        real(8), intent (in) :: d_m
                                                                                                        real(8) :: tmp
                                                                                                        if (h <= 2.4d-296) then
                                                                                                            tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                                                        else
                                                                                                            tmp = d / (sqrt(l) * sqrt(h))
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    D_m = Math.abs(D);
                                                                                                    M_m = Math.abs(M);
                                                                                                    assert d < h && h < l && l < M_m && M_m < D_m;
                                                                                                    public static double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                    	double tmp;
                                                                                                    	if (h <= 2.4e-296) {
                                                                                                    		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                                                    	} else {
                                                                                                    		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    D_m = math.fabs(D)
                                                                                                    M_m = math.fabs(M)
                                                                                                    [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                                                                                    def code(d, h, l, M_m, D_m):
                                                                                                    	tmp = 0
                                                                                                    	if h <= 2.4e-296:
                                                                                                    		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                                                    	else:
                                                                                                    		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                                                    	return tmp
                                                                                                    
                                                                                                    D_m = abs(D)
                                                                                                    M_m = abs(M)
                                                                                                    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                    function code(d, h, l, M_m, D_m)
                                                                                                    	tmp = 0.0
                                                                                                    	if (h <= 2.4e-296)
                                                                                                    		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                                                    	else
                                                                                                    		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    D_m = abs(D);
                                                                                                    M_m = abs(M);
                                                                                                    d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                                                                                    function tmp_2 = code(d, h, l, M_m, D_m)
                                                                                                    	tmp = 0.0;
                                                                                                    	if (h <= 2.4e-296)
                                                                                                    		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                                                    	else
                                                                                                    		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    D_m = N[Abs[D], $MachinePrecision]
                                                                                                    M_m = N[Abs[M], $MachinePrecision]
                                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                    code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, 2.4e-296], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    D_m = \left|D\right|
                                                                                                    \\
                                                                                                    M_m = \left|M\right|
                                                                                                    \\
                                                                                                    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;h \leq 2.4 \cdot 10^{-296}:\\
                                                                                                    \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 2 regimes
                                                                                                    2. if h < 2.39999999999999996e-296

                                                                                                      1. Initial program 73.3%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in l around -inf

                                                                                                        \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. *-commutativeN/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                                                                                                        2. unpow2N/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \]
                                                                                                        3. rem-square-sqrtN/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{-1}\right) \]
                                                                                                        4. *-commutativeN/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-1 \cdot d\right)} \]
                                                                                                        5. mul-1-negN/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                        6. *-commutativeN/A

                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                        7. lower-*.f64N/A

                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                        8. lower-neg.f64N/A

                                                                                                          \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                        9. lower-sqrt.f64N/A

                                                                                                          \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                        10. lower-/.f64N/A

                                                                                                          \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                        11. *-commutativeN/A

                                                                                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                        12. lower-*.f6441.4

                                                                                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                      5. Applied rewrites41.4%

                                                                                                        \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                                                                      if 2.39999999999999996e-296 < h

                                                                                                      1. Initial program 60.9%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in d around inf

                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. *-commutativeN/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                        2. lower-*.f64N/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                        3. lower-sqrt.f64N/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                        4. lower-/.f64N/A

                                                                                                          \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                        5. *-commutativeN/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                        6. lower-*.f6441.1

                                                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                      5. Applied rewrites41.1%

                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                      6. Step-by-step derivation
                                                                                                        1. Applied rewrites41.1%

                                                                                                          \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                                        2. Step-by-step derivation
                                                                                                          1. Applied rewrites41.1%

                                                                                                            \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                                                          2. Step-by-step derivation
                                                                                                            1. Applied rewrites51.4%

                                                                                                              \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                          3. Recombined 2 regimes into one program.
                                                                                                          4. Final simplification47.1%

                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq 2.4 \cdot 10^{-296}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                                          5. Add Preprocessing

                                                                                                          Alternative 22: 42.7% accurate, 3.2× speedup?

                                                                                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{if}\;d \leq -5.8 \cdot 10^{-179}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot d\\ \end{array} \end{array} \]
                                                                                                          D_m = (fabs.f64 D)
                                                                                                          M_m = (fabs.f64 M)
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          (FPCore (d h l M_m D_m)
                                                                                                           :precision binary64
                                                                                                           (let* ((t_0 (sqrt (pow (* l h) -1.0))))
                                                                                                             (if (<= d -5.8e-179) (* (- d) t_0) (* t_0 d))))
                                                                                                          D_m = fabs(D);
                                                                                                          M_m = fabs(M);
                                                                                                          assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                          double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	double t_0 = sqrt(pow((l * h), -1.0));
                                                                                                          	double tmp;
                                                                                                          	if (d <= -5.8e-179) {
                                                                                                          		tmp = -d * t_0;
                                                                                                          	} else {
                                                                                                          		tmp = t_0 * d;
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          D_m =     private
                                                                                                          M_m =     private
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          module fmin_fmax_functions
                                                                                                              implicit none
                                                                                                              private
                                                                                                              public fmax
                                                                                                              public fmin
                                                                                                          
                                                                                                              interface fmax
                                                                                                                  module procedure fmax88
                                                                                                                  module procedure fmax44
                                                                                                                  module procedure fmax84
                                                                                                                  module procedure fmax48
                                                                                                              end interface
                                                                                                              interface fmin
                                                                                                                  module procedure fmin88
                                                                                                                  module procedure fmin44
                                                                                                                  module procedure fmin84
                                                                                                                  module procedure fmin48
                                                                                                              end interface
                                                                                                          contains
                                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                          end module
                                                                                                          
                                                                                                          real(8) function code(d, h, l, m_m, d_m)
                                                                                                          use fmin_fmax_functions
                                                                                                              real(8), intent (in) :: d
                                                                                                              real(8), intent (in) :: h
                                                                                                              real(8), intent (in) :: l
                                                                                                              real(8), intent (in) :: m_m
                                                                                                              real(8), intent (in) :: d_m
                                                                                                              real(8) :: t_0
                                                                                                              real(8) :: tmp
                                                                                                              t_0 = sqrt(((l * h) ** (-1.0d0)))
                                                                                                              if (d <= (-5.8d-179)) then
                                                                                                                  tmp = -d * t_0
                                                                                                              else
                                                                                                                  tmp = t_0 * d
                                                                                                              end if
                                                                                                              code = tmp
                                                                                                          end function
                                                                                                          
                                                                                                          D_m = Math.abs(D);
                                                                                                          M_m = Math.abs(M);
                                                                                                          assert d < h && h < l && l < M_m && M_m < D_m;
                                                                                                          public static double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	double t_0 = Math.sqrt(Math.pow((l * h), -1.0));
                                                                                                          	double tmp;
                                                                                                          	if (d <= -5.8e-179) {
                                                                                                          		tmp = -d * t_0;
                                                                                                          	} else {
                                                                                                          		tmp = t_0 * d;
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          D_m = math.fabs(D)
                                                                                                          M_m = math.fabs(M)
                                                                                                          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                                                                                          def code(d, h, l, M_m, D_m):
                                                                                                          	t_0 = math.sqrt(math.pow((l * h), -1.0))
                                                                                                          	tmp = 0
                                                                                                          	if d <= -5.8e-179:
                                                                                                          		tmp = -d * t_0
                                                                                                          	else:
                                                                                                          		tmp = t_0 * d
                                                                                                          	return tmp
                                                                                                          
                                                                                                          D_m = abs(D)
                                                                                                          M_m = abs(M)
                                                                                                          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                          function code(d, h, l, M_m, D_m)
                                                                                                          	t_0 = sqrt((Float64(l * h) ^ -1.0))
                                                                                                          	tmp = 0.0
                                                                                                          	if (d <= -5.8e-179)
                                                                                                          		tmp = Float64(Float64(-d) * t_0);
                                                                                                          	else
                                                                                                          		tmp = Float64(t_0 * d);
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          D_m = abs(D);
                                                                                                          M_m = abs(M);
                                                                                                          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                                                                                          function tmp_2 = code(d, h, l, M_m, D_m)
                                                                                                          	t_0 = sqrt(((l * h) ^ -1.0));
                                                                                                          	tmp = 0.0;
                                                                                                          	if (d <= -5.8e-179)
                                                                                                          		tmp = -d * t_0;
                                                                                                          	else
                                                                                                          		tmp = t_0 * d;
                                                                                                          	end
                                                                                                          	tmp_2 = tmp;
                                                                                                          end
                                                                                                          
                                                                                                          D_m = N[Abs[D], $MachinePrecision]
                                                                                                          M_m = N[Abs[M], $MachinePrecision]
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5.8e-179], N[((-d) * t$95$0), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          D_m = \left|D\right|
                                                                                                          \\
                                                                                                          M_m = \left|M\right|
                                                                                                          \\
                                                                                                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                                          \mathbf{if}\;d \leq -5.8 \cdot 10^{-179}:\\
                                                                                                          \;\;\;\;\left(-d\right) \cdot t\_0\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;t\_0 \cdot d\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if d < -5.7999999999999998e-179

                                                                                                            1. Initial program 76.6%

                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                            2. Add Preprocessing
                                                                                                            3. Taylor expanded in l around -inf

                                                                                                              \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                            4. Step-by-step derivation
                                                                                                              1. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                                                                                                              2. unpow2N/A

                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \]
                                                                                                              3. rem-square-sqrtN/A

                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot \color{blue}{-1}\right) \]
                                                                                                              4. *-commutativeN/A

                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-1 \cdot d\right)} \]
                                                                                                              5. mul-1-negN/A

                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                              6. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              7. lower-*.f64N/A

                                                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              8. lower-neg.f64N/A

                                                                                                                \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                              9. lower-sqrt.f64N/A

                                                                                                                \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              10. lower-/.f64N/A

                                                                                                                \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                              11. *-commutativeN/A

                                                                                                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                              12. lower-*.f6449.0

                                                                                                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                            5. Applied rewrites49.0%

                                                                                                              \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                                                                            if -5.7999999999999998e-179 < d

                                                                                                            1. Initial program 61.1%

                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                            2. Add Preprocessing
                                                                                                            3. Taylor expanded in d around inf

                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                            4. Step-by-step derivation
                                                                                                              1. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                              2. lower-*.f64N/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                              3. lower-sqrt.f64N/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                              4. lower-/.f64N/A

                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                              5. *-commutativeN/A

                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                              6. lower-*.f6437.6

                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                            5. Applied rewrites37.6%

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                          3. Recombined 2 regimes into one program.
                                                                                                          4. Final simplification41.3%

                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.8 \cdot 10^{-179}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d\\ \end{array} \]
                                                                                                          5. Add Preprocessing

                                                                                                          Alternative 23: 26.6% accurate, 3.4× speedup?

                                                                                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \end{array} \]
                                                                                                          D_m = (fabs.f64 D)
                                                                                                          M_m = (fabs.f64 M)
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          (FPCore (d h l M_m D_m) :precision binary64 (* (sqrt (pow (* l h) -1.0)) d))
                                                                                                          D_m = fabs(D);
                                                                                                          M_m = fabs(M);
                                                                                                          assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                          double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	return sqrt(pow((l * h), -1.0)) * d;
                                                                                                          }
                                                                                                          
                                                                                                          D_m =     private
                                                                                                          M_m =     private
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          module fmin_fmax_functions
                                                                                                              implicit none
                                                                                                              private
                                                                                                              public fmax
                                                                                                              public fmin
                                                                                                          
                                                                                                              interface fmax
                                                                                                                  module procedure fmax88
                                                                                                                  module procedure fmax44
                                                                                                                  module procedure fmax84
                                                                                                                  module procedure fmax48
                                                                                                              end interface
                                                                                                              interface fmin
                                                                                                                  module procedure fmin88
                                                                                                                  module procedure fmin44
                                                                                                                  module procedure fmin84
                                                                                                                  module procedure fmin48
                                                                                                              end interface
                                                                                                          contains
                                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                          end module
                                                                                                          
                                                                                                          real(8) function code(d, h, l, m_m, d_m)
                                                                                                          use fmin_fmax_functions
                                                                                                              real(8), intent (in) :: d
                                                                                                              real(8), intent (in) :: h
                                                                                                              real(8), intent (in) :: l
                                                                                                              real(8), intent (in) :: m_m
                                                                                                              real(8), intent (in) :: d_m
                                                                                                              code = sqrt(((l * h) ** (-1.0d0))) * d
                                                                                                          end function
                                                                                                          
                                                                                                          D_m = Math.abs(D);
                                                                                                          M_m = Math.abs(M);
                                                                                                          assert d < h && h < l && l < M_m && M_m < D_m;
                                                                                                          public static double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	return Math.sqrt(Math.pow((l * h), -1.0)) * d;
                                                                                                          }
                                                                                                          
                                                                                                          D_m = math.fabs(D)
                                                                                                          M_m = math.fabs(M)
                                                                                                          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                                                                                          def code(d, h, l, M_m, D_m):
                                                                                                          	return math.sqrt(math.pow((l * h), -1.0)) * d
                                                                                                          
                                                                                                          D_m = abs(D)
                                                                                                          M_m = abs(M)
                                                                                                          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                          function code(d, h, l, M_m, D_m)
                                                                                                          	return Float64(sqrt((Float64(l * h) ^ -1.0)) * d)
                                                                                                          end
                                                                                                          
                                                                                                          D_m = abs(D);
                                                                                                          M_m = abs(M);
                                                                                                          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                                                                                          function tmp = code(d, h, l, M_m, D_m)
                                                                                                          	tmp = sqrt(((l * h) ^ -1.0)) * d;
                                                                                                          end
                                                                                                          
                                                                                                          D_m = N[Abs[D], $MachinePrecision]
                                                                                                          M_m = N[Abs[M], $MachinePrecision]
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          code[d_, h_, l_, M$95$m_, D$95$m_] := N[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          D_m = \left|D\right|
                                                                                                          \\
                                                                                                          M_m = \left|M\right|
                                                                                                          \\
                                                                                                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                                          \\
                                                                                                          \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Initial program 66.2%

                                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                          2. Add Preprocessing
                                                                                                          3. Taylor expanded in d around inf

                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. *-commutativeN/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                            2. lower-*.f64N/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                            3. lower-sqrt.f64N/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                            4. lower-/.f64N/A

                                                                                                              \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                            5. *-commutativeN/A

                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                            6. lower-*.f6427.3

                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                          5. Applied rewrites27.3%

                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                          6. Final simplification27.3%

                                                                                                            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
                                                                                                          7. Add Preprocessing

                                                                                                          Alternative 24: 26.5% accurate, 15.3× speedup?

                                                                                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                                                                          D_m = (fabs.f64 D)
                                                                                                          M_m = (fabs.f64 M)
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          (FPCore (d h l M_m D_m) :precision binary64 (/ d (sqrt (* l h))))
                                                                                                          D_m = fabs(D);
                                                                                                          M_m = fabs(M);
                                                                                                          assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                          double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	return d / sqrt((l * h));
                                                                                                          }
                                                                                                          
                                                                                                          D_m =     private
                                                                                                          M_m =     private
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          module fmin_fmax_functions
                                                                                                              implicit none
                                                                                                              private
                                                                                                              public fmax
                                                                                                              public fmin
                                                                                                          
                                                                                                              interface fmax
                                                                                                                  module procedure fmax88
                                                                                                                  module procedure fmax44
                                                                                                                  module procedure fmax84
                                                                                                                  module procedure fmax48
                                                                                                              end interface
                                                                                                              interface fmin
                                                                                                                  module procedure fmin88
                                                                                                                  module procedure fmin44
                                                                                                                  module procedure fmin84
                                                                                                                  module procedure fmin48
                                                                                                              end interface
                                                                                                          contains
                                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                          end module
                                                                                                          
                                                                                                          real(8) function code(d, h, l, m_m, d_m)
                                                                                                          use fmin_fmax_functions
                                                                                                              real(8), intent (in) :: d
                                                                                                              real(8), intent (in) :: h
                                                                                                              real(8), intent (in) :: l
                                                                                                              real(8), intent (in) :: m_m
                                                                                                              real(8), intent (in) :: d_m
                                                                                                              code = d / sqrt((l * h))
                                                                                                          end function
                                                                                                          
                                                                                                          D_m = Math.abs(D);
                                                                                                          M_m = Math.abs(M);
                                                                                                          assert d < h && h < l && l < M_m && M_m < D_m;
                                                                                                          public static double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                          	return d / Math.sqrt((l * h));
                                                                                                          }
                                                                                                          
                                                                                                          D_m = math.fabs(D)
                                                                                                          M_m = math.fabs(M)
                                                                                                          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                                                                                          def code(d, h, l, M_m, D_m):
                                                                                                          	return d / math.sqrt((l * h))
                                                                                                          
                                                                                                          D_m = abs(D)
                                                                                                          M_m = abs(M)
                                                                                                          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                          function code(d, h, l, M_m, D_m)
                                                                                                          	return Float64(d / sqrt(Float64(l * h)))
                                                                                                          end
                                                                                                          
                                                                                                          D_m = abs(D);
                                                                                                          M_m = abs(M);
                                                                                                          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                                                                                          function tmp = code(d, h, l, M_m, D_m)
                                                                                                          	tmp = d / sqrt((l * h));
                                                                                                          end
                                                                                                          
                                                                                                          D_m = N[Abs[D], $MachinePrecision]
                                                                                                          M_m = N[Abs[M], $MachinePrecision]
                                                                                                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                          code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          D_m = \left|D\right|
                                                                                                          \\
                                                                                                          M_m = \left|M\right|
                                                                                                          \\
                                                                                                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                                          \\
                                                                                                          \frac{d}{\sqrt{\ell \cdot h}}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Initial program 66.2%

                                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                          2. Add Preprocessing
                                                                                                          3. Taylor expanded in d around inf

                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. *-commutativeN/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                            2. lower-*.f64N/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                            3. lower-sqrt.f64N/A

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                            4. lower-/.f64N/A

                                                                                                              \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                            5. *-commutativeN/A

                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                            6. lower-*.f6427.3

                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                          5. Applied rewrites27.3%

                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                          6. Step-by-step derivation
                                                                                                            1. Applied rewrites27.3%

                                                                                                              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
                                                                                                            2. Step-by-step derivation
                                                                                                              1. Applied rewrites27.3%

                                                                                                                \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                                                              2. Add Preprocessing

                                                                                                              Reproduce

                                                                                                              ?
                                                                                                              herbie shell --seed 2024357 
                                                                                                              (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)))))