Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.8% → 80.8%
Time: 15.8s
Alternatives: 21
Speedup: 3.2×

Specification

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

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

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

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

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 21 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.8% 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: 80.8% 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 := \sqrt{-d}\\ \mathbf{if}\;d \leq -2.4 \cdot 10^{-201}:\\ \;\;\;\;\left(\frac{t\_0}{\sqrt{-h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\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{elif}\;d \leq 1.18 \cdot 10^{-200}:\\ \;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right), \frac{M\_m}{d} \cdot M\_m, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\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 (sqrt (- d))))
   (if (<= d -2.4e-201)
     (*
      (* (/ t_0 (sqrt (- h))) (/ t_0 (sqrt (- l))))
      (-
       1.0
       (* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
     (if (<= d 1.18e-200)
       (/
        (fma
         (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))
         (* (/ M_m d) M_m)
         (* (sqrt (/ h l)) d))
        h)
       (*
        (/ (/ d (sqrt l)) (sqrt h))
        (fma
         (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
         (* (/ D_m -2.0) (/ M_m d))
         1.0))))))
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);
	double tmp;
	if (d <= -2.4e-201) {
		tmp = ((t_0 / sqrt(-h)) * (t_0 / sqrt(-l))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
	} else if (d <= 1.18e-200) {
		tmp = fma((pow((h / l), 1.5) * ((D_m * D_m) * -0.125)), ((M_m / d) * M_m), (sqrt((h / l)) * d)) / h;
	} else {
		tmp = ((d / sqrt(l)) / sqrt(h)) * fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
	}
	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))
	tmp = 0.0
	if (d <= -2.4e-201)
		tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))));
	elseif (d <= 1.18e-200)
		tmp = Float64(fma(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125)), Float64(Float64(M_m / d) * M_m), Float64(sqrt(Float64(h / l)) * d)) / h);
	else
		tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0));
	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[(-d)], $MachinePrecision]}, If[LessEqual[d, -2.4e-201], N[(N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $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[d, 1.18e-200], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $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 := \sqrt{-d}\\
\mathbf{if}\;d \leq -2.4 \cdot 10^{-201}:\\
\;\;\;\;\left(\frac{t\_0}{\sqrt{-h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\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{elif}\;d \leq 1.18 \cdot 10^{-200}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right), \frac{M\_m}{d} \cdot M\_m, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\

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


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

    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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-neg.f6478.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000009e-201 < d < 1.17999999999999996e-200

    1. Initial program 37.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-*.f6417.3

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

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
      2. Taylor expanded in h around 0

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

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

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

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

        if 1.17999999999999996e-200 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 68.1% accurate, 0.1× 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{\ell \cdot h}\\ t_2 := \frac{d}{t\_1}\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_2\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-242}:\\ \;\;\;\;\frac{\mathsf{fma}\left(d \cdot \left(\frac{M\_m}{d} \cdot \left(D\_m \cdot 0.25\right)\right), \left(\frac{D\_m}{d} \cdot \frac{M\_m}{-2}\right) \cdot \frac{h}{\ell}, d\right)}{t\_1}\\ \mathbf{elif}\;t\_0 \leq 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_2\\ \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 (* l h)))
              (t_2 (/ d t_1)))
         (if (<= t_0 (- INFINITY))
           (*
            (fma (/ (* (* (* (* 0.25 D_m) D_m) M_m) M_m) d) (* -0.5 (/ h l)) 1.0)
            t_2)
           (if (<= t_0 2e-242)
             (/
              (fma
               (* d (* (/ M_m d) (* D_m 0.25)))
               (* (* (/ D_m d) (/ M_m -2.0)) (/ h l))
               d)
              t_1)
             (if (<= t_0 1e+161)
               (* (sqrt (/ d l)) (sqrt (/ d h)))
               (if (<= t_0 INFINITY)
                 (/ (* (sqrt (/ h l)) d) h)
                 (*
                  (fma
                   (* (/ (* (* M_m (* D_m 0.25)) h) (* d l)) (/ D_m d))
                   (/ M_m -2.0)
                   1.0)
                  t_2)))))))
      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((l * h));
      	double t_2 = d / t_1;
      	double tmp;
      	if (t_0 <= -((double) INFINITY)) {
      		tmp = fma((((((0.25 * D_m) * D_m) * M_m) * M_m) / d), (-0.5 * (h / l)), 1.0) * t_2;
      	} else if (t_0 <= 2e-242) {
      		tmp = fma((d * ((M_m / d) * (D_m * 0.25))), (((D_m / d) * (M_m / -2.0)) * (h / l)), d) / t_1;
      	} else if (t_0 <= 1e+161) {
      		tmp = sqrt((d / l)) * sqrt((d / h));
      	} else if (t_0 <= ((double) INFINITY)) {
      		tmp = (sqrt((h / l)) * d) / h;
      	} else {
      		tmp = fma(((((M_m * (D_m * 0.25)) * h) / (d * l)) * (D_m / d)), (M_m / -2.0), 1.0) * t_2;
      	}
      	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(l * h))
      	t_2 = Float64(d / t_1)
      	tmp = 0.0
      	if (t_0 <= Float64(-Inf))
      		tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(0.25 * D_m) * D_m) * M_m) * M_m) / d), Float64(-0.5 * Float64(h / l)), 1.0) * t_2);
      	elseif (t_0 <= 2e-242)
      		tmp = Float64(fma(Float64(d * Float64(Float64(M_m / d) * Float64(D_m * 0.25))), Float64(Float64(Float64(D_m / d) * Float64(M_m / -2.0)) * Float64(h / l)), d) / t_1);
      	elseif (t_0 <= 1e+161)
      		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
      	elseif (t_0 <= Inf)
      		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
      	else
      		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * Float64(D_m * 0.25)) * h) / Float64(d * l)) * Float64(D_m / d)), Float64(M_m / -2.0), 1.0) * t_2);
      	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[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(d / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(N[(N[(N[(0.25 * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 2e-242], N[(N[(N[(d * N[(N[(M$95$m / d), $MachinePrecision] * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D$95$m / d), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + d), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1e+161], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$2), $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{\ell \cdot h}\\
      t_2 := \frac{d}{t\_1}\\
      \mathbf{if}\;t\_0 \leq -\infty:\\
      \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_2\\
      
      \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-242}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(d \cdot \left(\frac{M\_m}{d} \cdot \left(D\_m \cdot 0.25\right)\right), \left(\frac{D\_m}{d} \cdot \frac{M\_m}{-2}\right) \cdot \frac{h}{\ell}, d\right)}{t\_1}\\
      
      \mathbf{elif}\;t\_0 \leq 10^{+161}:\\
      \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
      
      \mathbf{elif}\;t\_0 \leq \infty:\\
      \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 5 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)))) < -inf.0

        1. Initial program 83.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. Applied rewrites32.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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)))) < 2e-242

        1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2e-242 < (*.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)))) < 1e161

        1. Initial program 99.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. Applied rewrites92.4%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
          7. remove-double-negN/A

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

            \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
          9. lower-/.f6498.5

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

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

        if 1e161 < (*.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.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. 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.0

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

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

            \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
          2. Taylor expanded in h around 0

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

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

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

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

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

            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. Step-by-step derivation
              1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
          7. Recombined 5 regimes into one program.
          8. Final simplification69.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 -\infty:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\right) \cdot D\right) \cdot M\right) \cdot M}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \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 2 \cdot 10^{-242}:\\ \;\;\;\;\frac{\mathsf{fma}\left(d \cdot \left(\frac{M}{d} \cdot \left(D \cdot 0.25\right)\right), \left(\frac{D}{d} \cdot \frac{M}{-2}\right) \cdot \frac{h}{\ell}, d\right)}{\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 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\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 \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
          9. Add Preprocessing

          Alternative 3: 79.8% 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}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \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_3 := \frac{D\_m}{-2} \cdot \frac{M\_m}{d}\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-51}:\\ \;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \mathsf{fma}\left(\frac{\frac{h}{\ell} \cdot \left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right)}{d}, t\_3, 1\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-242} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+260}\right):\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), t\_3, 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot t\_0\\ \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 h)))
                  (t_1 (sqrt (/ d l)))
                  (t_2
                   (*
                    (* (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_3 (* (/ D_m -2.0) (/ M_m d))))
             (if (<= t_2 -4e-51)
               (* (* t_0 t_1) (fma (/ (* (/ h l) (* M_m (* D_m 0.25))) d) t_3 1.0))
               (if (or (<= t_2 2e-242) (not (<= t_2 5e+260)))
                 (*
                  (fabs (/ d (sqrt (* l h))))
                  (fma (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d))) t_3 1.0))
                 (* t_1 t_0)))))
          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 / h));
          	double t_1 = sqrt((d / l));
          	double t_2 = (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_3 = (D_m / -2.0) * (M_m / d);
          	double tmp;
          	if (t_2 <= -4e-51) {
          		tmp = (t_0 * t_1) * fma((((h / l) * (M_m * (D_m * 0.25))) / d), t_3, 1.0);
          	} else if ((t_2 <= 2e-242) || !(t_2 <= 5e+260)) {
          		tmp = fabs((d / sqrt((l * h)))) * fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), t_3, 1.0);
          	} else {
          		tmp = t_1 * t_0;
          	}
          	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 / h))
          	t_1 = sqrt(Float64(d / l))
          	t_2 = 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_3 = Float64(Float64(D_m / -2.0) * Float64(M_m / d))
          	tmp = 0.0
          	if (t_2 <= -4e-51)
          		tmp = Float64(Float64(t_0 * t_1) * fma(Float64(Float64(Float64(h / l) * Float64(M_m * Float64(D_m * 0.25))) / d), t_3, 1.0));
          	elseif ((t_2 <= 2e-242) || !(t_2 <= 5e+260))
          		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), t_3, 1.0));
          	else
          		tmp = Float64(t_1 * t_0);
          	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 / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-51], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(N[(N[(N[(h / l), $MachinePrecision] * N[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * t$95$3 + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, 2e-242], N[Not[LessEqual[t$95$2, 5e+260]], $MachinePrecision]], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3 + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $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}{h}}\\
          t_1 := \sqrt{\frac{d}{\ell}}\\
          t_2 := \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_3 := \frac{D\_m}{-2} \cdot \frac{M\_m}{d}\\
          \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-51}:\\
          \;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \mathsf{fma}\left(\frac{\frac{h}{\ell} \cdot \left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right)}{d}, t\_3, 1\right)\\
          
          \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-242} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+260}\right):\\
          \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), t\_3, 1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1 \cdot t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4e-51

            1. Initial program 86.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -4e-51 < (*.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)))) < 2e-242 or 4.9999999999999996e260 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

            1. Initial program 21.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 2e-242 < (*.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.9999999999999996e260

            1. Initial program 99.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. Applied rewrites91.8%

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
              7. remove-double-negN/A

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

                \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
              9. lower-/.f6498.5

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

              \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification81.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 -4 \cdot 10^{-51}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\frac{h}{\ell} \cdot \left(M \cdot \left(D \cdot 0.25\right)\right)}{d}, \frac{D}{-2} \cdot \frac{M}{d}, 1\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 2 \cdot 10^{-242} \lor \neg \left(\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^{+260}\right):\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 4: 66.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 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m}{2} \cdot D\_m\right) \cdot \left(\frac{\frac{D\_m}{d}}{2} \cdot M\_m\right), -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\ \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 (/ d (sqrt (* l h)))))
             (if (<= t_0 2e-242)
               (*
                (fma
                 (* (* (/ M_m 2.0) D_m) (* (/ (/ D_m d) 2.0) M_m))
                 (* -0.5 (/ h l))
                 1.0)
                t_1)
               (if (<= t_0 1e+161)
                 (* (sqrt (/ d l)) (sqrt (/ d h)))
                 (if (<= t_0 INFINITY)
                   (/ (* (sqrt (/ h l)) d) h)
                   (*
                    (fma
                     (* (/ (* (* M_m (* D_m 0.25)) h) (* d l)) (/ D_m d))
                     (/ M_m -2.0)
                     1.0)
                    t_1))))))
          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 = d / sqrt((l * h));
          	double tmp;
          	if (t_0 <= 2e-242) {
          		tmp = fma((((M_m / 2.0) * D_m) * (((D_m / d) / 2.0) * M_m)), (-0.5 * (h / l)), 1.0) * t_1;
          	} else if (t_0 <= 1e+161) {
          		tmp = sqrt((d / l)) * sqrt((d / h));
          	} else if (t_0 <= ((double) INFINITY)) {
          		tmp = (sqrt((h / l)) * d) / h;
          	} else {
          		tmp = fma(((((M_m * (D_m * 0.25)) * h) / (d * l)) * (D_m / d)), (M_m / -2.0), 1.0) * t_1;
          	}
          	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 = Float64(d / sqrt(Float64(l * h)))
          	tmp = 0.0
          	if (t_0 <= 2e-242)
          		tmp = Float64(fma(Float64(Float64(Float64(M_m / 2.0) * D_m) * Float64(Float64(Float64(D_m / d) / 2.0) * M_m)), Float64(-0.5 * Float64(h / l)), 1.0) * t_1);
          	elseif (t_0 <= 1e+161)
          		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
          	elseif (t_0 <= Inf)
          		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
          	else
          		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * Float64(D_m * 0.25)) * h) / Float64(d * l)) * Float64(D_m / d)), Float64(M_m / -2.0), 1.0) * t_1);
          	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-242], N[(N[(N[(N[(N[(M$95$m / 2.0), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(D$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1e+161], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $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 := \frac{d}{\sqrt{\ell \cdot h}}\\
          \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\frac{M\_m}{2} \cdot D\_m\right) \cdot \left(\frac{\frac{D\_m}{d}}{2} \cdot M\_m\right), -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\
          
          \mathbf{elif}\;t\_0 \leq 10^{+161}:\\
          \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
          
          \mathbf{elif}\;t\_0 \leq \infty:\\
          \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\
          
          
          \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)))) < 2e-242

            1. Initial program 78.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. Applied rewrites27.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 2e-242 < (*.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)))) < 1e161

            1. Initial program 99.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. Applied rewrites92.4%

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
              7. remove-double-negN/A

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

                \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
              9. lower-/.f6498.5

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

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

            if 1e161 < (*.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.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. 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.0

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

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

                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
              2. Taylor expanded in h around 0

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

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

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

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

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

                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. Step-by-step derivation
                  1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
              7. Recombined 4 regimes into one program.
              8. Final simplification68.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^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M}{2} \cdot D\right) \cdot \left(\frac{\frac{D}{d}}{2} \cdot M\right), -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \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 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\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 \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
              9. Add Preprocessing

              Alternative 5: 66.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 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\ \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 (/ d (sqrt (* l h)))))
                 (if (<= t_0 2e-242)
                   (*
                    (fma (/ (* (* (* (* 0.25 D_m) D_m) M_m) M_m) d) (* -0.5 (/ h l)) 1.0)
                    t_1)
                   (if (<= t_0 1e+161)
                     (* (sqrt (/ d l)) (sqrt (/ d h)))
                     (if (<= t_0 INFINITY)
                       (/ (* (sqrt (/ h l)) d) h)
                       (*
                        (fma
                         (* (/ (* (* M_m (* D_m 0.25)) h) (* d l)) (/ D_m d))
                         (/ M_m -2.0)
                         1.0)
                        t_1))))))
              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 = d / sqrt((l * h));
              	double tmp;
              	if (t_0 <= 2e-242) {
              		tmp = fma((((((0.25 * D_m) * D_m) * M_m) * M_m) / d), (-0.5 * (h / l)), 1.0) * t_1;
              	} else if (t_0 <= 1e+161) {
              		tmp = sqrt((d / l)) * sqrt((d / h));
              	} else if (t_0 <= ((double) INFINITY)) {
              		tmp = (sqrt((h / l)) * d) / h;
              	} else {
              		tmp = fma(((((M_m * (D_m * 0.25)) * h) / (d * l)) * (D_m / d)), (M_m / -2.0), 1.0) * t_1;
              	}
              	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 = Float64(d / sqrt(Float64(l * h)))
              	tmp = 0.0
              	if (t_0 <= 2e-242)
              		tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(0.25 * D_m) * D_m) * M_m) * M_m) / d), Float64(-0.5 * Float64(h / l)), 1.0) * t_1);
              	elseif (t_0 <= 1e+161)
              		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
              	elseif (t_0 <= Inf)
              		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
              	else
              		tmp = Float64(fma(Float64(Float64(Float64(Float64(M_m * Float64(D_m * 0.25)) * h) / Float64(d * l)) * Float64(D_m / d)), Float64(M_m / -2.0), 1.0) * t_1);
              	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-242], N[(N[(N[(N[(N[(N[(N[(0.25 * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1e+161], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(N[(N[(N[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $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 := \frac{d}{\sqrt{\ell \cdot h}}\\
              \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\
              
              \mathbf{elif}\;t\_0 \leq 10^{+161}:\\
              \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
              
              \mathbf{elif}\;t\_0 \leq \infty:\\
              \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\
              
              
              \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)))) < 2e-242

                1. Initial program 78.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. Applied rewrites27.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2e-242 < (*.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)))) < 1e161

                1. Initial program 99.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. Applied rewrites92.4%

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
                  7. remove-double-negN/A

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

                    \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                  9. lower-/.f6498.5

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

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

                if 1e161 < (*.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.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. 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.0

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

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

                    \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                  2. Taylor expanded in h around 0

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

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

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

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

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

                    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. Step-by-step derivation
                      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
                  7. Recombined 4 regimes into one program.
                  8. Final simplification67.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 2 \cdot 10^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\right) \cdot D\right) \cdot M\right) \cdot M}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \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 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\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 \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 6: 66.0% 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 := \mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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
                           (*
                            (fma (/ (* (* (* (* 0.25 D_m) D_m) M_m) M_m) d) (* -0.5 (/ h l)) 1.0)
                            (/ d (sqrt (* l h))))))
                     (if (<= t_0 2e-242)
                       t_1
                       (if (<= t_0 1e+161)
                         (* (sqrt (/ d l)) (sqrt (/ d h)))
                         (if (<= t_0 INFINITY) (/ (* (sqrt (/ h l)) d) h) t_1)))))
                  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 = fma((((((0.25 * D_m) * D_m) * M_m) * M_m) / d), (-0.5 * (h / l)), 1.0) * (d / sqrt((l * h)));
                  	double tmp;
                  	if (t_0 <= 2e-242) {
                  		tmp = t_1;
                  	} else if (t_0 <= 1e+161) {
                  		tmp = sqrt((d / l)) * sqrt((d / h));
                  	} else if (t_0 <= ((double) INFINITY)) {
                  		tmp = (sqrt((h / l)) * d) / h;
                  	} else {
                  		tmp = t_1;
                  	}
                  	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 = Float64(fma(Float64(Float64(Float64(Float64(Float64(0.25 * D_m) * D_m) * M_m) * M_m) / d), Float64(-0.5 * Float64(h / l)), 1.0) * Float64(d / sqrt(Float64(l * h))))
                  	tmp = 0.0
                  	if (t_0 <= 2e-242)
                  		tmp = t_1;
                  	elseif (t_0 <= 1e+161)
                  		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
                  	elseif (t_0 <= Inf)
                  		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
                  	else
                  		tmp = t_1;
                  	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[(N[(N[(N[(N[(N[(N[(0.25 * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-242], t$95$1, If[LessEqual[t$95$0, 1e+161], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]
                  
                  \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 := \mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot M\_m\right) \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                  \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;t\_0 \leq 10^{+161}:\\
                  \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                  
                  \mathbf{elif}\;t\_0 \leq \infty:\\
                  \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \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)))) < 2e-242 or +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 55.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. Applied rewrites19.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2e-242 < (*.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)))) < 1e161

                    1. Initial program 99.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. Applied rewrites92.4%

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
                      7. remove-double-negN/A

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

                        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                      9. lower-/.f6498.5

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

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

                    if 1e161 < (*.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.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. 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.0

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

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

                        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                      2. Taylor expanded in h around 0

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

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

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

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

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

                        \[\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^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\right) \cdot D\right) \cdot M\right) \cdot M}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \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 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\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 \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(\left(\left(0.25 \cdot D\right) \cdot D\right) \cdot M\right) \cdot M}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 7: 61.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 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ d (sqrt (* l h)))))
                         (if (<= t_0 2e-242)
                           (*
                            (fma (* (* (* 0.25 D_m) D_m) (/ (* M_m M_m) d)) (* -0.5 (/ h l)) 1.0)
                            t_1)
                           (if (<= t_0 1e+161)
                             (* (sqrt (/ d l)) (sqrt (/ d h)))
                             (if (<= t_0 INFINITY) (/ (* (sqrt (/ h l)) d) h) t_1)))))
                      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 = d / sqrt((l * h));
                      	double tmp;
                      	if (t_0 <= 2e-242) {
                      		tmp = fma((((0.25 * D_m) * D_m) * ((M_m * M_m) / d)), (-0.5 * (h / l)), 1.0) * t_1;
                      	} else if (t_0 <= 1e+161) {
                      		tmp = sqrt((d / l)) * sqrt((d / h));
                      	} else if (t_0 <= ((double) INFINITY)) {
                      		tmp = (sqrt((h / l)) * d) / h;
                      	} else {
                      		tmp = t_1;
                      	}
                      	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 = Float64(d / sqrt(Float64(l * h)))
                      	tmp = 0.0
                      	if (t_0 <= 2e-242)
                      		tmp = Float64(fma(Float64(Float64(Float64(0.25 * D_m) * D_m) * Float64(Float64(M_m * M_m) / d)), Float64(-0.5 * Float64(h / l)), 1.0) * t_1);
                      	elseif (t_0 <= 1e+161)
                      		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
                      	elseif (t_0 <= Inf)
                      		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
                      	else
                      		tmp = t_1;
                      	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-242], N[(N[(N[(N[(N[(0.25 * D$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 1e+161], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]
                      
                      \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 := \frac{d}{\sqrt{\ell \cdot h}}\\
                      \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-242}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(\left(0.25 \cdot D\_m\right) \cdot D\_m\right) \cdot \frac{M\_m \cdot M\_m}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot t\_1\\
                      
                      \mathbf{elif}\;t\_0 \leq 10^{+161}:\\
                      \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                      
                      \mathbf{elif}\;t\_0 \leq \infty:\\
                      \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \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)))) < 2e-242

                        1. Initial program 78.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. Applied rewrites27.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 2e-242 < (*.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)))) < 1e161

                        1. Initial program 99.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. Applied rewrites92.4%

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
                          7. remove-double-negN/A

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

                            \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                          9. lower-/.f6498.5

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

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

                        if 1e161 < (*.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.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. 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.0

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

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

                            \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                          2. Taylor expanded in h around 0

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

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

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

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

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

                            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 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-*.f6421.5

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

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

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

                              \[\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^{-242}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(0.25 \cdot D\right) \cdot D\right) \cdot \frac{M \cdot M}{d}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \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 10^{+161}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\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 \infty:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                            9. Add Preprocessing

                            Alternative 8: 80.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 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_1 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ t_2 := \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\_2 \leq 5 \cdot 10^{+260}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\left|t\_0\right| \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, \left(\frac{{\left(\frac{M\_m}{2} \cdot D\_m\right)}^{2}}{d} \cdot h\right) \cdot \frac{-0.5}{\ell}, t\_0\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 (sqrt (* l h))))
                                    (t_1
                                     (fma
                                      (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                      (* (/ D_m -2.0) (/ M_m d))
                                      1.0))
                                    (t_2
                                     (*
                                      (* (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_2 5e+260)
                                 (* (* (sqrt (/ d h)) (sqrt (/ d l))) t_1)
                                 (if (<= t_2 INFINITY)
                                   (* (fabs t_0) t_1)
                                   (fma
                                    t_0
                                    (* (* (/ (pow (* (/ M_m 2.0) D_m) 2.0) d) h) (/ -0.5 l))
                                    t_0)))))
                            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 / sqrt((l * h));
                            	double t_1 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                            	double t_2 = (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_2 <= 5e+260) {
                            		tmp = (sqrt((d / h)) * sqrt((d / l))) * t_1;
                            	} else if (t_2 <= ((double) INFINITY)) {
                            		tmp = fabs(t_0) * t_1;
                            	} else {
                            		tmp = fma(t_0, (((pow(((M_m / 2.0) * D_m), 2.0) / d) * h) * (-0.5 / l)), t_0);
                            	}
                            	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 / sqrt(Float64(l * h)))
                            	t_1 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                            	t_2 = 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_2 <= 5e+260)
                            		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * t_1);
                            	elseif (t_2 <= Inf)
                            		tmp = Float64(abs(t_0) * t_1);
                            	else
                            		tmp = fma(t_0, Float64(Float64(Float64((Float64(Float64(M_m / 2.0) * D_m) ^ 2.0) / d) * h) * Float64(-0.5 / l)), t_0);
                            	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = 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$2, 5e+260], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$0 * N[(N[(N[(N[Power[N[(N[(M$95$m / 2.0), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + t$95$0), $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}{\sqrt{\ell \cdot h}}\\
                            t_1 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                            t_2 := \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\_2 \leq 5 \cdot 10^{+260}:\\
                            \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_1\\
                            
                            \mathbf{elif}\;t\_2 \leq \infty:\\
                            \;\;\;\;\left|t\_0\right| \cdot t\_1\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(t\_0, \left(\frac{{\left(\frac{M\_m}{2} \cdot D\_m\right)}^{2}}{d} \cdot h\right) \cdot \frac{-0.5}{\ell}, t\_0\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.9999999999999996e260

                              1. Initial program 87.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 4.9999999999999996e260 < (*.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 41.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              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. Applied rewrites0.7%

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

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

                              \[\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^{+260}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\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 \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{d}{\sqrt{\ell \cdot h}}, \left(\frac{{\left(\frac{M}{2} \cdot D\right)}^{2}}{d} \cdot h\right) \cdot \frac{-0.5}{\ell}, \frac{d}{\sqrt{\ell \cdot h}}\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 9: 77.8% 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 2 \cdot 10^{-242} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+260}\right):\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{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
                                     (*
                                      (* (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 (or (<= t_0 2e-242) (not (<= t_0 5e+260)))
                                 (*
                                  (fabs (/ d (sqrt (* l h))))
                                  (fma
                                   (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                   (* (/ D_m -2.0) (/ M_m d))
                                   1.0))
                                 (* (sqrt (/ d l)) (sqrt (/ d 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 <= 2e-242) || !(t_0 <= 5e+260)) {
                            		tmp = fabs((d / sqrt((l * h)))) * fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                            	} else {
                            		tmp = sqrt((d / l)) * sqrt((d / 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 <= 2e-242) || !(t_0 <= 5e+260))
                            		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0));
                            	else
                            		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / 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[Or[LessEqual[t$95$0, 2e-242], N[Not[LessEqual[t$95$0, 5e+260]], $MachinePrecision]], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / 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 := \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 2 \cdot 10^{-242} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+260}\right):\\
                            \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                            
                            
                            \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)))) < 2e-242 or 4.9999999999999996e260 < (*.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 53.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 2e-242 < (*.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.9999999999999996e260

                              1. Initial program 99.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. Applied rewrites91.8%

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{\frac{d}{\ell}}\right)\right)\right)\right)} \cdot \sqrt{\frac{d}{h}} \]
                                7. remove-double-negN/A

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

                                  \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                                9. lower-/.f6498.5

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

                                \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification79.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^{-242} \lor \neg \left(\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^{+260}\right):\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 10: 78.9% 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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \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^{+260}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot t\_0\\ \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
                                     (fma
                                      (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                      (* (/ D_m -2.0) (/ M_m d))
                                      1.0)))
                               (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+260)
                                 (* (* (sqrt (/ d h)) (sqrt (/ d l))) t_0)
                                 (* (fabs (/ d (sqrt (* l h)))) t_0))))
                            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 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                            	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+260) {
                            		tmp = (sqrt((d / h)) * sqrt((d / l))) * t_0;
                            	} else {
                            		tmp = fabs((d / sqrt((l * h)))) * t_0;
                            	}
                            	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 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                            	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+260)
                            		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * t_0);
                            	else
                            		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * t_0);
                            	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[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $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+260], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                            \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^{+260}:\\
                            \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.9999999999999996e260

                              1. Initial program 87.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 4.9999999999999996e260 < (*.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 17.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification79.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^{+260}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 11: 80.4% accurate, 2.1× 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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{-246}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq 1.18 \cdot 10^{-200}:\\ \;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right), \frac{M\_m}{d} \cdot M\_m, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\ \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
                                     (fma
                                      (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                      (* (/ D_m -2.0) (/ M_m d))
                                      1.0)))
                               (if (<= d -1.2e-246)
                                 (* (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))) t_0)
                                 (if (<= d 1.18e-200)
                                   (/
                                    (fma
                                     (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))
                                     (* (/ M_m d) M_m)
                                     (* (sqrt (/ h l)) d))
                                    h)
                                   (* (/ (/ d (sqrt l)) (sqrt h)) t_0)))))
                            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 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                            	double tmp;
                            	if (d <= -1.2e-246) {
                            		tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0;
                            	} else if (d <= 1.18e-200) {
                            		tmp = fma((pow((h / l), 1.5) * ((D_m * D_m) * -0.125)), ((M_m / d) * M_m), (sqrt((h / l)) * d)) / h;
                            	} else {
                            		tmp = ((d / sqrt(l)) / sqrt(h)) * t_0;
                            	}
                            	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 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                            	tmp = 0.0
                            	if (d <= -1.2e-246)
                            		tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * t_0);
                            	elseif (d <= 1.18e-200)
                            		tmp = Float64(fma(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125)), Float64(Float64(M_m / d) * M_m), Float64(sqrt(Float64(h / l)) * d)) / h);
                            	else
                            		tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * t_0);
                            	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[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -1.2e-246], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.18e-200], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                            \mathbf{if}\;d \leq -1.2 \cdot 10^{-246}:\\
                            \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
                            
                            \mathbf{elif}\;d \leq 1.18 \cdot 10^{-200}:\\
                            \;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right), \frac{M\_m}{d} \cdot M\_m, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if d < -1.1999999999999999e-246

                              1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if -1.1999999999999999e-246 < d < 1.17999999999999996e-200

                              1. Initial program 34.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-*.f6415.5

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

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

                                  \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                2. Taylor expanded in h around 0

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

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

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

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

                                  if 1.17999999999999996e-200 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 12: 80.5% accurate, 2.1× 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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{-246}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq 1.18 \cdot 10^{-200}:\\ \;\;\;\;\frac{\mathsf{fma}\left(D\_m, \left(-0.125 \cdot D\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\frac{M\_m}{d} \cdot M\_m\right)\right), \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\ \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
                                         (fma
                                          (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                          (* (/ D_m -2.0) (/ M_m d))
                                          1.0)))
                                   (if (<= d -1.2e-246)
                                     (* (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))) t_0)
                                     (if (<= d 1.18e-200)
                                       (/
                                        (fma
                                         D_m
                                         (* (* -0.125 D_m) (* (pow (/ h l) 1.5) (* (/ M_m d) M_m)))
                                         (* (sqrt (/ h l)) d))
                                        h)
                                       (* (/ (/ d (sqrt l)) (sqrt h)) t_0)))))
                                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 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                                	double tmp;
                                	if (d <= -1.2e-246) {
                                		tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0;
                                	} else if (d <= 1.18e-200) {
                                		tmp = fma(D_m, ((-0.125 * D_m) * (pow((h / l), 1.5) * ((M_m / d) * M_m))), (sqrt((h / l)) * d)) / h;
                                	} else {
                                		tmp = ((d / sqrt(l)) / sqrt(h)) * t_0;
                                	}
                                	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 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                                	tmp = 0.0
                                	if (d <= -1.2e-246)
                                		tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * t_0);
                                	elseif (d <= 1.18e-200)
                                		tmp = Float64(fma(D_m, Float64(Float64(-0.125 * D_m) * Float64((Float64(h / l) ^ 1.5) * Float64(Float64(M_m / d) * M_m))), Float64(sqrt(Float64(h / l)) * d)) / h);
                                	else
                                		tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * t_0);
                                	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[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -1.2e-246], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.18e-200], N[(N[(D$95$m * N[(N[(-0.125 * D$95$m), $MachinePrecision] * N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                                \mathbf{if}\;d \leq -1.2 \cdot 10^{-246}:\\
                                \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
                                
                                \mathbf{elif}\;d \leq 1.18 \cdot 10^{-200}:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(D\_m, \left(-0.125 \cdot D\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\frac{M\_m}{d} \cdot M\_m\right)\right), \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if d < -1.1999999999999999e-246

                                  1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if -1.1999999999999999e-246 < d < 1.17999999999999996e-200

                                  1. Initial program 34.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-*.f6415.5

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

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

                                      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                    2. Taylor expanded in h around 0

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

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

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

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

                                      if 1.17999999999999996e-200 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 13: 80.3% accurate, 2.7× 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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\ \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
                                             (fma
                                              (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                              (* (/ D_m -2.0) (/ M_m d))
                                              1.0)))
                                       (if (<= h -5e-310)
                                         (* (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l))) t_0)
                                         (* (/ (/ d (sqrt l)) (sqrt h)) t_0))))
                                    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 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                                    	double tmp;
                                    	if (h <= -5e-310) {
                                    		tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * t_0;
                                    	} else {
                                    		tmp = ((d / sqrt(l)) / sqrt(h)) * t_0;
                                    	}
                                    	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 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                                    	tmp = 0.0
                                    	if (h <= -5e-310)
                                    		tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * t_0);
                                    	else
                                    		tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * t_0);
                                    	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[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                                    \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
                                    \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if h < -4.999999999999985e-310

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if -4.999999999999985e-310 < h

                                      1. Initial program 64.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 14: 77.1% accurate, 3.1× 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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{if}\;d \leq 7.5 \cdot 10^{-211}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\ \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
                                             (fma
                                              (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                              (* (/ D_m -2.0) (/ M_m d))
                                              1.0)))
                                       (if (<= d 7.5e-211)
                                         (* (fabs (/ d (sqrt (* l h)))) t_0)
                                         (* (/ (/ d (sqrt l)) (sqrt h)) t_0))))
                                    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 = fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                                    	double tmp;
                                    	if (d <= 7.5e-211) {
                                    		tmp = fabs((d / sqrt((l * h)))) * t_0;
                                    	} else {
                                    		tmp = ((d / sqrt(l)) / sqrt(h)) * t_0;
                                    	}
                                    	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 = fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0)
                                    	tmp = 0.0
                                    	if (d <= 7.5e-211)
                                    		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * t_0);
                                    	else
                                    		tmp = Float64(Float64(Float64(d / sqrt(l)) / sqrt(h)) * t_0);
                                    	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[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, 7.5e-211], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$0), $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 := \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                                    \mathbf{if}\;d \leq 7.5 \cdot 10^{-211}:\\
                                    \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot t\_0\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}} \cdot t\_0\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if d < 7.5000000000000003e-211

                                      1. Initial program 62.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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 7.5000000000000003e-211 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 15: 45.7% accurate, 3.1× 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}\;\ell \leq -6.5 \cdot 10^{-212}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{elif}\;\ell \leq 10^{-307}:\\ \;\;\;\;t\_0 \cdot d\\ \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 (sqrt (pow (* l h) -1.0))))
                                       (if (<= l -6.5e-212)
                                         (* (- d) t_0)
                                         (if (<= l 1e-307) (* t_0 d) (/ 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 = sqrt(pow((l * h), -1.0));
                                    	double tmp;
                                    	if (l <= -6.5e-212) {
                                    		tmp = -d * t_0;
                                    	} else if (l <= 1e-307) {
                                    		tmp = t_0 * d;
                                    	} 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) :: t_0
                                        real(8) :: tmp
                                        t_0 = sqrt(((l * h) ** (-1.0d0)))
                                        if (l <= (-6.5d-212)) then
                                            tmp = -d * t_0
                                        else if (l <= 1d-307) then
                                            tmp = t_0 * d
                                        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 t_0 = Math.sqrt(Math.pow((l * h), -1.0));
                                    	double tmp;
                                    	if (l <= -6.5e-212) {
                                    		tmp = -d * t_0;
                                    	} else if (l <= 1e-307) {
                                    		tmp = t_0 * d;
                                    	} 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):
                                    	t_0 = math.sqrt(math.pow((l * h), -1.0))
                                    	tmp = 0
                                    	if l <= -6.5e-212:
                                    		tmp = -d * t_0
                                    	elif l <= 1e-307:
                                    		tmp = t_0 * d
                                    	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)
                                    	t_0 = sqrt((Float64(l * h) ^ -1.0))
                                    	tmp = 0.0
                                    	if (l <= -6.5e-212)
                                    		tmp = Float64(Float64(-d) * t_0);
                                    	elseif (l <= 1e-307)
                                    		tmp = Float64(t_0 * d);
                                    	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)
                                    	t_0 = sqrt(((l * h) ^ -1.0));
                                    	tmp = 0.0;
                                    	if (l <= -6.5e-212)
                                    		tmp = -d * t_0;
                                    	elseif (l <= 1e-307)
                                    		tmp = t_0 * d;
                                    	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_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -6.5e-212], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, 1e-307], N[(t$95$0 * d), $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}
                                    t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                    \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-212}:\\
                                    \;\;\;\;\left(-d\right) \cdot t\_0\\
                                    
                                    \mathbf{elif}\;\ell \leq 10^{-307}:\\
                                    \;\;\;\;t\_0 \cdot d\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if l < -6.5e-212

                                      1. Initial program 62.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. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                        14. lower-*.f6445.9

                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                      5. Applied rewrites45.9%

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

                                      if -6.5e-212 < l < 9.99999999999999909e-308

                                      1. Initial program 80.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-*.f6440.2

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

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

                                      if 9.99999999999999909e-308 < l

                                      1. Initial program 65.3%

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

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

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

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

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-212}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;\ell \leq 10^{-307}:\\ \;\;\;\;\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                        5. Add Preprocessing

                                        Alternative 16: 46.6% 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}\;\ell \leq -2.5 \cdot 10^{-202}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;\ell \leq 5.7 \cdot 10^{-259}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \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 (<= l -2.5e-202)
                                           (* (- d) (sqrt (pow (* l h) -1.0)))
                                           (if (<= l 5.7e-259)
                                             (/ (* (- d) (sqrt (/ h l))) h)
                                             (/ 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 (l <= -2.5e-202) {
                                        		tmp = -d * sqrt(pow((l * h), -1.0));
                                        	} else if (l <= 5.7e-259) {
                                        		tmp = (-d * sqrt((h / l))) / h;
                                        	} 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 (l <= (-2.5d-202)) then
                                                tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                            else if (l <= 5.7d-259) then
                                                tmp = (-d * sqrt((h / l))) / h
                                            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 (l <= -2.5e-202) {
                                        		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                        	} else if (l <= 5.7e-259) {
                                        		tmp = (-d * Math.sqrt((h / l))) / h;
                                        	} 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 l <= -2.5e-202:
                                        		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                        	elif l <= 5.7e-259:
                                        		tmp = (-d * math.sqrt((h / l))) / h
                                        	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 (l <= -2.5e-202)
                                        		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                        	elseif (l <= 5.7e-259)
                                        		tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h);
                                        	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 (l <= -2.5e-202)
                                        		tmp = -d * sqrt(((l * h) ^ -1.0));
                                        	elseif (l <= 5.7e-259)
                                        		tmp = (-d * sqrt((h / l))) / h;
                                        	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[l, -2.5e-202], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.7e-259], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $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}\;\ell \leq -2.5 \cdot 10^{-202}:\\
                                        \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                        
                                        \mathbf{elif}\;\ell \leq 5.7 \cdot 10^{-259}:\\
                                        \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if l < -2.49999999999999986e-202

                                          1. Initial program 63.0%

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

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

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

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

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

                                              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-1 \cdot d\right)} \]
                                            7. mul-1-negN/A

                                              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                            8. *-commutativeN/A

                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                            9. lower-*.f64N/A

                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                            10. lower-neg.f64N/A

                                              \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                            11. lower-sqrt.f64N/A

                                              \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                            12. lower-/.f64N/A

                                              \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                            13. *-commutativeN/A

                                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                            14. lower-*.f6445.9

                                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                          5. Applied rewrites45.9%

                                            \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                          if -2.49999999999999986e-202 < l < 5.69999999999999947e-259

                                          1. Initial program 83.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. 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-*.f6432.1

                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                          5. Applied rewrites32.1%

                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites29.5%

                                              \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                            2. Taylor expanded in h around 0

                                              \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                            4. Applied rewrites41.7%

                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \frac{M \cdot M}{d}, \sqrt{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
                                            5. Taylor expanded in l around -inf

                                              \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites37.9%

                                                \[\leadsto \frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]

                                              if 5.69999999999999947e-259 < l

                                              1. Initial program 62.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. 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-*.f6447.4

                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                              5. Applied rewrites47.4%

                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites47.5%

                                                  \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites53.4%

                                                    \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                3. Recombined 3 regimes into one program.
                                                4. Final simplification48.0%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.5 \cdot 10^{-202}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;\ell \leq 5.7 \cdot 10^{-259}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                5. Add Preprocessing

                                                Alternative 17: 41.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}\;\ell \leq -6.5 \cdot 10^{-212}:\\ \;\;\;\;\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 (<= l -6.5e-212) (* (- 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 (l <= -6.5e-212) {
                                                		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 (l <= (-6.5d-212)) 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 (l <= -6.5e-212) {
                                                		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 l <= -6.5e-212:
                                                		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 (l <= -6.5e-212)
                                                		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 (l <= -6.5e-212)
                                                		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[l, -6.5e-212], 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}\;\ell \leq -6.5 \cdot 10^{-212}:\\
                                                \;\;\;\;\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 l < -6.5e-212

                                                  1. Initial program 62.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. 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. *-commutativeN/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
                                                    3. unpow2N/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
                                                    4. rem-square-sqrtN/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(\color{blue}{-1} \cdot d\right) \]
                                                    5. *-commutativeN/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(d \cdot -1\right)} \]
                                                    6. *-commutativeN/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-1 \cdot d\right)} \]
                                                    7. mul-1-negN/A

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                    8. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                    9. lower-*.f64N/A

                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                    10. lower-neg.f64N/A

                                                      \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                    11. lower-sqrt.f64N/A

                                                      \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                    12. lower-/.f64N/A

                                                      \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                    13. *-commutativeN/A

                                                      \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                    14. lower-*.f6445.9

                                                      \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                  5. Applied rewrites45.9%

                                                    \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                  if -6.5e-212 < l

                                                  1. Initial program 68.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-*.f6444.2

                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                  5. Applied rewrites44.2%

                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                3. Recombined 2 regimes into one program.
                                                4. Final simplification45.0%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-212}:\\ \;\;\;\;\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 18: 73.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} t_0 := \frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_2 := \frac{D\_m}{-2} \cdot \frac{M\_m}{d}\\ \mathbf{if}\;d \leq 7.8 \cdot 10^{-165}:\\ \;\;\;\;\left|t\_1\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), t\_2, 1\right)\\ \mathbf{elif}\;d \leq 5.8 \cdot 10^{+100}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(t\_0, t\_2, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\ \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_m 0.25)) h) (* d l)))
                                                        (t_1 (/ d (sqrt (* l h))))
                                                        (t_2 (* (/ D_m -2.0) (/ M_m d))))
                                                   (if (<= d 7.8e-165)
                                                     (* (fabs t_1) (fma (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d))) t_2 1.0))
                                                     (if (<= d 5.8e+100)
                                                       (* (* (sqrt (/ d h)) (sqrt (/ d l))) (fma t_0 t_2 1.0))
                                                       (* (fma (* t_0 (/ D_m d)) (/ M_m -2.0) 1.0) t_1)))))
                                                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_m * 0.25)) * h) / (d * l);
                                                	double t_1 = d / sqrt((l * h));
                                                	double t_2 = (D_m / -2.0) * (M_m / d);
                                                	double tmp;
                                                	if (d <= 7.8e-165) {
                                                		tmp = fabs(t_1) * fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), t_2, 1.0);
                                                	} else if (d <= 5.8e+100) {
                                                		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma(t_0, t_2, 1.0);
                                                	} else {
                                                		tmp = fma((t_0 * (D_m / d)), (M_m / -2.0), 1.0) * t_1;
                                                	}
                                                	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(M_m * Float64(D_m * 0.25)) * h) / Float64(d * l))
                                                	t_1 = Float64(d / sqrt(Float64(l * h)))
                                                	t_2 = Float64(Float64(D_m / -2.0) * Float64(M_m / d))
                                                	tmp = 0.0
                                                	if (d <= 7.8e-165)
                                                		tmp = Float64(abs(t_1) * fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), t_2, 1.0));
                                                	elseif (d <= 5.8e+100)
                                                		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(t_0, t_2, 1.0));
                                                	else
                                                		tmp = Float64(fma(Float64(t_0 * Float64(D_m / d)), Float64(M_m / -2.0), 1.0) * t_1);
                                                	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[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 7.8e-165], N[(N[Abs[t$95$1], $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.8e+100], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$0 * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $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{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}\\
                                                t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                t_2 := \frac{D\_m}{-2} \cdot \frac{M\_m}{d}\\
                                                \mathbf{if}\;d \leq 7.8 \cdot 10^{-165}:\\
                                                \;\;\;\;\left|t\_1\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), t\_2, 1\right)\\
                                                
                                                \mathbf{elif}\;d \leq 5.8 \cdot 10^{+100}:\\
                                                \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(t\_0, t\_2, 1\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if d < 7.7999999999999997e-165

                                                  1. Initial program 60.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-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6460.8

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites60.8%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites62.4%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval62.4

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6462.4

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites62.4%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. lift-sqrt.f64N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\color{blue}{\frac{d}{\ell}}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. lift-sqrt.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. sqrt-unprodN/A

                                                      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    6. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    7. frac-timesN/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    8. *-commutativeN/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    9. lift-*.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    10. rem-square-sqrtN/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{\ell \cdot h} \cdot \sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    11. lift-sqrt.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{\ell \cdot h}} \cdot \sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    12. lift-sqrt.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\sqrt{\ell \cdot h} \cdot \color{blue}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    13. frac-timesN/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{\sqrt{\ell \cdot h}} \cdot \frac{d}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    14. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \cdot \frac{d}{\sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    15. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\frac{d}{\sqrt{\ell \cdot h}} \cdot \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    16. rem-sqrt-square-revN/A

                                                      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    17. lower-fabs.f6475.0

                                                      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  9. Applied rewrites75.0%

                                                    \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]

                                                  if 7.7999999999999997e-165 < d < 5.8000000000000001e100

                                                  1. Initial program 82.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-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6482.6

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites82.6%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites84.3%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval84.3

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6484.3

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites84.3%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right) \cdot \frac{h}{\ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)} \cdot \frac{h}{\ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \color{blue}{\frac{M}{d}}\right) \cdot \frac{h}{\ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. associate-*r/N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot M}{d}} \cdot \frac{h}{\ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    6. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot M}{d} \cdot \color{blue}{\frac{h}{\ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    7. frac-timesN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot M\right) \cdot h}{d \cdot \ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    8. lower-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot M\right) \cdot h}{d \cdot \ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    9. lower-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\color{blue}{\left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot M\right) \cdot h}}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    10. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \left(\frac{1}{2} \cdot \frac{D}{2}\right)\right)} \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    11. lower-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \left(\frac{1}{2} \cdot \frac{D}{2}\right)\right)} \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    12. lift-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{2}\right)}\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    13. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(\frac{1}{2} \cdot \color{blue}{\frac{D}{2}}\right)\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    14. associate-*r/N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{\frac{1}{2} \cdot D}{2}}\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    15. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{\color{blue}{D \cdot \frac{1}{2}}}{2}\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    16. associate-/l*N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\left(D \cdot \frac{\frac{1}{2}}{2}\right)}\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    17. lower-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\left(D \cdot \frac{\frac{1}{2}}{2}\right)}\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    18. metadata-evalN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot \color{blue}{\frac{1}{4}}\right)\right) \cdot h}{d \cdot \ell}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    19. lower-*.f6487.9

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{\color{blue}{d \cdot \ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  9. Applied rewrites87.9%

                                                    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}}, \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]

                                                  if 5.8000000000000001e100 < d

                                                  1. Initial program 64.3%

                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  2. Add Preprocessing
                                                  3. Step-by-step derivation
                                                    1. lift-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6464.3

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites64.3%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites64.5%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval64.5

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6464.5

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites64.5%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Applied rewrites85.4%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
                                                3. Recombined 3 regimes into one program.
                                                4. Add Preprocessing

                                                Alternative 19: 73.8% 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 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_1 := \frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}\\ \mathbf{if}\;d \leq 2.7 \cdot 10^{-123}:\\ \;\;\;\;\left|t\_0\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\ \mathbf{elif}\;d \leq 5.8 \cdot 10^{+100}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{D\_m}{d}, \frac{M\_m}{-2} \cdot t\_1, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_0\\ \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 (sqrt (* l h))))
                                                        (t_1 (/ (* (* M_m (* D_m 0.25)) h) (* d l))))
                                                   (if (<= d 2.7e-123)
                                                     (*
                                                      (fabs t_0)
                                                      (fma
                                                       (* (/ h l) (* (* 0.5 (/ D_m 2.0)) (/ M_m d)))
                                                       (* (/ D_m -2.0) (/ M_m d))
                                                       1.0))
                                                     (if (<= d 5.8e+100)
                                                       (*
                                                        (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                        (fma (/ D_m d) (* (/ M_m -2.0) t_1) 1.0))
                                                       (* (fma (* t_1 (/ D_m d)) (/ M_m -2.0) 1.0) t_0)))))
                                                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 / sqrt((l * h));
                                                	double t_1 = ((M_m * (D_m * 0.25)) * h) / (d * l);
                                                	double tmp;
                                                	if (d <= 2.7e-123) {
                                                		tmp = fabs(t_0) * fma(((h / l) * ((0.5 * (D_m / 2.0)) * (M_m / d))), ((D_m / -2.0) * (M_m / d)), 1.0);
                                                	} else if (d <= 5.8e+100) {
                                                		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D_m / d), ((M_m / -2.0) * t_1), 1.0);
                                                	} else {
                                                		tmp = fma((t_1 * (D_m / d)), (M_m / -2.0), 1.0) * t_0;
                                                	}
                                                	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 / sqrt(Float64(l * h)))
                                                	t_1 = Float64(Float64(Float64(M_m * Float64(D_m * 0.25)) * h) / Float64(d * l))
                                                	tmp = 0.0
                                                	if (d <= 2.7e-123)
                                                		tmp = Float64(abs(t_0) * fma(Float64(Float64(h / l) * Float64(Float64(0.5 * Float64(D_m / 2.0)) * Float64(M_m / d))), Float64(Float64(D_m / -2.0) * Float64(M_m / d)), 1.0));
                                                	elseif (d <= 5.8e+100)
                                                		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D_m / d), Float64(Float64(M_m / -2.0) * t_1), 1.0));
                                                	else
                                                		tmp = Float64(fma(Float64(t_1 * Float64(D_m / d)), Float64(M_m / -2.0), 1.0) * t_0);
                                                	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M$95$m * N[(D$95$m * 0.25), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 2.7e-123], N[(N[Abs[t$95$0], $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * N[(N[(0.5 * N[(D$95$m / 2.0), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / -2.0), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.8e+100], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(M$95$m / -2.0), $MachinePrecision] * t$95$1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / -2.0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $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}{\sqrt{\ell \cdot h}}\\
                                                t_1 := \frac{\left(M\_m \cdot \left(D\_m \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}\\
                                                \mathbf{if}\;d \leq 2.7 \cdot 10^{-123}:\\
                                                \;\;\;\;\left|t\_0\right| \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D\_m}{2}\right) \cdot \frac{M\_m}{d}\right), \frac{D\_m}{-2} \cdot \frac{M\_m}{d}, 1\right)\\
                                                
                                                \mathbf{elif}\;d \leq 5.8 \cdot 10^{+100}:\\
                                                \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{D\_m}{d}, \frac{M\_m}{-2} \cdot t\_1, 1\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \frac{D\_m}{d}, \frac{M\_m}{-2}, 1\right) \cdot t\_0\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if d < 2.7000000000000001e-123

                                                  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. Step-by-step derivation
                                                    1. lift-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6461.1

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites61.1%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites62.6%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval62.6

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6462.6

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites62.6%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. lift-sqrt.f64N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\color{blue}{\frac{d}{\ell}}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. lift-sqrt.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. sqrt-unprodN/A

                                                      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    6. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    7. frac-timesN/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    8. *-commutativeN/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    9. lift-*.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    10. rem-square-sqrtN/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{\ell \cdot h} \cdot \sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    11. lift-sqrt.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\sqrt{\ell \cdot h}} \cdot \sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    12. lift-sqrt.f64N/A

                                                      \[\leadsto \sqrt{\frac{d \cdot d}{\sqrt{\ell \cdot h} \cdot \color{blue}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    13. frac-timesN/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{\sqrt{\ell \cdot h}} \cdot \frac{d}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    14. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \cdot \frac{d}{\sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    15. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\frac{d}{\sqrt{\ell \cdot h}} \cdot \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    16. rem-sqrt-square-revN/A

                                                      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    17. lower-fabs.f6474.7

                                                      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  9. Applied rewrites74.7%

                                                    \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]

                                                  if 2.7000000000000001e-123 < d < 5.8000000000000001e100

                                                  1. Initial program 84.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-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6484.5

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites84.5%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites86.6%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval86.6

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6486.6

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites86.6%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Step-by-step derivation
                                                    1. lift-fma.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\left(\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) \cdot \left(\frac{D}{-2} \cdot \frac{M}{d}\right) + 1\right)} \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\left(\frac{D}{-2} \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right)} + 1\right) \]
                                                    3. lift-*.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\left(\frac{D}{-2} \cdot \frac{M}{d}\right)} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    4. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\left(\color{blue}{\frac{D}{-2}} \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    5. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\left(\frac{D}{-2} \cdot \color{blue}{\frac{M}{d}}\right) \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    6. frac-timesN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\frac{D \cdot M}{-2 \cdot d}} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    7. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\frac{\color{blue}{M \cdot D}}{-2 \cdot d} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    8. frac-timesN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\left(\frac{M}{-2} \cdot \frac{D}{d}\right)} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    9. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\left(\color{blue}{\frac{M}{-2}} \cdot \frac{D}{d}\right) \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    10. lift-/.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\left(\frac{M}{-2} \cdot \color{blue}{\frac{D}{d}}\right) \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    11. *-commutativeN/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{M}{-2}\right)} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right) + 1\right) \]
                                                    12. associate-*l*N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(\color{blue}{\frac{D}{d} \cdot \left(\frac{M}{-2} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right)\right)} + 1\right) \]
                                                    13. lower-fma.f64N/A

                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{D}{d}, \frac{M}{-2} \cdot \left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right)\right), 1\right)} \]
                                                  9. Applied rewrites88.6%

                                                    \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{D}{d}, \frac{M}{-2} \cdot \frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell}, 1\right)} \]

                                                  if 5.8000000000000001e100 < d

                                                  1. Initial program 64.3%

                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  2. Add Preprocessing
                                                  3. Step-by-step derivation
                                                    1. lift-pow.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    4. unpow1/2N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    5. lower-sqrt.f6464.3

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  4. Applied rewrites64.3%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  5. Applied rewrites64.5%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right)} \]
                                                  6. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    2. metadata-eval64.5

                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    3. lift-pow.f64N/A

                                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    4. pow1/2N/A

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(\frac{1}{2} \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                    5. lift-sqrt.f6464.5

                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  7. Applied rewrites64.5%

                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot \left(\left(0.5 \cdot \frac{D}{2}\right) \cdot \frac{M}{d}\right), \frac{D}{-2} \cdot \frac{M}{d}, 1\right) \]
                                                  8. Applied rewrites85.4%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot 0.25\right)\right) \cdot h}{d \cdot \ell} \cdot \frac{D}{d}, \frac{M}{-2}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
                                                3. Recombined 3 regimes into one program.
                                                4. Add Preprocessing

                                                Alternative 20: 26.0% 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 65.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. 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-*.f6426.3

                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                5. Applied rewrites26.3%

                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                6. Final simplification26.3%

                                                  \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
                                                7. Add Preprocessing

                                                Alternative 21: 25.9% 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 65.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. 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-*.f6426.3

                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                5. Applied rewrites26.3%

                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites26.0%

                                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                  2. Add Preprocessing

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2024361 
                                                  (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)))))