Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.0% → 77.6%
Time: 14.9s
Alternatives: 16
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)));
}
real(8) function code(d, h, l, m, d_1)
    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 16 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.0% 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)));
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
	return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D):
	return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D)
	return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
end
function tmp = code(d, h, l, M, D)
	tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 77.6% accurate, 0.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(\left(\frac{D\_m}{d} \cdot M\right) \cdot \frac{h}{\ell}\right) \cdot \left(0.5 \cdot D\_m\right)}{4} \cdot \frac{M}{d}\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)))) < 2.00000000000000009e245

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000009e245 < (*.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 32.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.f6418.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 rewrites18.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 rewrites68.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. Step-by-step derivation
      1. lift-*.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 69.7% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+245}:\\
\;\;\;\;\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 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.00000000000000002e306 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 52.1%

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. 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.f6426.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 rewrites26.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 rewrites66.3%

      \[\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. 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. *-commutativeN/A

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

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

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

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

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

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

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

    if -1.00000000000000002e306 < (*.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 68.4%

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. 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.f6437.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 rewrites37.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 rewrites75.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. 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-*.f6446.8

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

      \[\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)))) < 2.00000000000000009e245

    1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

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

          if 2.00000000000000009e245 < (*.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 64.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 rewrites64.6%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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-*.f6497.5

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

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

            \[\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^{+306}:\\ \;\;\;\;\left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \left(h \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 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 2 \cdot 10^{+245}:\\ \;\;\;\;\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 \left(h \cdot \frac{M \cdot M}{\ell}\right)\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
          7. Add Preprocessing

          Alternative 3: 69.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

            if -1e13 < (*.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 2.00000000000000009e245 < (*.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 58.7%

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

              \[\leadsto \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 rewrites53.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. 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-*.f6489.1

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

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

              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)))) < 2.00000000000000009e245

              1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

                      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification74.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 -10000000000000:\\ \;\;\;\;\left(\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}\right) \cdot \left(h \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 0:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 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^{+245}:\\ \;\;\;\;\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 \left(h \cdot \frac{M \cdot M}{\ell}\right)\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 4: 67.7% accurate, 0.2× speedup?

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

                    1. Initial program 83.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.f6442.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 rewrites42.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 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 \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. 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. *-commutativeN/A

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

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

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

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

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

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

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

                    if -1.00000000000000002e306 < (*.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 68.4%

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

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

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

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                      5. 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.f6437.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 rewrites37.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 rewrites75.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. 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-*.f6446.8

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

                      \[\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.00000000000000028e257

                    1. Initial program 99.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 rewrites99.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-*.f6435.8

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

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

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

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

                          if 5.00000000000000028e257 < (*.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 31.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.f6418.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 rewrites18.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 rewrites67.6%

                            \[\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. lift-*.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}} \]
                            3. lift-/.f64N/A

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\color{blue}{\frac{\mathsf{neg}\left(M \cdot D\right)}{\mathsf{neg}\left(2 \cdot d\right)}} \cdot \frac{M \cdot D}{2 \cdot d}\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{\mathsf{neg}\left(M \cdot D\right)}{\mathsf{neg}\left(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}} \]
                            11. frac-timesN/A

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \frac{\left(\color{blue}{\left(-D\right)} \cdot M\right) \cdot \left(D \cdot M\right)}{\left(\mathsf{neg}\left(2 \cdot d\right)\right) \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(\left(-D\right) \cdot M\right) \cdot \color{blue}{\left(D \cdot M\right)}}{\left(\mathsf{neg}\left(2 \cdot d\right)\right) \cdot \left(2 \cdot d\right)}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                            19. distribute-lft-neg-inN/A

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

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

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

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

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

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

                        Alternative 5: 59.9% accurate, 0.2× speedup?

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

                          1. Initial program 85.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. Applied rewrites34.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}{\mathsf{fma}\left(\frac{{\left(D \cdot M\right)}^{2} \cdot 0.5}{-2 \cdot d}, \frac{-h}{\ell}, 1\right)} \]
                          4. Taylor expanded in h around 0

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

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

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

                            \[\leadsto \frac{\frac{1}{4} \cdot \left(\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right)}{h} \]
                          8. Step-by-step derivation
                            1. Applied rewrites23.1%

                              \[\leadsto \frac{\left(\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)\right) \cdot \sqrt{{\left(\frac{h}{\ell}\right)}^{3}}}{h} \]
                            2. Step-by-step derivation
                              1. Applied rewrites24.5%

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

                              if -1.99999999999999999e-90 < (*.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 2.00000000000000009e245 < (*.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 30.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 rewrites34.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-*.f6460.9

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

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

                                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)))) < 2.00000000000000009e245

                                1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

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

                                    Alternative 6: 57.2% accurate, 0.2× speedup?

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

                                      1. Initial program 85.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. Applied rewrites34.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}{\mathsf{fma}\left(\frac{{\left(D \cdot M\right)}^{2} \cdot 0.5}{-2 \cdot d}, \frac{-h}{\ell}, 1\right)} \]
                                      4. Taylor expanded in h around 0

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

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

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

                                        \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites18.8%

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

                                        if -1.99999999999999999e-90 < (*.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 2.00000000000000009e245 < (*.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 30.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 rewrites34.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-*.f6460.9

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

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

                                          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)))) < 2.00000000000000009e245

                                          1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

                                                  \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Final simplification58.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^{-90}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{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 \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^{+245}\right):\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 7: 76.8% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d} \cdot \frac{\mathsf{neg}\left(M \cdot D\right)}{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 \color{blue}{\left(\frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d} \cdot \frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d}\right)}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                                                7. Applied rewrites82.9%

                                                  \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\left(\frac{D \cdot M}{-2 \cdot d} \cdot \frac{D \cdot M}{-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)))) < 2.00000000000000009e245

                                                1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

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

                                                      if 2.00000000000000009e245 < (*.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 32.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.f6418.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 rewrites18.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 rewrites68.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. Step-by-step derivation
                                                        1. lift-*.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 8: 75.0% accurate, 0.3× speedup?

                                                    \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \frac{M}{d \cdot 2}\\ \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+245}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(\left(\left(t\_1 \cdot D\_m\right) \cdot t\_1\right) \cdot D\_m\right), \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \end{array} \]
                                                    D_m = (fabs.f64 D)
                                                    NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                    (FPCore (d h l M D_m)
                                                     :precision binary64
                                                     (let* ((t_0
                                                             (*
                                                              (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                              (-
                                                               1.0
                                                               (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l)))))
                                                            (t_1 (/ M (* d 2.0))))
                                                       (if (or (<= t_0 0.0) (not (<= t_0 2e+245)))
                                                         (*
                                                          (fma (* -0.5 (* (* (* t_1 D_m) t_1) D_m)) (/ h l) 1.0)
                                                          (/ (fabs d) (sqrt (* h l))))
                                                         (* (sqrt (/ d l)) (sqrt (/ d h))))))
                                                    D_m = fabs(D);
                                                    assert(d < h && h < l && l < M && M < D_m);
                                                    double code(double d, double h, double l, double M, double D_m) {
                                                    	double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                                                    	double t_1 = M / (d * 2.0);
                                                    	double tmp;
                                                    	if ((t_0 <= 0.0) || !(t_0 <= 2e+245)) {
                                                    		tmp = fma((-0.5 * (((t_1 * D_m) * t_1) * D_m)), (h / l), 1.0) * (fabs(d) / sqrt((h * l)));
                                                    	} else {
                                                    		tmp = sqrt((d / l)) * sqrt((d / h));
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    D_m = abs(D)
                                                    d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                    function code(d, h, l, M, D_m)
                                                    	t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                                                    	t_1 = Float64(M / Float64(d * 2.0))
                                                    	tmp = 0.0
                                                    	if ((t_0 <= 0.0) || !(t_0 <= 2e+245))
                                                    		tmp = Float64(fma(Float64(-0.5 * Float64(Float64(Float64(t_1 * D_m) * t_1) * D_m)), Float64(h / l), 1.0) * Float64(abs(d) / sqrt(Float64(h * l))));
                                                    	else
                                                    		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    D_m = N[Abs[D], $MachinePrecision]
                                                    NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                    code[d_, h_, l_, M_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+245]], $MachinePrecision]], N[(N[(N[(-0.5 * N[(N[(N[(t$95$1 * D$95$m), $MachinePrecision] * t$95$1), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                                                    
                                                    \begin{array}{l}
                                                    D_m = \left|D\right|
                                                    \\
                                                    [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                                                    t_1 := \frac{M}{d \cdot 2}\\
                                                    \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+245}\right):\\
                                                    \;\;\;\;\mathsf{fma}\left(-0.5 \cdot \left(\left(\left(t\_1 \cdot D\_m\right) \cdot t\_1\right) \cdot D\_m\right), \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 2.00000000000000009e245 < (*.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.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.f6430.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 rewrites30.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 rewrites74.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-*.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot \frac{M}{\color{blue}{2 \cdot d}}\right) \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 \left(\left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot \frac{M}{\color{blue}{d \cdot 2}}\right) \cdot D\right), \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                                                        16. lower-*.f6473.8

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

                                                        \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\left(\left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot \frac{M}{d \cdot 2}\right) \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)))) < 2.00000000000000009e245

                                                      1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

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

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

                                                          Alternative 9: 76.2% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \color{blue}{\left(\frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d} \cdot \frac{\mathsf{neg}\left(M \cdot D\right)}{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 \color{blue}{\left(\frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d} \cdot \frac{\mathsf{neg}\left(M \cdot D\right)}{2 \cdot d}\right)}, \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                                                            7. Applied rewrites82.9%

                                                              \[\leadsto \mathsf{fma}\left(-0.5 \cdot \color{blue}{\left(\frac{D \cdot M}{-2 \cdot d} \cdot \frac{D \cdot M}{-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)))) < 2.00000000000000009e245

                                                            1. Initial program 99.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 rewrites99.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-*.f6434.9

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

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

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

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

                                                                  if 2.00000000000000009e245 < (*.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 32.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.f6418.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 rewrites18.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 rewrites68.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. Step-by-step derivation
                                                                    1. lift-*.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot \left(\left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot \frac{M}{\color{blue}{2 \cdot d}}\right) \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 \left(\left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot \frac{M}{\color{blue}{d \cdot 2}}\right) \cdot D\right), \frac{h}{\ell}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}} \]
                                                                    16. lower-*.f6468.0

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

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

                                                                Alternative 10: 52.2% accurate, 0.3× speedup?

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

                                                                  1. Initial program 85.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. Applied rewrites34.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}{\mathsf{fma}\left(\frac{{\left(D \cdot M\right)}^{2} \cdot 0.5}{-2 \cdot d}, \frac{-h}{\ell}, 1\right)} \]
                                                                  4. Taylor expanded in h around 0

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

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

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

                                                                    \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                                                  8. Step-by-step derivation
                                                                    1. Applied rewrites18.8%

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

                                                                    if -1.99999999999999999e-90 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999991e295

                                                                    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. Applied rewrites86.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}{\mathsf{fma}\left(\frac{{\left(D \cdot M\right)}^{2} \cdot 0.5}{-2 \cdot d}, \frac{-h}{\ell}, 1\right)} \]
                                                                    4. Taylor expanded in h around 0

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

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

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

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

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

                                                                      if 4.99999999999999991e295 < (*.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 29.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 rewrites32.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. 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-*.f6457.0

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

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

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

                                                                      Alternative 11: 48.6% accurate, 0.3× speedup?

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

                                                                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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-*.f6413.9

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

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

                                                                          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)))) < 4.99999999999999991e295

                                                                          1. Initial program 99.5%

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

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

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

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

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

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

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

                                                                            if 4.99999999999999991e295 < (*.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 29.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 rewrites32.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. 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-*.f6457.0

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

                                                                                \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                                                                            5. Recombined 3 regimes into one program.
                                                                            6. Final simplification52.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:\\ \;\;\;\;\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d\\ \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^{+295}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1\\ \end{array} \]
                                                                            7. Add Preprocessing

                                                                            Alternative 12: 75.5% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              if 2.00000000000000009e245 < (*.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 32.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.f6418.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 rewrites18.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 rewrites68.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. Step-by-step derivation
                                                                                1. lift-*.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                                            Alternative 13: 46.5% accurate, 0.5× speedup?

                                                                            \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-53}:\\ \;\;\;\;\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} \]
                                                                            D_m = (fabs.f64 D)
                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                            (FPCore (d h l M D_m)
                                                                             :precision binary64
                                                                             (if (<=
                                                                                  (*
                                                                                   (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                   (-
                                                                                    1.0
                                                                                    (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                  -1e-53)
                                                                               (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                               (* (/ (fabs d) (sqrt (* h l))) 1.0)))
                                                                            D_m = fabs(D);
                                                                            assert(d < h && h < l && l < M && M < D_m);
                                                                            double code(double d, double h, double l, double M, double D_m) {
                                                                            	double tmp;
                                                                            	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-53) {
                                                                            		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                            	} else {
                                                                            		tmp = (fabs(d) / sqrt((h * l))) * 1.0;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            D_m = abs(d)
                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                            real(8) function code(d, h, l, m, d_m)
                                                                                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_m
                                                                                real(8) :: tmp
                                                                                if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-1d-53)) then
                                                                                    tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                                else
                                                                                    tmp = (abs(d) / sqrt((h * l))) * 1.0d0
                                                                                end if
                                                                                code = tmp
                                                                            end function
                                                                            
                                                                            D_m = Math.abs(D);
                                                                            assert d < h && h < l && l < M && M < D_m;
                                                                            public static double code(double d, double h, double l, double M, double D_m) {
                                                                            	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 * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-53) {
                                                                            		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                            	} else {
                                                                            		tmp = (Math.abs(d) / Math.sqrt((h * l))) * 1.0;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            D_m = math.fabs(D)
                                                                            [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                            def code(d, h, l, M, D_m):
                                                                            	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 * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -1e-53:
                                                                            		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                            	else:
                                                                            		tmp = (math.fabs(d) / math.sqrt((h * l))) * 1.0
                                                                            	return tmp
                                                                            
                                                                            D_m = abs(D)
                                                                            d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                            function code(d, h, l, M, D_m)
                                                                            	tmp = 0.0
                                                                            	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -1e-53)
                                                                            		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
                                                                            
                                                                            D_m = abs(D);
                                                                            d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                            function tmp_2 = code(d, h, l, M, D_m)
                                                                            	tmp = 0.0;
                                                                            	if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -1e-53)
                                                                            		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                            	else
                                                                            		tmp = (abs(d) / sqrt((h * l))) * 1.0;
                                                                            	end
                                                                            	tmp_2 = tmp;
                                                                            end
                                                                            
                                                                            D_m = N[Abs[D], $MachinePrecision]
                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                            code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-53], 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}
                                                                            D_m = \left|D\right|
                                                                            \\
                                                                            [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                            \\
                                                                            \begin{array}{l}
                                                                            \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -1 \cdot 10^{-53}:\\
                                                                            \;\;\;\;\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)))) < -1.00000000000000003e-53

                                                                              1. Initial program 85.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 rewrites0.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 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}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                  2. unpow2N/A

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

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

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

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

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

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

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

                                                                                    \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                  10. lower-*.f6411.3

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

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

                                                                                if -1.00000000000000003e-53 < (*.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 62.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 rewrites63.4%

                                                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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-*.f6466.7

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

                                                                                    \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot 1} \]
                                                                                5. Recombined 2 regimes into one program.
                                                                                6. Final simplification48.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^{-53}:\\ \;\;\;\;\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 14: 43.4% accurate, 3.2× speedup?

                                                                                \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 1.55 \cdot 10^{-236}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
                                                                                D_m = (fabs.f64 D)
                                                                                NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                (FPCore (d h l M D_m)
                                                                                 :precision binary64
                                                                                 (if (<= d 1.55e-236)
                                                                                   (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                                   (/ d (sqrt (* l h)))))
                                                                                D_m = fabs(D);
                                                                                assert(d < h && h < l && l < M && M < D_m);
                                                                                double code(double d, double h, double l, double M, double D_m) {
                                                                                	double tmp;
                                                                                	if (d <= 1.55e-236) {
                                                                                		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                                	} else {
                                                                                		tmp = d / sqrt((l * h));
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                D_m = abs(d)
                                                                                NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                real(8) function code(d, h, l, m, d_m)
                                                                                    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_m
                                                                                    real(8) :: tmp
                                                                                    if (d <= 1.55d-236) then
                                                                                        tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                                    else
                                                                                        tmp = d / sqrt((l * h))
                                                                                    end if
                                                                                    code = tmp
                                                                                end function
                                                                                
                                                                                D_m = Math.abs(D);
                                                                                assert d < h && h < l && l < M && M < D_m;
                                                                                public static double code(double d, double h, double l, double M, double D_m) {
                                                                                	double tmp;
                                                                                	if (d <= 1.55e-236) {
                                                                                		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                                	} else {
                                                                                		tmp = d / Math.sqrt((l * h));
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                D_m = math.fabs(D)
                                                                                [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                                def code(d, h, l, M, D_m):
                                                                                	tmp = 0
                                                                                	if d <= 1.55e-236:
                                                                                		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                                	else:
                                                                                		tmp = d / math.sqrt((l * h))
                                                                                	return tmp
                                                                                
                                                                                D_m = abs(D)
                                                                                d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                function code(d, h, l, M, D_m)
                                                                                	tmp = 0.0
                                                                                	if (d <= 1.55e-236)
                                                                                		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                                	else
                                                                                		tmp = Float64(d / sqrt(Float64(l * h)));
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                D_m = abs(D);
                                                                                d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                                function tmp_2 = code(d, h, l, M, D_m)
                                                                                	tmp = 0.0;
                                                                                	if (d <= 1.55e-236)
                                                                                		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                                	else
                                                                                		tmp = d / sqrt((l * h));
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                D_m = N[Abs[D], $MachinePrecision]
                                                                                NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, 1.55e-236], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                
                                                                                \begin{array}{l}
                                                                                D_m = \left|D\right|
                                                                                \\
                                                                                [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;d \leq 1.55 \cdot 10^{-236}:\\
                                                                                \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if d < 1.5499999999999999e-236

                                                                                  1. Initial program 71.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 rewrites40.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}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                      2. unpow2N/A

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

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

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

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

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

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

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

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

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

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

                                                                                    if 1.5499999999999999e-236 < d

                                                                                    1. Initial program 68.1%

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

                                                                                      \[\leadsto \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 rewrites44.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-*.f6449.4

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

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

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

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

                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.55 \cdot 10^{-236}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                                                                                        5. Add Preprocessing

                                                                                        Alternative 15: 26.4% accurate, 3.4× speedup?

                                                                                        \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \end{array} \]
                                                                                        D_m = (fabs.f64 D)
                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                        (FPCore (d h l M D_m) :precision binary64 (* (sqrt (pow (* l h) -1.0)) d))
                                                                                        D_m = fabs(D);
                                                                                        assert(d < h && h < l && l < M && M < D_m);
                                                                                        double code(double d, double h, double l, double M, double D_m) {
                                                                                        	return sqrt(pow((l * h), -1.0)) * d;
                                                                                        }
                                                                                        
                                                                                        D_m = abs(d)
                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                        real(8) function code(d, h, l, m, d_m)
                                                                                            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_m
                                                                                            code = sqrt(((l * h) ** (-1.0d0))) * d
                                                                                        end function
                                                                                        
                                                                                        D_m = Math.abs(D);
                                                                                        assert d < h && h < l && l < M && M < D_m;
                                                                                        public static double code(double d, double h, double l, double M, double D_m) {
                                                                                        	return Math.sqrt(Math.pow((l * h), -1.0)) * d;
                                                                                        }
                                                                                        
                                                                                        D_m = math.fabs(D)
                                                                                        [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                                        def code(d, h, l, M, D_m):
                                                                                        	return math.sqrt(math.pow((l * h), -1.0)) * d
                                                                                        
                                                                                        D_m = abs(D)
                                                                                        d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                        function code(d, h, l, M, D_m)
                                                                                        	return Float64(sqrt((Float64(l * h) ^ -1.0)) * d)
                                                                                        end
                                                                                        
                                                                                        D_m = abs(D);
                                                                                        d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                                        function tmp = code(d, h, l, M, D_m)
                                                                                        	tmp = sqrt(((l * h) ^ -1.0)) * d;
                                                                                        end
                                                                                        
                                                                                        D_m = N[Abs[D], $MachinePrecision]
                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                        code[d_, h_, l_, M_, D$95$m_] := N[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        D_m = \left|D\right|
                                                                                        \\
                                                                                        [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                        \\
                                                                                        \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Initial program 69.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 rewrites42.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 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-*.f6426.9

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

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

                                                                                            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
                                                                                          6. Add Preprocessing

                                                                                          Alternative 16: 26.2% accurate, 15.3× speedup?

                                                                                          \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                                                          D_m = (fabs.f64 D)
                                                                                          NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                          (FPCore (d h l M D_m) :precision binary64 (/ d (sqrt (* l h))))
                                                                                          D_m = fabs(D);
                                                                                          assert(d < h && h < l && l < M && M < D_m);
                                                                                          double code(double d, double h, double l, double M, double D_m) {
                                                                                          	return d / sqrt((l * h));
                                                                                          }
                                                                                          
                                                                                          D_m = abs(d)
                                                                                          NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                          real(8) function code(d, h, l, m, d_m)
                                                                                              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_m
                                                                                              code = d / sqrt((l * h))
                                                                                          end function
                                                                                          
                                                                                          D_m = Math.abs(D);
                                                                                          assert d < h && h < l && l < M && M < D_m;
                                                                                          public static double code(double d, double h, double l, double M, double D_m) {
                                                                                          	return d / Math.sqrt((l * h));
                                                                                          }
                                                                                          
                                                                                          D_m = math.fabs(D)
                                                                                          [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                                          def code(d, h, l, M, D_m):
                                                                                          	return d / math.sqrt((l * h))
                                                                                          
                                                                                          D_m = abs(D)
                                                                                          d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                          function code(d, h, l, M, D_m)
                                                                                          	return Float64(d / sqrt(Float64(l * h)))
                                                                                          end
                                                                                          
                                                                                          D_m = abs(D);
                                                                                          d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                                          function tmp = code(d, h, l, M, D_m)
                                                                                          	tmp = d / sqrt((l * h));
                                                                                          end
                                                                                          
                                                                                          D_m = N[Abs[D], $MachinePrecision]
                                                                                          NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                          code[d_, h_, l_, M_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          D_m = \left|D\right|
                                                                                          \\
                                                                                          [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                          \\
                                                                                          \frac{d}{\sqrt{\ell \cdot h}}
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Initial program 69.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 rewrites42.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 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-*.f6426.9

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

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

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

                                                                                                  \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
                                                                                                2. Add Preprocessing

                                                                                                Reproduce

                                                                                                ?
                                                                                                herbie shell --seed 2024329 
                                                                                                (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)))))