Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.3% → 83.0%
Time: 17.2s
Alternatives: 19
Speedup: 1.0×

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 19 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.3% 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: 83.0% accurate, 0.9× speedup?

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

\mathbf{elif}\;d \leq 5.9 \cdot 10^{-114}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \mathsf{fma}\left(-0.125 \cdot \frac{{\left(D \cdot M\_m\right)}^{2}}{d}, \frac{h}{\ell}, d\right)}{h}\\

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/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{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000011e-169 < d < 5.9000000000000001e-114

    1. Initial program 59.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 rewrites27.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 h around 0

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

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

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

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

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

        if 5.9000000000000001e-114 < d

        1. Initial program 72.1%

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

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

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

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
        4. Applied rewrites79.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 78.4% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 99.0%

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

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

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

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
        4. Applied rewrites83.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
        5. Applied rewrites72.3%

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

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

        1. Initial program 38.2%

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

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

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

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
        4. Applied rewrites32.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
        5. Applied rewrites0.0%

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot -0.125, h, \ell\right) \cdot \left|d\right|}{\sqrt{\ell \cdot 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)))) < 4.00000000000000013e282

        1. Initial program 99.4%

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

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

            \[\leadsto \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. Applied rewrites98.7%

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

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

        Alternative 3: 77.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
          4. Applied rewrites83.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
          5. Applied rewrites72.3%

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

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

          1. Initial program 38.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 rewrites38.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}{1} \]
            2. 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 1 \]
              2. metadata-eval38.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}} \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)))) < 4.00000000000000013e282

            1. Initial program 99.4%

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

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

                \[\leadsto \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. Applied rewrites98.7%

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

            Alternative 4: 78.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 38.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 rewrites38.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}{1} \]
                2. 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 1 \]
                  2. metadata-eval38.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}} \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)))) < 4.00000000000000013e282

                1. Initial program 99.4%

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

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

                    \[\leadsto \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. Applied rewrites98.7%

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

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

                Alternative 5: 77.7% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 38.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 rewrites38.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}{1} \]
                    2. 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 1 \]
                      2. metadata-eval38.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}} \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)))) < 4.00000000000000013e282

                    1. Initial program 99.4%

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

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

                        \[\leadsto \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. Applied rewrites98.7%

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

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

                    Alternative 6: 64.1% accurate, 0.1× speedup?

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

                      1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -500 < (*.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 4.00000000000000013e282 < (*.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 45.4%

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                      4. Step-by-step derivation
                        1. Applied rewrites35.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}{1} \]
                        2. 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 1 \]
                          2. metadata-eval35.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}} \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)))) < 4.00000000000000013e282

                        1. Initial program 99.4%

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

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

                            \[\leadsto \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. Applied rewrites98.7%

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

                        Alternative 7: 77.2% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          1. Initial program 38.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 rewrites38.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}{1} \]
                            2. 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 1 \]
                              2. metadata-eval38.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}} \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)))) < 4.00000000000000013e282

                            1. Initial program 99.4%

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

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

                                \[\leadsto \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. Applied rewrites98.7%

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

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

                            Alternative 8: 80.0% accurate, 0.3× speedup?

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

                              1. Initial program 80.4%

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

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

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

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

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

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

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

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

                                  if 2.00000000000000001e-183 < (*.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.00000000000000013e282

                                  1. Initial program 99.4%

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

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

                                      \[\leadsto \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. Applied rewrites98.7%

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

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

                                    1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 9: 53.0% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(\frac{M \cdot M}{d} \cdot \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}}\right) \]
                                        17. lower-pow.f6437.7

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

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

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

                                        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.00000000000000013e282

                                        1. Initial program 99.4%

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

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

                                            \[\leadsto \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. Applied rewrites98.7%

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

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

                                          1. Initial program 17.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 rewrites26.7%

                                              \[\leadsto \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 \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 1 \]
                                              2. metadata-eval26.7

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

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

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

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

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

                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\right) \cdot 1 \]
                                              11. lower-/.f6428.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 10: 79.0% accurate, 0.4× speedup?

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

                                            1. Initial program 88.1%

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

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

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

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

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

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

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

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

                                            1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 11: 78.6% accurate, 0.4× speedup?

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

                                            1. Initial program 88.1%

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

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

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

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

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

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

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

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

                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
                                            4. Applied rewrites87.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\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 \mathsf{fma}\left(\frac{\frac{-1}{2} \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right) \]
                                              2. metadata-eval87.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 \mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\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 \mathsf{fma}\left(\frac{\frac{-1}{2} \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\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 \mathsf{fma}\left(\frac{\frac{-1}{2} \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right) \]
                                              5. lower-sqrt.f6487.5

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

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

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

                                            1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 12: 82.1% accurate, 1.0× speedup?

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

                                            1. Initial program 69.2%

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

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

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

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

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

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

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

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

                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
                                            4. Applied rewrites77.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
                                            5. Step-by-step derivation
                                              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -5.7999999999999997e-168 < d < 5.9000000000000001e-114

                                            1. Initial program 59.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 rewrites27.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 h around 0

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

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

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

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

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

                                                if 5.9000000000000001e-114 < d

                                                1. Initial program 72.1%

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
                                                4. Applied rewrites79.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
                                                5. Step-by-step derivation
                                                  1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 13: 80.0% accurate, 1.0× speedup?

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

                                                1. Initial program 76.0%

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
                                                4. Applied rewrites83.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{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\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 \mathsf{fma}\left(\frac{\frac{-1}{2} \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right) \]
                                                  2. metadata-eval83.8

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

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

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

                                                if -9.60000000000000053e-54 < d < 5.9000000000000001e-114

                                                1. Initial program 56.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 rewrites27.7%

                                                    \[\leadsto \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 h around 0

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

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

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

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

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

                                                    if 5.9000000000000001e-114 < d

                                                    1. Initial program 72.1%

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\ell}, h, 1\right)} \]
                                                    4. Applied rewrites79.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}{\mathsf{fma}\left(\frac{-0.5 \cdot {\left(\frac{\frac{d}{D}}{M} \cdot 2\right)}^{-2}}{\ell}, h, 1\right)} \]
                                                    5. Step-by-step derivation
                                                      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  Alternative 14: 46.1% accurate, 3.2× speedup?

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

                                                    1. Initial program 65.4%

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

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

                                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                      2. Taylor expanded in 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. lower-*.f64N/A

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

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

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

                                                      if -2.9999999999999998e-136 < l < -2.54999999999999986e-306

                                                      1. Initial program 66.4%

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

                                                        \[\leadsto \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.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 \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 1 \]
                                                          2. metadata-eval40.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{\sqrt{\frac{d}{h} \cdot \left(-d\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \cdot 1 \]
                                                          21. lower-neg.f6446.2

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

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

                                                        if -2.54999999999999986e-306 < l < 4.9999999999999998e-236

                                                        1. Initial program 93.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 rewrites13.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 h around 0

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

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

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

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

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

                                                            if 4.9999999999999998e-236 < l

                                                            1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                13. 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 rewrites49.9%

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

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

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

                                                                Alternative 15: 45.2% accurate, 3.2× speedup?

                                                                \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2.5 \cdot 10^{+143}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;\ell \leq -1.38 \cdot 10^{-278}:\\ \;\;\;\;\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;\ell \leq 5 \cdot 10^{-236}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                M_m = (fabs.f64 M)
                                                                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                (FPCore (d h l M_m D)
                                                                 :precision binary64
                                                                 (if (<= l -2.5e+143)
                                                                   (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                   (if (<= l -1.38e-278)
                                                                     (* (* 1.0 (sqrt (/ d l))) (sqrt (/ d h)))
                                                                     (if (<= l 5e-236)
                                                                       (/ (* (- d) (sqrt (/ h l))) h)
                                                                       (/ d (* (sqrt l) (sqrt h)))))))
                                                                M_m = fabs(M);
                                                                assert(d < h && h < l && l < M_m && M_m < D);
                                                                double code(double d, double h, double l, double M_m, double D) {
                                                                	double tmp;
                                                                	if (l <= -2.5e+143) {
                                                                		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                	} else if (l <= -1.38e-278) {
                                                                		tmp = (1.0 * sqrt((d / l))) * sqrt((d / h));
                                                                	} else if (l <= 5e-236) {
                                                                		tmp = (-d * sqrt((h / l))) / h;
                                                                	} else {
                                                                		tmp = d / (sqrt(l) * sqrt(h));
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                M_m = abs(m)
                                                                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                real(8) function code(d, h, l, m_m, d_1)
                                                                    real(8), intent (in) :: d
                                                                    real(8), intent (in) :: h
                                                                    real(8), intent (in) :: l
                                                                    real(8), intent (in) :: m_m
                                                                    real(8), intent (in) :: d_1
                                                                    real(8) :: tmp
                                                                    if (l <= (-2.5d+143)) then
                                                                        tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                    else if (l <= (-1.38d-278)) then
                                                                        tmp = (1.0d0 * sqrt((d / l))) * sqrt((d / h))
                                                                    else if (l <= 5d-236) then
                                                                        tmp = (-d * sqrt((h / l))) / h
                                                                    else
                                                                        tmp = d / (sqrt(l) * sqrt(h))
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                M_m = Math.abs(M);
                                                                assert d < h && h < l && l < M_m && M_m < D;
                                                                public static double code(double d, double h, double l, double M_m, double D) {
                                                                	double tmp;
                                                                	if (l <= -2.5e+143) {
                                                                		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                	} else if (l <= -1.38e-278) {
                                                                		tmp = (1.0 * Math.sqrt((d / l))) * Math.sqrt((d / h));
                                                                	} else if (l <= 5e-236) {
                                                                		tmp = (-d * Math.sqrt((h / l))) / h;
                                                                	} else {
                                                                		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                M_m = math.fabs(M)
                                                                [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                                                def code(d, h, l, M_m, D):
                                                                	tmp = 0
                                                                	if l <= -2.5e+143:
                                                                		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                	elif l <= -1.38e-278:
                                                                		tmp = (1.0 * math.sqrt((d / l))) * math.sqrt((d / h))
                                                                	elif l <= 5e-236:
                                                                		tmp = (-d * math.sqrt((h / l))) / h
                                                                	else:
                                                                		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                	return tmp
                                                                
                                                                M_m = abs(M)
                                                                d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                                                function code(d, h, l, M_m, D)
                                                                	tmp = 0.0
                                                                	if (l <= -2.5e+143)
                                                                		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                	elseif (l <= -1.38e-278)
                                                                		tmp = Float64(Float64(1.0 * sqrt(Float64(d / l))) * sqrt(Float64(d / h)));
                                                                	elseif (l <= 5e-236)
                                                                		tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h);
                                                                	else
                                                                		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                M_m = abs(M);
                                                                d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                                                function tmp_2 = code(d, h, l, M_m, D)
                                                                	tmp = 0.0;
                                                                	if (l <= -2.5e+143)
                                                                		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                	elseif (l <= -1.38e-278)
                                                                		tmp = (1.0 * sqrt((d / l))) * sqrt((d / h));
                                                                	elseif (l <= 5e-236)
                                                                		tmp = (-d * sqrt((h / l))) / h;
                                                                	else
                                                                		tmp = d / (sqrt(l) * sqrt(h));
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                M_m = N[Abs[M], $MachinePrecision]
                                                                NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                code[d_, h_, l_, M$95$m_, D_] := If[LessEqual[l, -2.5e+143], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.38e-278], N[(N[(1.0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e-236], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                
                                                                \begin{array}{l}
                                                                M_m = \left|M\right|
                                                                \\
                                                                [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;\ell \leq -2.5 \cdot 10^{+143}:\\
                                                                \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                
                                                                \mathbf{elif}\;\ell \leq -1.38 \cdot 10^{-278}:\\
                                                                \;\;\;\;\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                                                                
                                                                \mathbf{elif}\;\ell \leq 5 \cdot 10^{-236}:\\
                                                                \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 4 regimes
                                                                2. if l < -2.50000000000000006e143

                                                                  1. Initial program 51.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 rewrites41.1%

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

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

                                                                        \[\leadsto \color{blue}{\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. lower-*.f64N/A

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

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

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

                                                                    if -2.50000000000000006e143 < l < -1.38000000000000005e-278

                                                                    1. Initial program 72.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 rewrites48.0%

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

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

                                                                      if -1.38000000000000005e-278 < l < 4.9999999999999998e-236

                                                                      1. Initial program 81.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 rewrites14.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 h around 0

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

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

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

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

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

                                                                          if 4.9999999999999998e-236 < l

                                                                          1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                              13. 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 rewrites49.9%

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

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

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

                                                                              Alternative 16: 45.8% accurate, 3.2× speedup?

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

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

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

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

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

                                                                                  if -2.74999999999999996e-306 < l < 4.9999999999999998e-236

                                                                                  1. Initial program 93.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 rewrites13.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 h around 0

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

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

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

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

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

                                                                                      if 4.9999999999999998e-236 < l

                                                                                      1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                          13. 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 rewrites49.9%

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

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

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

                                                                                          Alternative 17: 45.3% accurate, 3.2× speedup?

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

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

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

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

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

                                                                                              if 7.2000000000000003e-294 < h

                                                                                              1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  Alternative 18: 41.7% accurate, 3.2× speedup?

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

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

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

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

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

                                                                                                      if 7.5000000000000004e-294 < h

                                                                                                      1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                                        6. Recombined 2 regimes into one program.
                                                                                                        7. Final simplification46.2%

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

                                                                                                        Alternative 19: 26.4% accurate, 15.3× speedup?

                                                                                                        \[\begin{array}{l} M_m = \left|M\right| \\ [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                                                                        M_m = (fabs.f64 M)
                                                                                                        NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                                                        (FPCore (d h l M_m D) :precision binary64 (/ d (sqrt (* l h))))
                                                                                                        M_m = fabs(M);
                                                                                                        assert(d < h && h < l && l < M_m && M_m < D);
                                                                                                        double code(double d, double h, double l, double M_m, double D) {
                                                                                                        	return d / sqrt((l * h));
                                                                                                        }
                                                                                                        
                                                                                                        M_m = abs(m)
                                                                                                        NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                                                        real(8) function code(d, h, l, m_m, d_1)
                                                                                                            real(8), intent (in) :: d
                                                                                                            real(8), intent (in) :: h
                                                                                                            real(8), intent (in) :: l
                                                                                                            real(8), intent (in) :: m_m
                                                                                                            real(8), intent (in) :: d_1
                                                                                                            code = d / sqrt((l * h))
                                                                                                        end function
                                                                                                        
                                                                                                        M_m = Math.abs(M);
                                                                                                        assert d < h && h < l && l < M_m && M_m < D;
                                                                                                        public static double code(double d, double h, double l, double M_m, double D) {
                                                                                                        	return d / Math.sqrt((l * h));
                                                                                                        }
                                                                                                        
                                                                                                        M_m = math.fabs(M)
                                                                                                        [d, h, l, M_m, D] = sort([d, h, l, M_m, D])
                                                                                                        def code(d, h, l, M_m, D):
                                                                                                        	return d / math.sqrt((l * h))
                                                                                                        
                                                                                                        M_m = abs(M)
                                                                                                        d, h, l, M_m, D = sort([d, h, l, M_m, D])
                                                                                                        function code(d, h, l, M_m, D)
                                                                                                        	return Float64(d / sqrt(Float64(l * h)))
                                                                                                        end
                                                                                                        
                                                                                                        M_m = abs(M);
                                                                                                        d, h, l, M_m, D = num2cell(sort([d, h, l, M_m, D])){:}
                                                                                                        function tmp = code(d, h, l, M_m, D)
                                                                                                        	tmp = d / sqrt((l * h));
                                                                                                        end
                                                                                                        
                                                                                                        M_m = N[Abs[M], $MachinePrecision]
                                                                                                        NOTE: d, h, l, M_m, and D should be sorted in increasing order before calling this function.
                                                                                                        code[d_, h_, l_, M$95$m_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                        
                                                                                                        \begin{array}{l}
                                                                                                        M_m = \left|M\right|
                                                                                                        \\
                                                                                                        [d, h, l, M_m, D] = \mathsf{sort}([d, h, l, M_m, D])\\
                                                                                                        \\
                                                                                                        \frac{d}{\sqrt{\ell \cdot h}}
                                                                                                        \end{array}
                                                                                                        
                                                                                                        Derivation
                                                                                                        1. Initial program 67.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 rewrites41.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}{-1 \cdot \left(\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                            13. lower-*.f6430.5

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

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

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

                                                                                                            Reproduce

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