Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.6% → 82.4%
Time: 14.4s
Alternatives: 22
Speedup: 0.5×

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 22 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.6% 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: 82.4% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(\left(D \cdot D\right) \cdot \left(t\_0 \cdot t\_0\right)\right), \frac{h}{\ell}, 1\right) \cdot t\_5\\

\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+256}:\\
\;\;\;\;t\_2 \cdot t\_3\\

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


\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)))) < -1.00000000000000003e-206

    1. Initial program 91.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. 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.f6436.9

        \[\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 rewrites36.9%

      \[\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. Applied rewrites92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000003e-206 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0

    1. Initial program 47.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. 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.f6430.6

        \[\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 rewrites30.6%

      \[\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. Applied rewrites76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

    1. Initial program 97.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. 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.f6450.3

        \[\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 rewrites50.3%

      \[\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. Applied rewrites96.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
    6. 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}} \]
    7. 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. *-commutativeN/A

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

        \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
      5. associate-*l*N/A

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
      7. *-rgt-identityN/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-/.f6497.5

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

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

    if 5.00000000000000015e256 < (*.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 12.2%

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

        \[\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 rewrites12.1%

      \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.2% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;t\_1 \cdot 1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}, \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell}, 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)))) < 0.0

    1. Initial program 85.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. 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.f6436.1

        \[\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 rewrites36.1%

      \[\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. Applied rewrites82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

    1. Initial program 97.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. 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.f6450.3

        \[\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 rewrites50.3%

      \[\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. Applied rewrites96.2%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
    6. 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}} \]
    7. 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. *-commutativeN/A

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

        \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
      5. associate-*l*N/A

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
      7. *-rgt-identityN/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-/.f6497.5

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

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

    if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
    4. Step-by-step derivation
      1. Applied rewrites30.6%

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

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

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

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

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
        8. pow-prod-downN/A

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

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

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

          \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
        12. frac-timesN/A

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

          \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
        14. rem-sqrt-square-revN/A

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

          \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
        16. lower-fabs.f64N/A

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

          \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
        18. lower-*.f6493.8

          \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
      3. Applied rewrites93.8%

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

      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. 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.f644.3

          \[\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 rewrites4.3%

        \[\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. Applied rewrites27.9%

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 76.3% accurate, 0.2× speedup?

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

      1. Initial program 85.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. 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.f6436.1

          \[\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 rewrites36.1%

        \[\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. Applied rewrites82.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
        12. lower-*.f6461.5

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

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

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

        if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

        1. Initial program 97.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. 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.f6450.3

            \[\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 rewrites50.3%

          \[\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. Applied rewrites96.2%

          \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
        6. 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}} \]
        7. 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. *-commutativeN/A

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

            \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
          5. associate-*l*N/A

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
          7. *-rgt-identityN/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-/.f6497.5

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

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

        if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
        4. Step-by-step derivation
          1. Applied rewrites30.6%

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
            8. pow-prod-downN/A

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

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

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

              \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
            12. frac-timesN/A

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

              \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
            14. rem-sqrt-square-revN/A

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

              \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
            16. lower-fabs.f64N/A

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

              \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
            18. lower-*.f6493.8

              \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
          3. Applied rewrites93.8%

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

          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. 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.f644.3

              \[\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 rewrites4.3%

            \[\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. Applied rewrites27.9%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 72.1% accurate, 0.2× speedup?

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

          1. Initial program 85.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. 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.f6436.1

              \[\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 rewrites36.1%

            \[\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. Applied rewrites82.8%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{\color{blue}{M \cdot M}}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
            12. lower-*.f6461.5

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

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

          if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

          1. Initial program 97.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. 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.f6450.3

              \[\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 rewrites50.3%

            \[\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. Applied rewrites96.2%

            \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
          6. 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}} \]
          7. 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. *-commutativeN/A

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

              \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
            5. associate-*l*N/A

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
            7. *-rgt-identityN/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-/.f6497.5

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

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

          if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
          4. Step-by-step derivation
            1. Applied rewrites30.6%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
              8. pow-prod-downN/A

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

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

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

                \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
              12. frac-timesN/A

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

                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
              14. rem-sqrt-square-revN/A

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

                \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
              16. lower-fabs.f64N/A

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

                \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
              18. lower-*.f6493.8

                \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
            3. Applied rewrites93.8%

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

            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. 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.f644.3

                \[\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 rewrites4.3%

              \[\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. Applied rewrites27.9%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 0:\\ \;\;\;\;\mathsf{fma}\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{\frac{M \cdot M}{d}}{d}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}, \frac{\left(M \cdot M\right) \cdot h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
          7. Add Preprocessing

          Alternative 5: 70.9% accurate, 0.2× speedup?

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

                \[\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 rewrites25.7%

              \[\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. Applied rewrites64.9%

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

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

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

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

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

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

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

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

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

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

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

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

            if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

            1. Initial program 97.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. 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.f6450.3

                \[\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 rewrites50.3%

              \[\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. Applied rewrites96.2%

              \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
            6. 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}} \]
            7. 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. *-commutativeN/A

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

                \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
              5. associate-*l*N/A

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

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
              7. *-rgt-identityN/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-/.f6497.5

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

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

            if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
            4. Step-by-step derivation
              1. Applied rewrites30.6%

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

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

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

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

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

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

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                8. pow-prod-downN/A

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

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

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

                  \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                12. frac-timesN/A

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

                  \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                14. rem-sqrt-square-revN/A

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

                  \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                16. lower-fabs.f64N/A

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

                  \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                18. lower-*.f6493.8

                  \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
              3. Applied rewrites93.8%

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

            Alternative 6: 67.7% accurate, 0.2× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ t_2 := \left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell}\right) \cdot t\_1\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-70}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;t\_1 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D)
             :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) (* 2.0 d)) 2.0)) (/ h l)))))
                    (t_1 (/ (fabs d) (sqrt (* h l))))
                    (t_2
                     (* (* (* -0.125 (/ (/ (* D D) d) d)) (/ (* (* M_m M_m) h) l)) t_1)))
               (if (<= t_0 -2e-70)
                 t_2
                 (if (<= t_0 5e+256)
                   (* (sqrt (/ d l)) (sqrt (/ d h)))
                   (if (<= t_0 INFINITY) (* t_1 1.0) t_2)))))
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D);
            double code(double d, double h, double l, double M_m, double D) {
            	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) / (2.0 * d)), 2.0)) * (h / l)));
            	double t_1 = fabs(d) / sqrt((h * l));
            	double t_2 = ((-0.125 * (((D * D) / d) / d)) * (((M_m * M_m) * h) / l)) * t_1;
            	double tmp;
            	if (t_0 <= -2e-70) {
            		tmp = t_2;
            	} else if (t_0 <= 5e+256) {
            		tmp = sqrt((d / l)) * sqrt((d / h));
            	} else if (t_0 <= ((double) INFINITY)) {
            		tmp = t_1 * 1.0;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            M_m = Math.abs(M);
            assert d < h && h < l && l < M_m && M_m < D;
            public static double code(double d, double h, double l, double M_m, double D) {
            	double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)));
            	double t_1 = Math.abs(d) / Math.sqrt((h * l));
            	double t_2 = ((-0.125 * (((D * D) / d) / d)) * (((M_m * M_m) * h) / l)) * t_1;
            	double tmp;
            	if (t_0 <= -2e-70) {
            		tmp = t_2;
            	} else if (t_0 <= 5e+256) {
            		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
            	} else if (t_0 <= Double.POSITIVE_INFINITY) {
            		tmp = t_1 * 1.0;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
            def code(d, h, l, M_m, D):
            	t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))
            	t_1 = math.fabs(d) / math.sqrt((h * l))
            	t_2 = ((-0.125 * (((D * D) / d) / d)) * (((M_m * M_m) * h) / l)) * t_1
            	tmp = 0
            	if t_0 <= -2e-70:
            		tmp = t_2
            	elif t_0 <= 5e+256:
            		tmp = math.sqrt((d / l)) * math.sqrt((d / h))
            	elif t_0 <= math.inf:
            		tmp = t_1 * 1.0
            	else:
            		tmp = t_2
            	return tmp
            
            M_m = abs(M)
            d, h, l, M_m, D = sort([d, h, l, M_m, D])
            function code(d, h, l, M_m, D)
            	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
            	t_1 = Float64(abs(d) / sqrt(Float64(h * l)))
            	t_2 = Float64(Float64(Float64(-0.125 * Float64(Float64(Float64(D * D) / d) / d)) * Float64(Float64(Float64(M_m * M_m) * h) / l)) * t_1)
            	tmp = 0.0
            	if (t_0 <= -2e-70)
            		tmp = t_2;
            	elseif (t_0 <= 5e+256)
            		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
            	elseif (t_0 <= Inf)
            		tmp = Float64(t_1 * 1.0);
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            M_m = abs(M);
            d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
            function tmp_2 = code(d, h, l, M_m, D)
            	t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
            	t_1 = abs(d) / sqrt((h * l));
            	t_2 = ((-0.125 * (((D * D) / d) / d)) * (((M_m * M_m) * h) / l)) * t_1;
            	tmp = 0.0;
            	if (t_0 <= -2e-70)
            		tmp = t_2;
            	elseif (t_0 <= 5e+256)
            		tmp = sqrt((d / l)) * sqrt((d / h));
            	elseif (t_0 <= Inf)
            		tmp = t_1 * 1.0;
            	else
            		tmp = t_2;
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D_] := 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), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-70], t$95$2, If[LessEqual[t$95$0, 5e+256], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$1 * 1.0), $MachinePrecision], t$95$2]]]]]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
            \\
            \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
            t_1 := \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
            t_2 := \left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell}\right) \cdot t\_1\\
            \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-70}:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\
            \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
            
            \mathbf{elif}\;t\_0 \leq \infty:\\
            \;\;\;\;t\_1 \cdot 1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \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)))) < -1.99999999999999999e-70 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 58.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. 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.f6425.4

                  \[\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 rewrites25.4%

                \[\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. Applied rewrites64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(\frac{-1}{8} \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \frac{\color{blue}{\left(M \cdot M\right)} \cdot h}{\ell}\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                14. lower-*.f6450.5

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

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

              if -1.99999999999999999e-70 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

              1. Initial program 90.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. 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.f6447.1

                  \[\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 rewrites47.1%

                \[\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. Applied rewrites88.6%

                \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
              6. 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}} \]
              7. 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. *-commutativeN/A

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

                  \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                5. associate-*l*N/A

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

                  \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                7. *-rgt-identityN/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-/.f6489.7

                  \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
              8. Applied rewrites89.7%

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

              if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
              4. Step-by-step derivation
                1. Applied rewrites30.6%

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

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

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

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

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

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

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                  8. pow-prod-downN/A

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

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

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

                    \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                  12. frac-timesN/A

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

                    \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                  14. rem-sqrt-square-revN/A

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

                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                  16. lower-fabs.f64N/A

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

                    \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                  18. lower-*.f6493.8

                    \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                3. Applied rewrites93.8%

                  \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
              5. Recombined 3 regimes into one program.
              6. Final simplification70.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^{-70}:\\ \;\;\;\;\left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
              7. Add Preprocessing

              Alternative 7: 64.3% accurate, 0.2× speedup?

              \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ t_2 := \left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{h}{d \cdot d} \cdot \frac{M\_m \cdot M\_m}{\ell}\right)\right) \cdot t\_1\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+69}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;t\_1 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
              M_m = (fabs.f64 M)
              NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
              (FPCore (d h l M_m D)
               :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) (* 2.0 d)) 2.0)) (/ h l)))))
                      (t_1 (/ (fabs d) (sqrt (* h l))))
                      (t_2
                       (* (* (* (* D D) -0.125) (* (/ h (* d d)) (/ (* M_m M_m) l))) t_1)))
                 (if (<= t_0 -5e+69)
                   t_2
                   (if (<= t_0 5e+256)
                     (* (sqrt (/ d l)) (sqrt (/ d h)))
                     (if (<= t_0 INFINITY) (* t_1 1.0) t_2)))))
              M_m = fabs(M);
              assert(d < h && h < l && l < M_m && M_m < D);
              double code(double d, double h, double l, double M_m, double D) {
              	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) / (2.0 * d)), 2.0)) * (h / l)));
              	double t_1 = fabs(d) / sqrt((h * l));
              	double t_2 = (((D * D) * -0.125) * ((h / (d * d)) * ((M_m * M_m) / l))) * t_1;
              	double tmp;
              	if (t_0 <= -5e+69) {
              		tmp = t_2;
              	} else if (t_0 <= 5e+256) {
              		tmp = sqrt((d / l)) * sqrt((d / h));
              	} else if (t_0 <= ((double) INFINITY)) {
              		tmp = t_1 * 1.0;
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              M_m = Math.abs(M);
              assert d < h && h < l && l < M_m && M_m < D;
              public static double code(double d, double h, double l, double M_m, double D) {
              	double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)));
              	double t_1 = Math.abs(d) / Math.sqrt((h * l));
              	double t_2 = (((D * D) * -0.125) * ((h / (d * d)) * ((M_m * M_m) / l))) * t_1;
              	double tmp;
              	if (t_0 <= -5e+69) {
              		tmp = t_2;
              	} else if (t_0 <= 5e+256) {
              		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
              	} else if (t_0 <= Double.POSITIVE_INFINITY) {
              		tmp = t_1 * 1.0;
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              M_m = math.fabs(M)
              [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
              def code(d, h, l, M_m, D):
              	t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))
              	t_1 = math.fabs(d) / math.sqrt((h * l))
              	t_2 = (((D * D) * -0.125) * ((h / (d * d)) * ((M_m * M_m) / l))) * t_1
              	tmp = 0
              	if t_0 <= -5e+69:
              		tmp = t_2
              	elif t_0 <= 5e+256:
              		tmp = math.sqrt((d / l)) * math.sqrt((d / h))
              	elif t_0 <= math.inf:
              		tmp = t_1 * 1.0
              	else:
              		tmp = t_2
              	return tmp
              
              M_m = abs(M)
              d, h, l, M_m, D = sort([d, h, l, M_m, D])
              function code(d, h, l, M_m, D)
              	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
              	t_1 = Float64(abs(d) / sqrt(Float64(h * l)))
              	t_2 = Float64(Float64(Float64(Float64(D * D) * -0.125) * Float64(Float64(h / Float64(d * d)) * Float64(Float64(M_m * M_m) / l))) * t_1)
              	tmp = 0.0
              	if (t_0 <= -5e+69)
              		tmp = t_2;
              	elseif (t_0 <= 5e+256)
              		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
              	elseif (t_0 <= Inf)
              		tmp = Float64(t_1 * 1.0);
              	else
              		tmp = t_2;
              	end
              	return tmp
              end
              
              M_m = abs(M);
              d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
              function tmp_2 = code(d, h, l, M_m, D)
              	t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
              	t_1 = abs(d) / sqrt((h * l));
              	t_2 = (((D * D) * -0.125) * ((h / (d * d)) * ((M_m * M_m) / l))) * t_1;
              	tmp = 0.0;
              	if (t_0 <= -5e+69)
              		tmp = t_2;
              	elseif (t_0 <= 5e+256)
              		tmp = sqrt((d / l)) * sqrt((d / h));
              	elseif (t_0 <= Inf)
              		tmp = t_1 * 1.0;
              	else
              		tmp = t_2;
              	end
              	tmp_2 = tmp;
              end
              
              M_m = N[Abs[M], $MachinePrecision]
              NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
              code[d_, h_, l_, M$95$m_, D_] := 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), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+69], t$95$2, If[LessEqual[t$95$0, 5e+256], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$1 * 1.0), $MachinePrecision], t$95$2]]]]]]
              
              \begin{array}{l}
              M_m = \left|M\right|
              \\
              [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
              \\
              \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
              t_1 := \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
              t_2 := \left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{h}{d \cdot d} \cdot \frac{M\_m \cdot M\_m}{\ell}\right)\right) \cdot t\_1\\
              \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+69}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\
              \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
              
              \mathbf{elif}\;t\_0 \leq \infty:\\
              \;\;\;\;t\_1 \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_2\\
              
              
              \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)))) < -5.00000000000000036e69 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.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. 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.f6423.8

                    \[\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 rewrites23.8%

                  \[\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. Applied rewrites65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -5.00000000000000036e69 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                1. Initial program 91.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.f6447.2

                    \[\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 rewrites47.2%

                  \[\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. Applied rewrites89.4%

                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                6. 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}} \]
                7. 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. *-commutativeN/A

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

                    \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                  5. associate-*l*N/A

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

                    \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                  7. *-rgt-identityN/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-/.f6482.9

                    \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                8. Applied rewrites82.9%

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

                if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                4. Step-by-step derivation
                  1. Applied rewrites30.6%

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

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

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

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

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

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

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

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                    8. pow-prod-downN/A

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

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

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

                      \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                    12. frac-timesN/A

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

                      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                    14. rem-sqrt-square-revN/A

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

                      \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                    16. lower-fabs.f64N/A

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

                      \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                    18. lower-*.f6493.8

                      \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                  3. Applied rewrites93.8%

                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                5. Recombined 3 regimes into one program.
                6. Final simplification66.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{+69}:\\ \;\;\;\;\left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{h}{d \cdot d} \cdot \frac{M \cdot M}{\ell}\right)\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{h}{d \cdot d} \cdot \frac{M \cdot M}{\ell}\right)\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                7. Add Preprocessing

                Alternative 8: 57.1% accurate, 0.2× speedup?

                \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right)\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                M_m = (fabs.f64 M)
                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                (FPCore (d h l M_m D)
                 :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) (* 2.0 d)) 2.0)) (/ h l)))))
                        (t_1
                         (*
                          (* (* M_m M_m) (* (/ (* D D) d) -0.125))
                          (/ (sqrt (/ h l)) (fabs l)))))
                   (if (<= t_0 -2e-70)
                     t_1
                     (if (<= t_0 5e+256)
                       (* (sqrt (/ d l)) (sqrt (/ d h)))
                       (if (<= t_0 INFINITY) (* (/ (fabs d) (sqrt (* h l))) 1.0) t_1)))))
                M_m = fabs(M);
                assert(d < h && h < l && l < M_m && M_m < D);
                double code(double d, double h, double l, double M_m, double D) {
                	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) / (2.0 * d)), 2.0)) * (h / l)));
                	double t_1 = ((M_m * M_m) * (((D * D) / d) * -0.125)) * (sqrt((h / l)) / fabs(l));
                	double tmp;
                	if (t_0 <= -2e-70) {
                		tmp = t_1;
                	} else if (t_0 <= 5e+256) {
                		tmp = sqrt((d / l)) * sqrt((d / h));
                	} else if (t_0 <= ((double) INFINITY)) {
                		tmp = (fabs(d) / sqrt((h * l))) * 1.0;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                M_m = Math.abs(M);
                assert d < h && h < l && l < M_m && M_m < D;
                public static double code(double d, double h, double l, double M_m, double D) {
                	double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)));
                	double t_1 = ((M_m * M_m) * (((D * D) / d) * -0.125)) * (Math.sqrt((h / l)) / Math.abs(l));
                	double tmp;
                	if (t_0 <= -2e-70) {
                		tmp = t_1;
                	} else if (t_0 <= 5e+256) {
                		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
                	} else if (t_0 <= Double.POSITIVE_INFINITY) {
                		tmp = (Math.abs(d) / Math.sqrt((h * l))) * 1.0;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                M_m = math.fabs(M)
                [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                def code(d, h, l, M_m, D):
                	t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))
                	t_1 = ((M_m * M_m) * (((D * D) / d) * -0.125)) * (math.sqrt((h / l)) / math.fabs(l))
                	tmp = 0
                	if t_0 <= -2e-70:
                		tmp = t_1
                	elif t_0 <= 5e+256:
                		tmp = math.sqrt((d / l)) * math.sqrt((d / h))
                	elif t_0 <= math.inf:
                		tmp = (math.fabs(d) / math.sqrt((h * l))) * 1.0
                	else:
                		tmp = t_1
                	return tmp
                
                M_m = abs(M)
                d, h, l, M_m, D = sort([d, h, l, M_m, D])
                function code(d, h, l, M_m, D)
                	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                	t_1 = Float64(Float64(Float64(M_m * M_m) * Float64(Float64(Float64(D * D) / d) * -0.125)) * Float64(sqrt(Float64(h / l)) / abs(l)))
                	tmp = 0.0
                	if (t_0 <= -2e-70)
                		tmp = t_1;
                	elseif (t_0 <= 5e+256)
                		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
                	elseif (t_0 <= Inf)
                		tmp = Float64(Float64(abs(d) / sqrt(Float64(h * l))) * 1.0);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                M_m = abs(M);
                d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                function tmp_2 = code(d, h, l, M_m, D)
                	t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
                	t_1 = ((M_m * M_m) * (((D * D) / d) * -0.125)) * (sqrt((h / l)) / abs(l));
                	tmp = 0.0;
                	if (t_0 <= -2e-70)
                		tmp = t_1;
                	elseif (t_0 <= 5e+256)
                		tmp = sqrt((d / l)) * sqrt((d / h));
                	elseif (t_0 <= Inf)
                		tmp = (abs(d) / sqrt((h * l))) * 1.0;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                M_m = N[Abs[M], $MachinePrecision]
                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                code[d_, h_, l_, M$95$m_, D_] := 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), $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[(M$95$m * M$95$m), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-70], t$95$1, If[LessEqual[t$95$0, 5e+256], 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[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], t$95$1]]]]]
                
                \begin{array}{l}
                M_m = \left|M\right|
                \\
                [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                \\
                \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                t_1 := \left(\left(M\_m \cdot M\_m\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right)\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\
                \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-70}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\
                \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                
                \mathbf{elif}\;t\_0 \leq \infty:\\
                \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\
                
                \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)))) < -1.99999999999999999e-70 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 58.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                  4. Step-by-step derivation
                    1. Applied rewrites3.6%

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                    2. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.99999999999999999e-70 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                      1. Initial program 90.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. 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.f6447.1

                          \[\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 rewrites47.1%

                        \[\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. Applied rewrites88.6%

                        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                      6. 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}} \]
                      7. 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. *-commutativeN/A

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

                          \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                        5. associate-*l*N/A

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

                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                        7. *-rgt-identityN/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-/.f6489.7

                          \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                      8. Applied rewrites89.7%

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

                      if 5.00000000000000015e256 < (*.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 30.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                      4. Step-by-step derivation
                        1. Applied rewrites30.6%

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

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

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

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

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

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

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

                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                          8. pow-prod-downN/A

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

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

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

                            \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                          12. frac-timesN/A

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

                            \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                          14. rem-sqrt-square-revN/A

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

                            \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                          16. lower-fabs.f64N/A

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

                            \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                          18. lower-*.f6493.8

                            \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                        3. Applied rewrites93.8%

                          \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                      5. Recombined 3 regimes into one program.
                      6. Final simplification64.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2 \cdot 10^{-70}:\\ \;\;\;\;\left(\left(M \cdot M\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right)\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\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 5 \cdot 10^{+256}:\\ \;\;\;\;\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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(\left(M \cdot M\right) \cdot \left(\frac{D \cdot D}{d} \cdot -0.125\right)\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 9: 50.2% accurate, 0.2× speedup?

                      \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+23}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-168} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+123}\right):\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \end{array} \]
                      M_m = (fabs.f64 M)
                      NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                      (FPCore (d h l M_m D)
                       :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) (* 2.0 d)) 2.0)) (/ h l))))))
                         (if (<= t_0 -1e+23)
                           (* (- d) (sqrt (pow (* l h) -1.0)))
                           (if (or (<= t_0 2e-168) (not (<= t_0 2e+123)))
                             (* (/ (fabs d) (sqrt (* h l))) 1.0)
                             (sqrt (* (/ d h) (/ d l)))))))
                      M_m = fabs(M);
                      assert(d < h && h < l && l < M_m && M_m < D);
                      double code(double d, double h, double l, double M_m, double D) {
                      	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) / (2.0 * d)), 2.0)) * (h / l)));
                      	double tmp;
                      	if (t_0 <= -1e+23) {
                      		tmp = -d * sqrt(pow((l * h), -1.0));
                      	} else if ((t_0 <= 2e-168) || !(t_0 <= 2e+123)) {
                      		tmp = (fabs(d) / sqrt((h * l))) * 1.0;
                      	} else {
                      		tmp = sqrt(((d / h) * (d / l)));
                      	}
                      	return tmp;
                      }
                      
                      M_m =     private
                      NOTE: d, h, l, M_m, and D 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_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_m
                          real(8), intent (in) :: d_1
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                          if (t_0 <= (-1d+23)) then
                              tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                          else if ((t_0 <= 2d-168) .or. (.not. (t_0 <= 2d+123))) then
                              tmp = (abs(d) / sqrt((h * l))) * 1.0d0
                          else
                              tmp = sqrt(((d / h) * (d / l)))
                          end if
                          code = tmp
                      end function
                      
                      M_m = Math.abs(M);
                      assert d < h && h < l && l < M_m && M_m < D;
                      public static double code(double d, double h, double l, double M_m, double D) {
                      	double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)));
                      	double tmp;
                      	if (t_0 <= -1e+23) {
                      		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                      	} else if ((t_0 <= 2e-168) || !(t_0 <= 2e+123)) {
                      		tmp = (Math.abs(d) / Math.sqrt((h * l))) * 1.0;
                      	} else {
                      		tmp = Math.sqrt(((d / h) * (d / l)));
                      	}
                      	return tmp;
                      }
                      
                      M_m = math.fabs(M)
                      [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                      def code(d, h, l, M_m, D):
                      	t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))
                      	tmp = 0
                      	if t_0 <= -1e+23:
                      		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                      	elif (t_0 <= 2e-168) or not (t_0 <= 2e+123):
                      		tmp = (math.fabs(d) / math.sqrt((h * l))) * 1.0
                      	else:
                      		tmp = math.sqrt(((d / h) * (d / l)))
                      	return tmp
                      
                      M_m = abs(M)
                      d, h, l, M_m, D = sort([d, h, l, M_m, D])
                      function code(d, h, l, M_m, D)
                      	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                      	tmp = 0.0
                      	if (t_0 <= -1e+23)
                      		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                      	elseif ((t_0 <= 2e-168) || !(t_0 <= 2e+123))
                      		tmp = Float64(Float64(abs(d) / sqrt(Float64(h * l))) * 1.0);
                      	else
                      		tmp = sqrt(Float64(Float64(d / h) * Float64(d / l)));
                      	end
                      	return tmp
                      end
                      
                      M_m = abs(M);
                      d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                      function tmp_2 = code(d, h, l, M_m, D)
                      	t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
                      	tmp = 0.0;
                      	if (t_0 <= -1e+23)
                      		tmp = -d * sqrt(((l * h) ^ -1.0));
                      	elseif ((t_0 <= 2e-168) || ~((t_0 <= 2e+123)))
                      		tmp = (abs(d) / sqrt((h * l))) * 1.0;
                      	else
                      		tmp = sqrt(((d / h) * (d / l)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      M_m = N[Abs[M], $MachinePrecision]
                      NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                      code[d_, h_, l_, M$95$m_, D_] := 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), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+23], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$0, 2e-168], N[Not[LessEqual[t$95$0, 2e+123]], $MachinePrecision]], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      M_m = \left|M\right|
                      \\
                      [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                      \\
                      \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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                      \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+23}:\\
                      \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                      
                      \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-168} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+123}\right):\\
                      \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.9999999999999992e22

                        1. Initial program 91.4%

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                        4. Step-by-step derivation
                          1. Applied rewrites1.9%

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

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

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

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

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

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

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

                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                            12. lower-*.f6415.8

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

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

                          if -9.9999999999999992e22 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.0000000000000001e-168 or 1.99999999999999996e123 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

                          1. Initial program 35.2%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                              8. pow-prod-downN/A

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

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

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

                                \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                              12. frac-timesN/A

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

                                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                              14. rem-sqrt-square-revN/A

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

                                \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                              16. lower-fabs.f64N/A

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

                                \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                              18. lower-*.f6452.8

                                \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                            3. Applied rewrites52.8%

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

                            if 2.0000000000000001e-168 < (*.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.99999999999999996e123

                            1. Initial program 98.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                            4. Step-by-step derivation
                              1. Applied rewrites98.3%

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

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

                                  \[\leadsto \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-*.f6439.2

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

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

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

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{+23}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \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^{-168} \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 2 \cdot 10^{+123}\right):\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \end{array} \]
                                5. Add Preprocessing

                                Alternative 10: 80.7% accurate, 0.3× speedup?

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

                                  1. Initial program 85.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. 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.f6436.1

                                      \[\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 rewrites36.1%

                                    \[\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. Applied rewrites82.8%

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

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

                                  if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                  1. Initial program 97.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. 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.f6450.3

                                      \[\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 rewrites50.3%

                                    \[\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. Applied rewrites96.2%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                  6. 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}} \]
                                  7. 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. *-commutativeN/A

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

                                      \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    7. *-rgt-identityN/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-/.f6497.5

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

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

                                  if 5.00000000000000015e256 < (*.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 12.2%

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

                                      \[\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 rewrites12.1%

                                    \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 11: 77.7% accurate, 0.3× speedup?

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

                                  1. Initial program 85.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. 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.f6436.1

                                      \[\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 rewrites36.1%

                                    \[\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. Applied rewrites82.8%

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

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

                                  if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                  1. Initial program 97.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. 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.f6450.3

                                      \[\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 rewrites50.3%

                                    \[\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. Applied rewrites96.2%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                  6. 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}} \]
                                  7. 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. *-commutativeN/A

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

                                      \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    7. *-rgt-identityN/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-/.f6497.5

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

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

                                  if 5.00000000000000015e256 < (*.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 12.2%

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

                                      \[\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 rewrites12.1%

                                    \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 12: 77.5% accurate, 0.3× speedup?

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

                                  1. Initial program 85.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. 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.f6436.1

                                      \[\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 rewrites36.1%

                                    \[\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. Applied rewrites82.8%

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

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

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

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

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

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

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

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

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

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

                                  if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                  1. Initial program 97.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. 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.f6450.3

                                      \[\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 rewrites50.3%

                                    \[\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. Applied rewrites96.2%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                  6. 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}} \]
                                  7. 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. *-commutativeN/A

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

                                      \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    7. *-rgt-identityN/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-/.f6497.5

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

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

                                  if 5.00000000000000015e256 < (*.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 12.2%

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

                                      \[\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 rewrites12.1%

                                    \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 13: 77.4% accurate, 0.3× speedup?

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

                                  1. Initial program 85.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. 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.f6436.1

                                      \[\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 rewrites36.1%

                                    \[\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. Applied rewrites82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                  1. Initial program 97.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. 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.f6450.3

                                      \[\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 rewrites50.3%

                                    \[\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. Applied rewrites96.2%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                  6. 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}} \]
                                  7. 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. *-commutativeN/A

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

                                      \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    7. *-rgt-identityN/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-/.f6497.5

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

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

                                  if 5.00000000000000015e256 < (*.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 12.2%

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

                                      \[\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 rewrites12.1%

                                    \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{D}{2} \cdot 0.5, \color{blue}{\left(-0.5 \cdot \frac{D}{d \cdot d}\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                                3. Recombined 3 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 0:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \frac{\left(\frac{D}{d} \cdot M\right) \cdot \left(D \cdot M\right)}{2 \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{D}{2} \cdot 0.5, \left(-0.5 \cdot \frac{D}{d \cdot d}\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                5. Add Preprocessing

                                Alternative 14: 52.7% accurate, 0.3× speedup?

                                \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ 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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-206}:\\ \;\;\;\;\left(-t\_0\right) \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+256}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \end{array} \end{array} \]
                                M_m = (fabs.f64 M)
                                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                (FPCore (d h l M_m D)
                                 :precision binary64
                                 (let* ((t_0 (sqrt (/ d l)))
                                        (t_1 (sqrt (/ d h)))
                                        (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) (* 2.0 d)) 2.0)) (/ h l))))))
                                   (if (<= t_2 -1e-206)
                                     (* (- t_0) t_1)
                                     (if (<= t_2 5e+256) (* t_0 t_1) (* (/ (fabs d) (sqrt (* h l))) 1.0)))))
                                M_m = fabs(M);
                                assert(d < h && h < l && l < M_m && M_m < D);
                                double code(double d, double h, double l, double M_m, double D) {
                                	double t_0 = sqrt((d / l));
                                	double t_1 = sqrt((d / h));
                                	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) / (2.0 * d)), 2.0)) * (h / l)));
                                	double tmp;
                                	if (t_2 <= -1e-206) {
                                		tmp = -t_0 * t_1;
                                	} else if (t_2 <= 5e+256) {
                                		tmp = t_0 * t_1;
                                	} else {
                                		tmp = (fabs(d) / sqrt((h * l))) * 1.0;
                                	}
                                	return tmp;
                                }
                                
                                M_m =     private
                                NOTE: d, h, l, M_m, and D 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_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_m
                                    real(8), intent (in) :: d_1
                                    real(8) :: t_0
                                    real(8) :: t_1
                                    real(8) :: t_2
                                    real(8) :: tmp
                                    t_0 = sqrt((d / l))
                                    t_1 = sqrt((d / h))
                                    t_2 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                                    if (t_2 <= (-1d-206)) then
                                        tmp = -t_0 * t_1
                                    else if (t_2 <= 5d+256) then
                                        tmp = t_0 * t_1
                                    else
                                        tmp = (abs(d) / sqrt((h * l))) * 1.0d0
                                    end if
                                    code = tmp
                                end function
                                
                                M_m = Math.abs(M);
                                assert d < h && h < l && l < M_m && M_m < D;
                                public static double code(double d, double h, double l, double M_m, double D) {
                                	double t_0 = Math.sqrt((d / l));
                                	double t_1 = Math.sqrt((d / h));
                                	double t_2 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)));
                                	double tmp;
                                	if (t_2 <= -1e-206) {
                                		tmp = -t_0 * t_1;
                                	} else if (t_2 <= 5e+256) {
                                		tmp = t_0 * t_1;
                                	} else {
                                		tmp = (Math.abs(d) / Math.sqrt((h * l))) * 1.0;
                                	}
                                	return tmp;
                                }
                                
                                M_m = math.fabs(M)
                                [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                def code(d, h, l, M_m, D):
                                	t_0 = math.sqrt((d / l))
                                	t_1 = math.sqrt((d / h))
                                	t_2 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))
                                	tmp = 0
                                	if t_2 <= -1e-206:
                                		tmp = -t_0 * t_1
                                	elif t_2 <= 5e+256:
                                		tmp = t_0 * t_1
                                	else:
                                		tmp = (math.fabs(d) / math.sqrt((h * l))) * 1.0
                                	return tmp
                                
                                M_m = abs(M)
                                d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                function code(d, h, l, M_m, D)
                                	t_0 = sqrt(Float64(d / l))
                                	t_1 = sqrt(Float64(d / h))
                                	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                                	tmp = 0.0
                                	if (t_2 <= -1e-206)
                                		tmp = Float64(Float64(-t_0) * t_1);
                                	elseif (t_2 <= 5e+256)
                                		tmp = Float64(t_0 * t_1);
                                	else
                                		tmp = Float64(Float64(abs(d) / sqrt(Float64(h * l))) * 1.0);
                                	end
                                	return tmp
                                end
                                
                                M_m = abs(M);
                                d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                function tmp_2 = code(d, h, l, M_m, D)
                                	t_0 = sqrt((d / l));
                                	t_1 = sqrt((d / h));
                                	t_2 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
                                	tmp = 0.0;
                                	if (t_2 <= -1e-206)
                                		tmp = -t_0 * t_1;
                                	elseif (t_2 <= 5e+256)
                                		tmp = t_0 * t_1;
                                	else
                                		tmp = (abs(d) / sqrt((h * l))) * 1.0;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                M_m = N[Abs[M], $MachinePrecision]
                                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $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), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-206], N[((-t$95$0) * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+256], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
                                
                                \begin{array}{l}
                                M_m = \left|M\right|
                                \\
                                [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                \\
                                \begin{array}{l}
                                t_0 := \sqrt{\frac{d}{\ell}}\\
                                t_1 := \sqrt{\frac{d}{h}}\\
                                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}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                                \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-206}:\\
                                \;\;\;\;\left(-t\_0\right) \cdot t\_1\\
                                
                                \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+256}:\\
                                \;\;\;\;t\_0 \cdot t\_1\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 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)))) < -1.00000000000000003e-206

                                  1. Initial program 91.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. 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.f6436.9

                                      \[\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 rewrites36.9%

                                    \[\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. Applied rewrites92.9%

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-\color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    9. lower-/.f6416.5

                                      \[\leadsto \left(-\sqrt{\color{blue}{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                  8. Applied rewrites16.5%

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

                                  if -1.00000000000000003e-206 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                  1. Initial program 90.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. 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.f6447.6

                                      \[\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 rewrites47.6%

                                    \[\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. Applied rewrites88.5%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                  6. 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}} \]
                                  7. 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. *-commutativeN/A

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

                                      \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                    7. *-rgt-identityN/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-/.f6490.6

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

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

                                  if 5.00000000000000015e256 < (*.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 12.2%

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                                      8. pow-prod-downN/A

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

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

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

                                        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                                      12. frac-timesN/A

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

                                        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                      14. rem-sqrt-square-revN/A

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

                                        \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                      16. lower-fabs.f64N/A

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

                                        \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                      18. lower-*.f6448.2

                                        \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                                    3. Applied rewrites48.2%

                                      \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                                  5. Recombined 3 regimes into one program.
                                  6. Final simplification53.4%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-206}:\\ \;\;\;\;\left(-\sqrt{\frac{d}{\ell}}\right) \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 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 15: 51.0% accurate, 0.3× speedup?

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

                                    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                        12. lower-*.f6420.5

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

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

                                      if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000015e256

                                      1. Initial program 97.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. 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.f6450.3

                                          \[\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 rewrites50.3%

                                        \[\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. Applied rewrites96.2%

                                        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(M \cdot \frac{\frac{D}{d}}{2}\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                      6. 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}} \]
                                      7. 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. *-commutativeN/A

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

                                          \[\leadsto \left(\left(\sqrt{\frac{d}{\ell}} \cdot -1\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(\sqrt{\frac{d}{\ell}} \cdot -1\right) \cdot \color{blue}{-1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                        5. associate-*l*N/A

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

                                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \cdot \sqrt{\frac{d}{h}} \]
                                        7. *-rgt-identityN/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-/.f6497.5

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

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

                                      if 5.00000000000000015e256 < (*.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 12.2%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                                          8. pow-prod-downN/A

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

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

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

                                            \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                                          12. frac-timesN/A

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

                                            \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                          14. rem-sqrt-square-revN/A

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

                                            \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                          16. lower-fabs.f64N/A

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

                                            \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                          18. lower-*.f6448.2

                                            \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                                        3. Applied rewrites48.2%

                                          \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                                      5. Recombined 3 regimes into one program.
                                      6. Final simplification53.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 0:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \end{array} \]
                                      7. Add Preprocessing

                                      Alternative 16: 45.5% accurate, 0.5× speedup?

                                      \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{+23}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \end{array} \end{array} \]
                                      M_m = (fabs.f64 M)
                                      NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                      (FPCore (d h l M_m D)
                                       :precision binary64
                                       (if (<=
                                            (*
                                             (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                             (-
                                              1.0
                                              (* (* (pow 2.0 -1.0) (pow (/ (* M_m D) (* 2.0 d)) 2.0)) (/ h l))))
                                            -1e+23)
                                         (* (- d) (sqrt (pow (* l h) -1.0)))
                                         (* (/ (fabs d) (sqrt (* h l))) 1.0)))
                                      M_m = fabs(M);
                                      assert(d < h && h < l && l < M_m && M_m < D);
                                      double code(double d, double h, double l, double M_m, double D) {
                                      	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) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e+23) {
                                      		tmp = -d * sqrt(pow((l * h), -1.0));
                                      	} else {
                                      		tmp = (fabs(d) / sqrt((h * l))) * 1.0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      M_m =     private
                                      NOTE: d, h, l, M_m, and D 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_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_m
                                          real(8), intent (in) :: d_1
                                          real(8) :: tmp
                                          if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-1d+23)) then
                                              tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                          else
                                              tmp = (abs(d) / sqrt((h * l))) * 1.0d0
                                          end if
                                          code = tmp
                                      end function
                                      
                                      M_m = Math.abs(M);
                                      assert d < h && h < l && l < M_m && M_m < D;
                                      public static double code(double d, double h, double l, double M_m, double D) {
                                      	double tmp;
                                      	if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e+23) {
                                      		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                      	} else {
                                      		tmp = (Math.abs(d) / Math.sqrt((h * l))) * 1.0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      M_m = math.fabs(M)
                                      [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                      def code(d, h, l, M_m, D):
                                      	tmp = 0
                                      	if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e+23:
                                      		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                      	else:
                                      		tmp = (math.fabs(d) / math.sqrt((h * l))) * 1.0
                                      	return tmp
                                      
                                      M_m = abs(M)
                                      d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                      function code(d, h, l, M_m, D)
                                      	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) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -1e+23)
                                      		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                      	else
                                      		tmp = Float64(Float64(abs(d) / sqrt(Float64(h * l))) * 1.0);
                                      	end
                                      	return tmp
                                      end
                                      
                                      M_m = abs(M);
                                      d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                      function tmp_2 = code(d, h, l, M_m, D)
                                      	tmp = 0.0;
                                      	if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -1e+23)
                                      		tmp = -d * sqrt(((l * h) ^ -1.0));
                                      	else
                                      		tmp = (abs(d) / sqrt((h * l))) * 1.0;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      M_m = N[Abs[M], $MachinePrecision]
                                      NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                      code[d_, h_, l_, M$95$m_, D_] := 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), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+23], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      M_m = \left|M\right|
                                      \\
                                      [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{+23}:\\
                                      \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.9999999999999992e22

                                        1. Initial program 91.4%

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

                                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites1.9%

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

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

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

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

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

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

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

                                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                            12. lower-*.f6415.8

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

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

                                          if -9.9999999999999992e22 < (*.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 56.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites55.6%

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

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

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

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

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

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

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

                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\frac{1}{2}} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}}\right) \cdot 1 \]
                                              8. pow-prod-downN/A

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

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

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

                                                \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot 1 \]
                                              12. frac-timesN/A

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

                                                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                              14. rem-sqrt-square-revN/A

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

                                                \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                              16. lower-fabs.f64N/A

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

                                                \[\leadsto \frac{\left|d\right|}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot 1 \]
                                              18. lower-*.f6462.2

                                                \[\leadsto \frac{\left|d\right|}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot 1 \]
                                            3. Applied rewrites62.2%

                                              \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                                          5. Recombined 2 regimes into one program.
                                          6. Final simplification47.7%

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

                                          Alternative 17: 81.0% accurate, 0.5× speedup?

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

                                            1. Initial program 91.2%

                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                            2. Add Preprocessing
                                            3. Step-by-step derivation
                                              1. lift-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.f6442.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 rewrites42.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. Applied rewrites90.6%

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

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

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

                                              if 5.00000000000000015e256 < (*.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 12.2%

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

                                                  \[\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 rewrites12.1%

                                                \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 18: 81.0% accurate, 0.5× speedup?

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

                                              1. Initial program 91.2%

                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                              2. Add Preprocessing
                                              3. Step-by-step derivation
                                                1. lift-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.f6442.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 rewrites42.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. Applied rewrites90.6%

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

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

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

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

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

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

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

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

                                              if 5.00000000000000015e256 < (*.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 12.2%

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

                                                  \[\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 rewrites12.1%

                                                \[\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. Applied rewrites54.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 19: 44.9% accurate, 3.0× speedup?

                                            \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 8.5 \cdot 10^{-186}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \end{array} \]
                                            M_m = (fabs.f64 M)
                                            NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                            (FPCore (d h l M_m D)
                                             :precision binary64
                                             (if (<= l 8.5e-186)
                                               (* (- d) (sqrt (pow (* l h) -1.0)))
                                               (* (pow (* (sqrt l) (sqrt h)) -1.0) d)))
                                            M_m = fabs(M);
                                            assert(d < h && h < l && l < M_m && M_m < D);
                                            double code(double d, double h, double l, double M_m, double D) {
                                            	double tmp;
                                            	if (l <= 8.5e-186) {
                                            		tmp = -d * sqrt(pow((l * h), -1.0));
                                            	} else {
                                            		tmp = pow((sqrt(l) * sqrt(h)), -1.0) * d;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            M_m =     private
                                            NOTE: d, h, l, M_m, and D 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_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_m
                                                real(8), intent (in) :: d_1
                                                real(8) :: tmp
                                                if (l <= 8.5d-186) then
                                                    tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                else
                                                    tmp = ((sqrt(l) * sqrt(h)) ** (-1.0d0)) * d
                                                end if
                                                code = tmp
                                            end function
                                            
                                            M_m = Math.abs(M);
                                            assert d < h && h < l && l < M_m && M_m < D;
                                            public static double code(double d, double h, double l, double M_m, double D) {
                                            	double tmp;
                                            	if (l <= 8.5e-186) {
                                            		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                            	} else {
                                            		tmp = Math.pow((Math.sqrt(l) * Math.sqrt(h)), -1.0) * d;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            M_m = math.fabs(M)
                                            [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                            def code(d, h, l, M_m, D):
                                            	tmp = 0
                                            	if l <= 8.5e-186:
                                            		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                            	else:
                                            		tmp = math.pow((math.sqrt(l) * math.sqrt(h)), -1.0) * d
                                            	return tmp
                                            
                                            M_m = abs(M)
                                            d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                            function code(d, h, l, M_m, D)
                                            	tmp = 0.0
                                            	if (l <= 8.5e-186)
                                            		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                            	else
                                            		tmp = Float64((Float64(sqrt(l) * sqrt(h)) ^ -1.0) * d);
                                            	end
                                            	return tmp
                                            end
                                            
                                            M_m = abs(M);
                                            d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                            function tmp_2 = code(d, h, l, M_m, D)
                                            	tmp = 0.0;
                                            	if (l <= 8.5e-186)
                                            		tmp = -d * sqrt(((l * h) ^ -1.0));
                                            	else
                                            		tmp = ((sqrt(l) * sqrt(h)) ^ -1.0) * d;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            M_m = N[Abs[M], $MachinePrecision]
                                            NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                            code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, 8.5e-186], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * d), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            M_m = \left|M\right|
                                            \\
                                            [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;\ell \leq 8.5 \cdot 10^{-186}:\\
                                            \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if l < 8.4999999999999994e-186

                                              1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                  12. lower-*.f6443.2

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

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

                                                if 8.4999999999999994e-186 < l

                                                1. Initial program 61.2%

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

                                                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites40.5%

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

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

                                                      \[\leadsto \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-*.f6446.9

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

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

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

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 8.5 \cdot 10^{-186}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\ell} \cdot \sqrt{h}\right)}^{-1} \cdot d\\ \end{array} \]
                                                    5. Add Preprocessing

                                                    Alternative 20: 41.6% accurate, 3.2× speedup?

                                                    \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{if}\;\ell \leq 1.4 \cdot 10^{-185}:\\ \;\;\;\;\left(-d\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot d\\ \end{array} \end{array} \]
                                                    M_m = (fabs.f64 M)
                                                    NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                    (FPCore (d h l M_m D)
                                                     :precision binary64
                                                     (let* ((t_0 (sqrt (pow (* l h) -1.0))))
                                                       (if (<= l 1.4e-185) (* (- d) t_0) (* t_0 d))))
                                                    M_m = fabs(M);
                                                    assert(d < h && h < l && l < M_m && M_m < D);
                                                    double code(double d, double h, double l, double M_m, double D) {
                                                    	double t_0 = sqrt(pow((l * h), -1.0));
                                                    	double tmp;
                                                    	if (l <= 1.4e-185) {
                                                    		tmp = -d * t_0;
                                                    	} else {
                                                    		tmp = t_0 * d;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    M_m =     private
                                                    NOTE: d, h, l, M_m, and D 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_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_m
                                                        real(8), intent (in) :: d_1
                                                        real(8) :: t_0
                                                        real(8) :: tmp
                                                        t_0 = sqrt(((l * h) ** (-1.0d0)))
                                                        if (l <= 1.4d-185) then
                                                            tmp = -d * t_0
                                                        else
                                                            tmp = t_0 * d
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    M_m = Math.abs(M);
                                                    assert d < h && h < l && l < M_m && M_m < D;
                                                    public static double code(double d, double h, double l, double M_m, double D) {
                                                    	double t_0 = Math.sqrt(Math.pow((l * h), -1.0));
                                                    	double tmp;
                                                    	if (l <= 1.4e-185) {
                                                    		tmp = -d * t_0;
                                                    	} else {
                                                    		tmp = t_0 * d;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    M_m = math.fabs(M)
                                                    [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                                    def code(d, h, l, M_m, D):
                                                    	t_0 = math.sqrt(math.pow((l * h), -1.0))
                                                    	tmp = 0
                                                    	if l <= 1.4e-185:
                                                    		tmp = -d * t_0
                                                    	else:
                                                    		tmp = t_0 * d
                                                    	return tmp
                                                    
                                                    M_m = abs(M)
                                                    d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                                    function code(d, h, l, M_m, D)
                                                    	t_0 = sqrt((Float64(l * h) ^ -1.0))
                                                    	tmp = 0.0
                                                    	if (l <= 1.4e-185)
                                                    		tmp = Float64(Float64(-d) * t_0);
                                                    	else
                                                    		tmp = Float64(t_0 * d);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    M_m = abs(M);
                                                    d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                                    function tmp_2 = code(d, h, l, M_m, D)
                                                    	t_0 = sqrt(((l * h) ^ -1.0));
                                                    	tmp = 0.0;
                                                    	if (l <= 1.4e-185)
                                                    		tmp = -d * t_0;
                                                    	else
                                                    		tmp = t_0 * d;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    M_m = N[Abs[M], $MachinePrecision]
                                                    NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                    code[d_, h_, l_, M$95$m_, D_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 1.4e-185], N[((-d) * t$95$0), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    M_m = \left|M\right|
                                                    \\
                                                    [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                    \mathbf{if}\;\ell \leq 1.4 \cdot 10^{-185}:\\
                                                    \;\;\;\;\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 < 1.39999999999999996e-185

                                                      1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                          12. lower-*.f6443.2

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

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

                                                        if 1.39999999999999996e-185 < l

                                                        1. Initial program 61.2%

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

                                                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites40.5%

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

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

                                                              \[\leadsto \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-*.f6446.9

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

                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                        5. Recombined 2 regimes into one program.
                                                        6. Final simplification44.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 1.4 \cdot 10^{-185}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d\\ \end{array} \]
                                                        7. Add Preprocessing

                                                        Alternative 21: 26.8% accurate, 3.4× speedup?

                                                        \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \end{array} \]
                                                        M_m = (fabs.f64 M)
                                                        NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                        (FPCore (d h l M_m D) :precision binary64 (* (sqrt (pow (* l h) -1.0)) d))
                                                        M_m = fabs(M);
                                                        assert(d < h && h < l && l < M_m && M_m < D);
                                                        double code(double d, double h, double l, double M_m, double D) {
                                                        	return sqrt(pow((l * h), -1.0)) * d;
                                                        }
                                                        
                                                        M_m =     private
                                                        NOTE: d, h, l, M_m, and D 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_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_m
                                                            real(8), intent (in) :: d_1
                                                            code = sqrt(((l * h) ** (-1.0d0))) * d
                                                        end function
                                                        
                                                        M_m = Math.abs(M);
                                                        assert d < h && h < l && l < M_m && M_m < D;
                                                        public static double code(double d, double h, double l, double M_m, double D) {
                                                        	return Math.sqrt(Math.pow((l * h), -1.0)) * d;
                                                        }
                                                        
                                                        M_m = math.fabs(M)
                                                        [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                                        def code(d, h, l, M_m, D):
                                                        	return math.sqrt(math.pow((l * h), -1.0)) * d
                                                        
                                                        M_m = abs(M)
                                                        d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                                        function code(d, h, l, M_m, D)
                                                        	return Float64(sqrt((Float64(l * h) ^ -1.0)) * d)
                                                        end
                                                        
                                                        M_m = abs(M);
                                                        d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                                        function tmp = code(d, h, l, M_m, D)
                                                        	tmp = sqrt(((l * h) ^ -1.0)) * d;
                                                        end
                                                        
                                                        M_m = N[Abs[M], $MachinePrecision]
                                                        NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                        code[d_, h_, l_, M$95$m_, D_] := N[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
                                                        
                                                        \begin{array}{l}
                                                        M_m = \left|M\right|
                                                        \\
                                                        [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                                        \\
                                                        \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Initial program 67.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites38.8%

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

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

                                                              \[\leadsto \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-*.f6425.0

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

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

                                                            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
                                                          6. Add Preprocessing

                                                          Alternative 22: 26.6% accurate, 15.3× speedup?

                                                          \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                          M_m = (fabs.f64 M)
                                                          NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                          (FPCore (d h l M_m D) :precision binary64 (/ d (sqrt (* l h))))
                                                          M_m = fabs(M);
                                                          assert(d < h && h < l && l < M_m && M_m < D);
                                                          double code(double d, double h, double l, double M_m, double D) {
                                                          	return d / sqrt((l * h));
                                                          }
                                                          
                                                          M_m =     private
                                                          NOTE: d, h, l, M_m, and D 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_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_m
                                                              real(8), intent (in) :: d_1
                                                              code = d / sqrt((l * h))
                                                          end function
                                                          
                                                          M_m = Math.abs(M);
                                                          assert d < h && h < l && l < M_m && M_m < D;
                                                          public static double code(double d, double h, double l, double M_m, double D) {
                                                          	return d / Math.sqrt((l * h));
                                                          }
                                                          
                                                          M_m = math.fabs(M)
                                                          [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                                          def code(d, h, l, M_m, D):
                                                          	return d / math.sqrt((l * h))
                                                          
                                                          M_m = abs(M)
                                                          d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                                          function code(d, h, l, M_m, D)
                                                          	return Float64(d / sqrt(Float64(l * h)))
                                                          end
                                                          
                                                          M_m = abs(M);
                                                          d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                                          function tmp = code(d, h, l, M_m, D)
                                                          	tmp = d / sqrt((l * h));
                                                          end
                                                          
                                                          M_m = N[Abs[M], $MachinePrecision]
                                                          NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                          code[d_, h_, l_, M$95$m_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                          
                                                          \begin{array}{l}
                                                          M_m = \left|M\right|
                                                          \\
                                                          [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                                          \\
                                                          \frac{d}{\sqrt{\ell \cdot h}}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Initial program 67.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites38.8%

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

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

                                                                \[\leadsto \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-*.f6425.0

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

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

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

                                                                  \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                2. Add Preprocessing

                                                                Reproduce

                                                                ?
                                                                herbie shell --seed 2024360 
                                                                (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)))))