Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.4% → 74.9%
Time: 22.9s
Alternatives: 22
Speedup: 3.3×

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 22 alternatives:

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

Initial Program: 66.4% 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: 74.9% accurate, 1.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\


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

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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.f6476.3

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
    6. Applied rewrites76.3%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
    7. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000024e-182 < d < 2.19999999999999996e-253

    1. Initial program 14.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 0

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

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

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

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

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

        if 2.19999999999999996e-253 < 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-pow.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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 rewrites85.2%

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

            \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{h}} \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(\frac{\sqrt{d}}{\sqrt{h}} \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(\frac{\sqrt{d}}{\sqrt{h}} \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. pow1/2N/A

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

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

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

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

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

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

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

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

      Alternative 2: 73.8% accurate, 0.4× speedup?

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

        1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
        6. Applied rewrites87.0%

          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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 1.99999999999999986e225 < (*.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 55.4%

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

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

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

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

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

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

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

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

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

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

            1. Initial program 0.0%

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

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

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

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

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

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

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

              Alternative 3: 73.3% accurate, 0.4× speedup?

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

                1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                6. Applied rewrites87.0%

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                7. Step-by-step derivation
                  1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.99999999999999986e225 < (*.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 55.4%

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

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

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

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

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

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

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

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

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

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

                    1. Initial program 0.0%

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

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

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

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

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

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

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

                      Alternative 4: 72.8% accurate, 1.8× speedup?

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

                        1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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.f6476.3

                            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                        6. Applied rewrites76.3%

                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                        7. Step-by-step derivation
                          1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if -5.00000000000000024e-182 < d < 2.5000000000000001e-216

                        1. Initial program 21.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 0

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

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

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

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

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

                            if 2.5000000000000001e-216 < d

                            1. Initial program 73.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.f6473.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 rewrites73.1%

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

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

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

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

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

                                \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \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) \]
                              6. sqrt-undivN/A

                                \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \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) \]
                              7. lift-sqrt.f64N/A

                                \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \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) \]
                              8. lift-sqrt.f64N/A

                                \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot \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) \]
                              9. lift-/.f6487.0

                                \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \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) \]
                            6. Applied rewrites87.0%

                              \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \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) \]
                          3. Recombined 3 regimes into one program.
                          4. Final simplification79.7%

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

                          Alternative 5: 68.2% accurate, 2.9× speedup?

                          \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\ \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{-198}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 3.05 \cdot 10^{+153}:\\ \;\;\;\;\sqrt{d} \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(D \cdot M\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\frac{1}{\frac{\frac{1}{\ell}}{h}}}}\\ \end{array} \end{array} \]
                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                          (FPCore (d h l M D)
                           :precision binary64
                           (let* ((t_0 (sqrt (/ d h))))
                             (if (<= d -5e-182)
                               (*
                                (* t_0 (sqrt (/ d l)))
                                (-
                                 1.0
                                 (/ (* h (* (* 0.5 (* D (* 0.5 M))) (/ (* D M) (* d 2.0)))) (* d l))))
                               (if (<= d 1.35e-198)
                                 (/
                                  (fma
                                   (* (* M (* M (* D -0.125))) (/ D l))
                                   (sqrt (/ h l))
                                   (/ (* d d) (sqrt (* h l))))
                                  d)
                                 (if (<= d 3.05e+153)
                                   (*
                                    (sqrt d)
                                    (*
                                     (sqrt (/ 1.0 l))
                                     (*
                                      t_0
                                      (fma
                                       (/ (* M (* D (* D M))) (* (* d d) 4.0))
                                       (* (/ h l) -0.5)
                                       1.0))))
                                   (/ d (sqrt (/ 1.0 (/ (/ 1.0 l) h)))))))))
                          assert(d < h && h < l && l < M && M < D);
                          double code(double d, double h, double l, double M, double D) {
                          	double t_0 = sqrt((d / h));
                          	double tmp;
                          	if (d <= -5e-182) {
                          		tmp = (t_0 * sqrt((d / l))) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * ((D * M) / (d * 2.0)))) / (d * l)));
                          	} else if (d <= 1.35e-198) {
                          		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                          	} else if (d <= 3.05e+153) {
                          		tmp = sqrt(d) * (sqrt((1.0 / l)) * (t_0 * fma(((M * (D * (D * M))) / ((d * d) * 4.0)), ((h / l) * -0.5), 1.0)));
                          	} else {
                          		tmp = d / sqrt((1.0 / ((1.0 / l) / h)));
                          	}
                          	return tmp;
                          }
                          
                          d, h, l, M, D = sort([d, h, l, M, D])
                          function code(d, h, l, M, D)
                          	t_0 = sqrt(Float64(d / h))
                          	tmp = 0.0
                          	if (d <= -5e-182)
                          		tmp = Float64(Float64(t_0 * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * Float64(Float64(D * M) / Float64(d * 2.0)))) / Float64(d * l))));
                          	elseif (d <= 1.35e-198)
                          		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                          	elseif (d <= 3.05e+153)
                          		tmp = Float64(sqrt(d) * Float64(sqrt(Float64(1.0 / l)) * Float64(t_0 * fma(Float64(Float64(M * Float64(D * Float64(D * M))) / Float64(Float64(d * d) * 4.0)), Float64(Float64(h / l) * -0.5), 1.0))));
                          	else
                          		tmp = Float64(d / sqrt(Float64(1.0 / Float64(Float64(1.0 / l) / h))));
                          	end
                          	return tmp
                          end
                          
                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -5e-182], N[(N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-198], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 3.05e+153], N[(N[Sqrt[d], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(1.0 / N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                          \\
                          \begin{array}{l}
                          t_0 := \sqrt{\frac{d}{h}}\\
                          \mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
                          \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\
                          
                          \mathbf{elif}\;d \leq 1.35 \cdot 10^{-198}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                          
                          \mathbf{elif}\;d \leq 3.05 \cdot 10^{+153}:\\
                          \;\;\;\;\sqrt{d} \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(D \cdot M\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{d}{\sqrt{\frac{1}{\frac{\frac{1}{\ell}}{h}}}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if d < -5.00000000000000024e-182

                            1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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.f6476.3

                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                            6. Applied rewrites76.3%

                              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                            7. Step-by-step derivation
                              1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if -5.00000000000000024e-182 < d < 1.3500000000000001e-198

                            1. Initial program 24.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 0

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

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

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

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

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

                                if 1.3500000000000001e-198 < d < 3.0499999999999999e153

                                1. Initial program 81.2%

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

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

                                if 3.0499999999999999e153 < d

                                1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 6: 69.1% accurate, 3.2× speedup?

                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -7.6 \cdot 10^{+160}:\\ \;\;\;\;t\_0 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -6.8 \cdot 10^{-148}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(-0.5, \frac{h \cdot \frac{\left(D \cdot M\right) \cdot \left(0.5 \cdot \left(D \cdot M\right)\right)}{d \cdot \left(d \cdot 2\right)}}{\ell}, 1\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\ \end{array} \end{array} \]
                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                    (FPCore (d h l M D)
                                     :precision binary64
                                     (let* ((t_0 (sqrt (/ 1.0 (* h l)))))
                                       (if (<= d -7.6e+160)
                                         (* t_0 (- d))
                                         (if (<= d -6.8e-148)
                                           (*
                                            (* (sqrt (/ d h)) (sqrt (/ d l)))
                                            (fma
                                             -0.5
                                             (/ (* h (/ (* (* D M) (* 0.5 (* D M))) (* d (* d 2.0)))) l)
                                             1.0))
                                           (if (<= d 1.15e-204)
                                             (/
                                              (fma
                                               (* (* M (* M (* D -0.125))) (/ D l))
                                               (sqrt (/ h l))
                                               (/ (* d d) (sqrt (* h l))))
                                              d)
                                             (if (<= d 2.5e+101)
                                               (/
                                                (*
                                                 (/ d (sqrt l))
                                                 (+
                                                  1.0
                                                  (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
                                                (sqrt h))
                                               (/ d (/ 1.0 t_0))))))))
                                    assert(d < h && h < l && l < M && M < D);
                                    double code(double d, double h, double l, double M, double D) {
                                    	double t_0 = sqrt((1.0 / (h * l)));
                                    	double tmp;
                                    	if (d <= -7.6e+160) {
                                    		tmp = t_0 * -d;
                                    	} else if (d <= -6.8e-148) {
                                    		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma(-0.5, ((h * (((D * M) * (0.5 * (D * M))) / (d * (d * 2.0)))) / l), 1.0);
                                    	} else if (d <= 1.15e-204) {
                                    		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                                    	} else if (d <= 2.5e+101) {
                                    		tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
                                    	} else {
                                    		tmp = d / (1.0 / t_0);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    d, h, l, M, D = sort([d, h, l, M, D])
                                    function code(d, h, l, M, D)
                                    	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
                                    	tmp = 0.0
                                    	if (d <= -7.6e+160)
                                    		tmp = Float64(t_0 * Float64(-d));
                                    	elseif (d <= -6.8e-148)
                                    		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(-0.5, Float64(Float64(h * Float64(Float64(Float64(D * M) * Float64(0.5 * Float64(D * M))) / Float64(d * Float64(d * 2.0)))) / l), 1.0));
                                    	elseif (d <= 1.15e-204)
                                    		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                                    	elseif (d <= 2.5e+101)
                                    		tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h));
                                    	else
                                    		tmp = Float64(d / Float64(1.0 / t_0));
                                    	end
                                    	return tmp
                                    end
                                    
                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7.6e+160], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -6.8e-148], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(N[(h * N[(N[(N[(D * M), $MachinePrecision] * N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
                                    
                                    \begin{array}{l}
                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                    \\
                                    \begin{array}{l}
                                    t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                    \mathbf{if}\;d \leq -7.6 \cdot 10^{+160}:\\
                                    \;\;\;\;t\_0 \cdot \left(-d\right)\\
                                    
                                    \mathbf{elif}\;d \leq -6.8 \cdot 10^{-148}:\\
                                    \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(-0.5, \frac{h \cdot \frac{\left(D \cdot M\right) \cdot \left(0.5 \cdot \left(D \cdot M\right)\right)}{d \cdot \left(d \cdot 2\right)}}{\ell}, 1\right)\\
                                    
                                    \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
                                    \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                                    
                                    \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                    \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 5 regimes
                                    2. if d < -7.60000000000000024e160

                                      1. Initial program 59.3%

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

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

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

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

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

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

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

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

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

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

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

                                      if -7.60000000000000024e160 < d < -6.8000000000000005e-148

                                      1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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.f6481.0

                                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                      6. Applied rewrites81.0%

                                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                      7. Step-by-step derivation
                                        1. lift--.f64N/A

                                          \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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. lift-*.f64N/A

                                          \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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) \]
                                        6. lift-/.f64N/A

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

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

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

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

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

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

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

                                      if -6.8000000000000005e-148 < d < 1.15e-204

                                      1. Initial program 30.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 0

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

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

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

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

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

                                          if 1.15e-204 < d < 2.49999999999999994e101

                                          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. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 2.49999999999999994e101 < d

                                          1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

                                            Alternative 7: 67.9% accurate, 3.3× speedup?

                                            \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ t_1 := 1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;t\_0 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -4.6 \cdot 10^{-126}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot t\_1}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\ \end{array} \end{array} \]
                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                            (FPCore (d h l M D)
                                             :precision binary64
                                             (let* ((t_0 (sqrt (/ 1.0 (* h l))))
                                                    (t_1
                                                     (+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0))))))
                                               (if (<= d -1.25e+111)
                                                 (* t_0 (- d))
                                                 (if (<= d -4.6e-126)
                                                   (* (sqrt (/ d l)) (* (sqrt (/ d h)) t_1))
                                                   (if (<= d 1.15e-204)
                                                     (/
                                                      (fma
                                                       (* (* M (* M (* D -0.125))) (/ D l))
                                                       (sqrt (/ h l))
                                                       (/ (* d d) (sqrt (* h l))))
                                                      d)
                                                     (if (<= d 2.5e+101)
                                                       (/ (* (/ d (sqrt l)) t_1) (sqrt h))
                                                       (/ d (/ 1.0 t_0))))))))
                                            assert(d < h && h < l && l < M && M < D);
                                            double code(double d, double h, double l, double M, double D) {
                                            	double t_0 = sqrt((1.0 / (h * l)));
                                            	double t_1 = 1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)));
                                            	double tmp;
                                            	if (d <= -1.25e+111) {
                                            		tmp = t_0 * -d;
                                            	} else if (d <= -4.6e-126) {
                                            		tmp = sqrt((d / l)) * (sqrt((d / h)) * t_1);
                                            	} else if (d <= 1.15e-204) {
                                            		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                                            	} else if (d <= 2.5e+101) {
                                            		tmp = ((d / sqrt(l)) * t_1) / sqrt(h);
                                            	} else {
                                            		tmp = d / (1.0 / t_0);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            d, h, l, M, D = sort([d, h, l, M, D])
                                            function code(d, h, l, M, D)
                                            	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
                                            	t_1 = Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))
                                            	tmp = 0.0
                                            	if (d <= -1.25e+111)
                                            		tmp = Float64(t_0 * Float64(-d));
                                            	elseif (d <= -4.6e-126)
                                            		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * t_1));
                                            	elseif (d <= 1.15e-204)
                                            		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                                            	elseif (d <= 2.5e+101)
                                            		tmp = Float64(Float64(Float64(d / sqrt(l)) * t_1) / sqrt(h));
                                            	else
                                            		tmp = Float64(d / Float64(1.0 / t_0));
                                            	end
                                            	return tmp
                                            end
                                            
                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                            code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -4.6e-126], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
                                            
                                            \begin{array}{l}
                                            [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                            \\
                                            \begin{array}{l}
                                            t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                            t_1 := 1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\\
                                            \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
                                            \;\;\;\;t\_0 \cdot \left(-d\right)\\
                                            
                                            \mathbf{elif}\;d \leq -4.6 \cdot 10^{-126}:\\
                                            \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
                                            
                                            \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                                            
                                            \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                            \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot t\_1}{\sqrt{h}}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 5 regimes
                                            2. if d < -1.2499999999999999e111

                                              1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

                                              if -1.2499999999999999e111 < d < -4.60000000000000021e-126

                                              1. Initial program 84.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. Applied rewrites0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if -4.60000000000000021e-126 < d < 1.15e-204

                                              1. Initial program 33.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 0

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

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

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

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

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

                                                  if 1.15e-204 < d < 2.49999999999999994e101

                                                  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. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if 2.49999999999999994e101 < d

                                                  1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -4.6 \cdot 10^{-126}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \]
                                                    5. Add Preprocessing

                                                    Alternative 8: 66.2% accurate, 3.3× speedup?

                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;t\_0 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\ \end{array} \end{array} \]
                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                    (FPCore (d h l M D)
                                                     :precision binary64
                                                     (let* ((t_0 (sqrt (/ 1.0 (* h l)))))
                                                       (if (<= d -1.25e+111)
                                                         (* t_0 (- d))
                                                         (if (<= d -8.5e-118)
                                                           (*
                                                            (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                            (fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
                                                           (if (<= d 1.15e-204)
                                                             (/
                                                              (fma
                                                               (* (* M (* M (* D -0.125))) (/ D l))
                                                               (sqrt (/ h l))
                                                               (/ (* d d) (sqrt (* h l))))
                                                              d)
                                                             (if (<= d 2.5e+101)
                                                               (/
                                                                (*
                                                                 (/ d (sqrt l))
                                                                 (+
                                                                  1.0
                                                                  (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
                                                                (sqrt h))
                                                               (/ d (/ 1.0 t_0))))))))
                                                    assert(d < h && h < l && l < M && M < D);
                                                    double code(double d, double h, double l, double M, double D) {
                                                    	double t_0 = sqrt((1.0 / (h * l)));
                                                    	double tmp;
                                                    	if (d <= -1.25e+111) {
                                                    		tmp = t_0 * -d;
                                                    	} else if (d <= -8.5e-118) {
                                                    		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
                                                    	} else if (d <= 1.15e-204) {
                                                    		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                                                    	} else if (d <= 2.5e+101) {
                                                    		tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
                                                    	} else {
                                                    		tmp = d / (1.0 / t_0);
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                    function code(d, h, l, M, D)
                                                    	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
                                                    	tmp = 0.0
                                                    	if (d <= -1.25e+111)
                                                    		tmp = Float64(t_0 * Float64(-d));
                                                    	elseif (d <= -8.5e-118)
                                                    		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0));
                                                    	elseif (d <= 1.15e-204)
                                                    		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                                                    	elseif (d <= 2.5e+101)
                                                    		tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h));
                                                    	else
                                                    		tmp = Float64(d / Float64(1.0 / t_0));
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -8.5e-118], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
                                                    
                                                    \begin{array}{l}
                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                                    \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
                                                    \;\;\;\;t\_0 \cdot \left(-d\right)\\
                                                    
                                                    \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\
                                                    \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
                                                    
                                                    \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
                                                    \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                                                    
                                                    \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                                    \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 5 regimes
                                                    2. if d < -1.2499999999999999e111

                                                      1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

                                                      if -1.2499999999999999e111 < d < -8.50000000000000087e-118

                                                      1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                      6. Applied rewrites86.1%

                                                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                      7. Taylor expanded in M around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if -8.50000000000000087e-118 < d < 1.15e-204

                                                      1. Initial program 34.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 0

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

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

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

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

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

                                                          if 1.15e-204 < d < 2.49999999999999994e101

                                                          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. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          if 2.49999999999999994e101 < d

                                                          1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \]
                                                            5. Add Preprocessing

                                                            Alternative 9: 69.3% accurate, 3.3× speedup?

                                                            \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \end{array} \]
                                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                            (FPCore (d h l M D)
                                                             :precision binary64
                                                             (if (<= d -5e-182)
                                                               (*
                                                                (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                (-
                                                                 1.0
                                                                 (/ (* h (* (* 0.5 (* D (* 0.5 M))) (/ (* D M) (* d 2.0)))) (* d l))))
                                                               (if (<= d 1.15e-204)
                                                                 (/
                                                                  (fma
                                                                   (* (* M (* M (* D -0.125))) (/ D l))
                                                                   (sqrt (/ h l))
                                                                   (/ (* d d) (sqrt (* h l))))
                                                                  d)
                                                                 (if (<= d 2.5e+101)
                                                                   (/
                                                                    (*
                                                                     (/ d (sqrt l))
                                                                     (+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0)))))
                                                                    (sqrt h))
                                                                   (/ d (/ 1.0 (sqrt (/ 1.0 (* h l)))))))))
                                                            assert(d < h && h < l && l < M && M < D);
                                                            double code(double d, double h, double l, double M, double D) {
                                                            	double tmp;
                                                            	if (d <= -5e-182) {
                                                            		tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((h * ((0.5 * (D * (0.5 * M))) * ((D * M) / (d * 2.0)))) / (d * l)));
                                                            	} else if (d <= 1.15e-204) {
                                                            		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                                                            	} else if (d <= 2.5e+101) {
                                                            		tmp = ((d / sqrt(l)) * (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0))))) / sqrt(h);
                                                            	} else {
                                                            		tmp = d / (1.0 / sqrt((1.0 / (h * l))));
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            d, h, l, M, D = sort([d, h, l, M, D])
                                                            function code(d, h, l, M, D)
                                                            	tmp = 0.0
                                                            	if (d <= -5e-182)
                                                            		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(0.5 * Float64(D * Float64(0.5 * M))) * Float64(Float64(D * M) / Float64(d * 2.0)))) / Float64(d * l))));
                                                            	elseif (d <= 1.15e-204)
                                                            		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                                                            	elseif (d <= 2.5e+101)
                                                            		tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0))))) / sqrt(h));
                                                            	else
                                                            		tmp = Float64(d / Float64(1.0 / sqrt(Float64(1.0 / Float64(h * l)))));
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                            code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5e-182], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(0.5 * N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-204], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                            
                                                            \begin{array}{l}
                                                            [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;d \leq -5 \cdot 10^{-182}:\\
                                                            \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{h \cdot \left(\left(0.5 \cdot \left(D \cdot \left(0.5 \cdot M\right)\right)\right) \cdot \frac{D \cdot M}{d \cdot 2}\right)}{d \cdot \ell}\right)\\
                                                            
                                                            \mathbf{elif}\;d \leq 1.15 \cdot 10^{-204}:\\
                                                            \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                                                            
                                                            \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                                            \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}{\sqrt{h}}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 4 regimes
                                                            2. if d < -5.00000000000000024e-182

                                                              1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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.f6476.3

                                                                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                              6. Applied rewrites76.3%

                                                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                              7. Step-by-step derivation
                                                                1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              if -5.00000000000000024e-182 < d < 1.15e-204

                                                              1. Initial program 24.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 0

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

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

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

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

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

                                                                  if 1.15e-204 < d < 2.49999999999999994e101

                                                                  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. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  if 2.49999999999999994e101 < d

                                                                  1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

                                                                    Alternative 10: 63.7% accurate, 3.5× speedup?

                                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;t\_0 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{+101}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\ \end{array} \end{array} \]
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    (FPCore (d h l M D)
                                                                     :precision binary64
                                                                     (let* ((t_0 (sqrt (/ 1.0 (* h l)))))
                                                                       (if (<= d -1.25e+111)
                                                                         (* t_0 (- d))
                                                                         (if (<= d -8.5e-118)
                                                                           (*
                                                                            (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                            (fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
                                                                           (if (<= d 1.7e+101)
                                                                             (/
                                                                              (fma
                                                                               (* (* M (* M (* D -0.125))) (/ D l))
                                                                               (sqrt (/ h l))
                                                                               (/ (* d d) (sqrt (* h l))))
                                                                              d)
                                                                             (/ d (/ 1.0 t_0)))))))
                                                                    assert(d < h && h < l && l < M && M < D);
                                                                    double code(double d, double h, double l, double M, double D) {
                                                                    	double t_0 = sqrt((1.0 / (h * l)));
                                                                    	double tmp;
                                                                    	if (d <= -1.25e+111) {
                                                                    		tmp = t_0 * -d;
                                                                    	} else if (d <= -8.5e-118) {
                                                                    		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
                                                                    	} else if (d <= 1.7e+101) {
                                                                    		tmp = fma(((M * (M * (D * -0.125))) * (D / l)), sqrt((h / l)), ((d * d) / sqrt((h * l)))) / d;
                                                                    	} else {
                                                                    		tmp = d / (1.0 / t_0);
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                                    function code(d, h, l, M, D)
                                                                    	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
                                                                    	tmp = 0.0
                                                                    	if (d <= -1.25e+111)
                                                                    		tmp = Float64(t_0 * Float64(-d));
                                                                    	elseif (d <= -8.5e-118)
                                                                    		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0));
                                                                    	elseif (d <= 1.7e+101)
                                                                    		tmp = Float64(fma(Float64(Float64(M * Float64(M * Float64(D * -0.125))) * Float64(D / l)), sqrt(Float64(h / l)), Float64(Float64(d * d) / sqrt(Float64(h * l)))) / d);
                                                                    	else
                                                                    		tmp = Float64(d / Float64(1.0 / t_0));
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -8.5e-118], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e+101], N[(N[(N[(N[(M * N[(M * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(d * d), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], N[(d / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                    \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
                                                                    \;\;\;\;t\_0 \cdot \left(-d\right)\\
                                                                    
                                                                    \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\
                                                                    \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
                                                                    
                                                                    \mathbf{elif}\;d \leq 1.7 \cdot 10^{+101}:\\
                                                                    \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{d}{\frac{1}{t\_0}}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 4 regimes
                                                                    2. if d < -1.2499999999999999e111

                                                                      1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

                                                                      if -1.2499999999999999e111 < d < -8.50000000000000087e-118

                                                                      1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                                      6. Applied rewrites86.1%

                                                                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                                      7. Taylor expanded in M around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if -8.50000000000000087e-118 < d < 1.70000000000000009e101

                                                                      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 0

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

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

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

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

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

                                                                          if 1.70000000000000009e101 < d

                                                                          1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{+101}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(M \cdot \left(M \cdot \left(D \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell}, \sqrt{\frac{h}{\ell}}, \frac{d \cdot d}{\sqrt{h \cdot \ell}}\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \]
                                                                            5. Add Preprocessing

                                                                            Alternative 11: 60.8% accurate, 3.6× speedup?

                                                                            \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\ t_1 := \sqrt{\frac{1}{h \cdot \ell}}\\ t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;t\_1 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-122}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\ \;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\ \;\;\;\;t\_2 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_1}}\\ \end{array} \end{array} \]
                                                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                            (FPCore (d h l M D)
                                                                             :precision binary64
                                                                             (let* ((t_0 (* M (* D (* D M))))
                                                                                    (t_1 (sqrt (/ 1.0 (* h l))))
                                                                                    (t_2 (sqrt (/ h (* l (* l l))))))
                                                                               (if (<= d -1.25e+111)
                                                                                 (* t_1 (- d))
                                                                                 (if (<= d -2.1e-122)
                                                                                   (*
                                                                                    (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                                    (fma (* D (* D (* h (* M M)))) (/ -0.125 (* l (* d d))) 1.0))
                                                                                   (if (<= d -2.4e-302)
                                                                                     (* t_0 (* t_2 (/ 0.125 d)))
                                                                                     (if (<= d 8e-206)
                                                                                       (* t_2 (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                       (if (<= d 2.5e+101)
                                                                                         (*
                                                                                          (+ 1.0 (/ (* t_0 (* h -0.5)) (* l (* (* d d) 4.0))))
                                                                                          (/ d (sqrt (* h l))))
                                                                                         (/ d (/ 1.0 t_1)))))))))
                                                                            assert(d < h && h < l && l < M && M < D);
                                                                            double code(double d, double h, double l, double M, double D) {
                                                                            	double t_0 = M * (D * (D * M));
                                                                            	double t_1 = sqrt((1.0 / (h * l)));
                                                                            	double t_2 = sqrt((h / (l * (l * l))));
                                                                            	double tmp;
                                                                            	if (d <= -1.25e+111) {
                                                                            		tmp = t_1 * -d;
                                                                            	} else if (d <= -2.1e-122) {
                                                                            		tmp = (sqrt((d / h)) * sqrt((d / l))) * fma((D * (D * (h * (M * M)))), (-0.125 / (l * (d * d))), 1.0);
                                                                            	} else if (d <= -2.4e-302) {
                                                                            		tmp = t_0 * (t_2 * (0.125 / d));
                                                                            	} else if (d <= 8e-206) {
                                                                            		tmp = t_2 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                            	} else if (d <= 2.5e+101) {
                                                                            		tmp = (1.0 + ((t_0 * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
                                                                            	} else {
                                                                            		tmp = d / (1.0 / t_1);
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            d, h, l, M, D = sort([d, h, l, M, D])
                                                                            function code(d, h, l, M, D)
                                                                            	t_0 = Float64(M * Float64(D * Float64(D * M)))
                                                                            	t_1 = sqrt(Float64(1.0 / Float64(h * l)))
                                                                            	t_2 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                                            	tmp = 0.0
                                                                            	if (d <= -1.25e+111)
                                                                            		tmp = Float64(t_1 * Float64(-d));
                                                                            	elseif (d <= -2.1e-122)
                                                                            		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * fma(Float64(D * Float64(D * Float64(h * Float64(M * M)))), Float64(-0.125 / Float64(l * Float64(d * d))), 1.0));
                                                                            	elseif (d <= -2.4e-302)
                                                                            		tmp = Float64(t_0 * Float64(t_2 * Float64(0.125 / d)));
                                                                            	elseif (d <= 8e-206)
                                                                            		tmp = Float64(t_2 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                            	elseif (d <= 2.5e+101)
                                                                            		tmp = Float64(Float64(1.0 + Float64(Float64(t_0 * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0)))) * Float64(d / sqrt(Float64(h * l))));
                                                                            	else
                                                                            		tmp = Float64(d / Float64(1.0 / t_1));
                                                                            	end
                                                                            	return tmp
                                                                            end
                                                                            
                                                                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                            code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.25e+111], N[(t$95$1 * (-d)), $MachinePrecision], If[LessEqual[d, -2.1e-122], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.4e-302], N[(t$95$0 * N[(t$95$2 * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8e-206], N[(t$95$2 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(1.0 + N[(N[(t$95$0 * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]
                                                                            
                                                                            \begin{array}{l}
                                                                            [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                            \\
                                                                            \begin{array}{l}
                                                                            t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\
                                                                            t_1 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                            t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                                            \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\
                                                                            \;\;\;\;t\_1 \cdot \left(-d\right)\\
                                                                            
                                                                            \mathbf{elif}\;d \leq -2.1 \cdot 10^{-122}:\\
                                                                            \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\
                                                                            
                                                                            \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\
                                                                            \;\;\;\;t\_0 \cdot \left(t\_2 \cdot \frac{0.125}{d}\right)\\
                                                                            
                                                                            \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\
                                                                            \;\;\;\;t\_2 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                            
                                                                            \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                                                            \;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;\frac{d}{\frac{1}{t\_1}}\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 6 regimes
                                                                            2. if d < -1.2499999999999999e111

                                                                              1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

                                                                              if -1.2499999999999999e111 < d < -2.09999999999999992e-122

                                                                              1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                                              6. Applied rewrites84.5%

                                                                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \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) \]
                                                                              7. Taylor expanded in M around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              if -2.09999999999999992e-122 < d < -2.40000000000000022e-302

                                                                              1. Initial program 35.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                if -2.40000000000000022e-302 < d < 8.00000000000000023e-206

                                                                                1. Initial program 34.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                if 8.00000000000000023e-206 < d < 2.49999999999999994e101

                                                                                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. Applied rewrites83.1%

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

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

                                                                                if 2.49999999999999994e101 < d

                                                                                1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-122}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{-0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\ \;\;\;\;\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \]
                                                                                  5. Add Preprocessing

                                                                                  Alternative 12: 59.6% accurate, 3.6× speedup?

                                                                                  \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\ t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_2 := \sqrt{\frac{1}{h \cdot \ell}}\\ t_3 := \left(d \cdot d\right) \cdot 4\\ \mathbf{if}\;d \leq -1.6 \cdot 10^{+123}:\\ \;\;\;\;t\_2 \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -2.5 \cdot 10^{-130}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t\_0}{t\_3}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\ \;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot t\_3}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{t\_2}}\\ \end{array} \end{array} \]
                                                                                  NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                  (FPCore (d h l M D)
                                                                                   :precision binary64
                                                                                   (let* ((t_0 (* M (* D (* D M))))
                                                                                          (t_1 (sqrt (/ h (* l (* l l)))))
                                                                                          (t_2 (sqrt (/ 1.0 (* h l))))
                                                                                          (t_3 (* (* d d) 4.0)))
                                                                                     (if (<= d -1.6e+123)
                                                                                       (* t_2 (- d))
                                                                                       (if (<= d -2.5e-130)
                                                                                         (* (fma (/ t_0 t_3) (* (/ h l) -0.5) 1.0) (sqrt (/ (* d d) (* h l))))
                                                                                         (if (<= d -2.4e-302)
                                                                                           (* t_0 (* t_1 (/ 0.125 d)))
                                                                                           (if (<= d 8e-206)
                                                                                             (* t_1 (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                             (if (<= d 2.5e+101)
                                                                                               (* (+ 1.0 (/ (* t_0 (* h -0.5)) (* l t_3))) (/ d (sqrt (* h l))))
                                                                                               (/ d (/ 1.0 t_2)))))))))
                                                                                  assert(d < h && h < l && l < M && M < D);
                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                  	double t_0 = M * (D * (D * M));
                                                                                  	double t_1 = sqrt((h / (l * (l * l))));
                                                                                  	double t_2 = sqrt((1.0 / (h * l)));
                                                                                  	double t_3 = (d * d) * 4.0;
                                                                                  	double tmp;
                                                                                  	if (d <= -1.6e+123) {
                                                                                  		tmp = t_2 * -d;
                                                                                  	} else if (d <= -2.5e-130) {
                                                                                  		tmp = fma((t_0 / t_3), ((h / l) * -0.5), 1.0) * sqrt(((d * d) / (h * l)));
                                                                                  	} else if (d <= -2.4e-302) {
                                                                                  		tmp = t_0 * (t_1 * (0.125 / d));
                                                                                  	} else if (d <= 8e-206) {
                                                                                  		tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                  	} else if (d <= 2.5e+101) {
                                                                                  		tmp = (1.0 + ((t_0 * (h * -0.5)) / (l * t_3))) * (d / sqrt((h * l)));
                                                                                  	} else {
                                                                                  		tmp = d / (1.0 / t_2);
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  d, h, l, M, D = sort([d, h, l, M, D])
                                                                                  function code(d, h, l, M, D)
                                                                                  	t_0 = Float64(M * Float64(D * Float64(D * M)))
                                                                                  	t_1 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                                                  	t_2 = sqrt(Float64(1.0 / Float64(h * l)))
                                                                                  	t_3 = Float64(Float64(d * d) * 4.0)
                                                                                  	tmp = 0.0
                                                                                  	if (d <= -1.6e+123)
                                                                                  		tmp = Float64(t_2 * Float64(-d));
                                                                                  	elseif (d <= -2.5e-130)
                                                                                  		tmp = Float64(fma(Float64(t_0 / t_3), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(Float64(Float64(d * d) / Float64(h * l))));
                                                                                  	elseif (d <= -2.4e-302)
                                                                                  		tmp = Float64(t_0 * Float64(t_1 * Float64(0.125 / d)));
                                                                                  	elseif (d <= 8e-206)
                                                                                  		tmp = Float64(t_1 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                  	elseif (d <= 2.5e+101)
                                                                                  		tmp = Float64(Float64(1.0 + Float64(Float64(t_0 * Float64(h * -0.5)) / Float64(l * t_3))) * Float64(d / sqrt(Float64(h * l))));
                                                                                  	else
                                                                                  		tmp = Float64(d / Float64(1.0 / t_2));
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[d, -1.6e+123], N[(t$95$2 * (-d)), $MachinePrecision], If[LessEqual[d, -2.5e-130], N[(N[(N[(t$95$0 / t$95$3), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.4e-302], N[(t$95$0 * N[(t$95$1 * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8e-206], N[(t$95$1 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.5e+101], N[(N[(1.0 + N[(N[(t$95$0 * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  t_0 := M \cdot \left(D \cdot \left(D \cdot M\right)\right)\\
                                                                                  t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                                                  t_2 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                  t_3 := \left(d \cdot d\right) \cdot 4\\
                                                                                  \mathbf{if}\;d \leq -1.6 \cdot 10^{+123}:\\
                                                                                  \;\;\;\;t\_2 \cdot \left(-d\right)\\
                                                                                  
                                                                                  \mathbf{elif}\;d \leq -2.5 \cdot 10^{-130}:\\
                                                                                  \;\;\;\;\mathsf{fma}\left(\frac{t\_0}{t\_3}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\
                                                                                  
                                                                                  \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\
                                                                                  \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{0.125}{d}\right)\\
                                                                                  
                                                                                  \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\
                                                                                  \;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                  
                                                                                  \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\
                                                                                  \;\;\;\;\left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot t\_3}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\frac{d}{\frac{1}{t\_2}}\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 6 regimes
                                                                                  2. if d < -1.60000000000000002e123

                                                                                    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if -1.60000000000000002e123 < d < -2.4999999999999998e-130

                                                                                    1. Initial program 82.5%

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

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

                                                                                    if -2.4999999999999998e-130 < d < -2.40000000000000022e-302

                                                                                    1. Initial program 31.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      if -2.40000000000000022e-302 < d < 8.00000000000000023e-206

                                                                                      1. Initial program 34.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      if 8.00000000000000023e-206 < d < 2.49999999999999994e101

                                                                                      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. Applied rewrites83.1%

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

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

                                                                                      if 2.49999999999999994e101 < d

                                                                                      1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.6 \cdot 10^{+123}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -2.5 \cdot 10^{-130}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(D \cdot M\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-302}:\\ \;\;\;\;\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\frac{1}{\sqrt{\frac{1}{h \cdot \ell}}}}\\ \end{array} \]
                                                                                        5. Add Preprocessing

                                                                                        Alternative 13: 56.4% accurate, 4.0× speedup?

                                                                                        \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\ \;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+38}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                        (FPCore (d h l M D)
                                                                                         :precision binary64
                                                                                         (if (<= l -2.6e+59)
                                                                                           (* (sqrt (/ 1.0 (* h l))) (- d))
                                                                                           (if (<= l -4.5e-303)
                                                                                             (* (* D (sqrt (/ h (* l (* l l))))) (/ (* M (* D M)) (* d 8.0)))
                                                                                             (if (<= l 8.5e+38)
                                                                                               (*
                                                                                                (+ 1.0 (/ (* (* M (* D (* D M))) (* h -0.5)) (* l (* (* d d) 4.0))))
                                                                                                (/ d (sqrt (* h l))))
                                                                                               (/ d (* (sqrt h) (sqrt l)))))))
                                                                                        assert(d < h && h < l && l < M && M < D);
                                                                                        double code(double d, double h, double l, double M, double D) {
                                                                                        	double tmp;
                                                                                        	if (l <= -2.6e+59) {
                                                                                        		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                        	} else if (l <= -4.5e-303) {
                                                                                        		tmp = (D * sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
                                                                                        	} else if (l <= 8.5e+38) {
                                                                                        		tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
                                                                                        	} else {
                                                                                        		tmp = d / (sqrt(h) * sqrt(l));
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                        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
                                                                                            real(8) :: tmp
                                                                                            if (l <= (-2.6d+59)) then
                                                                                                tmp = sqrt((1.0d0 / (h * l))) * -d
                                                                                            else if (l <= (-4.5d-303)) then
                                                                                                tmp = (d_1 * sqrt((h / (l * (l * l))))) * ((m * (d_1 * m)) / (d * 8.0d0))
                                                                                            else if (l <= 8.5d+38) then
                                                                                                tmp = (1.0d0 + (((m * (d_1 * (d_1 * m))) * (h * (-0.5d0))) / (l * ((d * d) * 4.0d0)))) * (d / sqrt((h * l)))
                                                                                            else
                                                                                                tmp = d / (sqrt(h) * sqrt(l))
                                                                                            end if
                                                                                            code = tmp
                                                                                        end function
                                                                                        
                                                                                        assert d < h && h < l && l < M && M < D;
                                                                                        public static double code(double d, double h, double l, double M, double D) {
                                                                                        	double tmp;
                                                                                        	if (l <= -2.6e+59) {
                                                                                        		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                                                                        	} else if (l <= -4.5e-303) {
                                                                                        		tmp = (D * Math.sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
                                                                                        	} else if (l <= 8.5e+38) {
                                                                                        		tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / Math.sqrt((h * l)));
                                                                                        	} else {
                                                                                        		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                        def code(d, h, l, M, D):
                                                                                        	tmp = 0
                                                                                        	if l <= -2.6e+59:
                                                                                        		tmp = math.sqrt((1.0 / (h * l))) * -d
                                                                                        	elif l <= -4.5e-303:
                                                                                        		tmp = (D * math.sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0))
                                                                                        	elif l <= 8.5e+38:
                                                                                        		tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / math.sqrt((h * l)))
                                                                                        	else:
                                                                                        		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                        	return tmp
                                                                                        
                                                                                        d, h, l, M, D = sort([d, h, l, M, D])
                                                                                        function code(d, h, l, M, D)
                                                                                        	tmp = 0.0
                                                                                        	if (l <= -2.6e+59)
                                                                                        		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                                                                        	elseif (l <= -4.5e-303)
                                                                                        		tmp = Float64(Float64(D * sqrt(Float64(h / Float64(l * Float64(l * l))))) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0)));
                                                                                        	elseif (l <= 8.5e+38)
                                                                                        		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(h * -0.5)) / Float64(l * Float64(Float64(d * d) * 4.0)))) * Float64(d / sqrt(Float64(h * l))));
                                                                                        	else
                                                                                        		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                        	end
                                                                                        	return tmp
                                                                                        end
                                                                                        
                                                                                        d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                        function tmp_2 = code(d, h, l, M, D)
                                                                                        	tmp = 0.0;
                                                                                        	if (l <= -2.6e+59)
                                                                                        		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                        	elseif (l <= -4.5e-303)
                                                                                        		tmp = (D * sqrt((h / (l * (l * l))))) * ((M * (D * M)) / (d * 8.0));
                                                                                        	elseif (l <= 8.5e+38)
                                                                                        		tmp = (1.0 + (((M * (D * (D * M))) * (h * -0.5)) / (l * ((d * d) * 4.0)))) * (d / sqrt((h * l)));
                                                                                        	else
                                                                                        		tmp = d / (sqrt(h) * sqrt(l));
                                                                                        	end
                                                                                        	tmp_2 = tmp;
                                                                                        end
                                                                                        
                                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                        code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.6e+59], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, -4.5e-303], N[(N[(D * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+38], N[(N[(1.0 + N[(N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+59}:\\
                                                                                        \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                                                                        
                                                                                        \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\
                                                                                        \;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
                                                                                        
                                                                                        \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+38}:\\
                                                                                        \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                        
                                                                                        
                                                                                        \end{array}
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Split input into 4 regimes
                                                                                        2. if l < -2.59999999999999999e59

                                                                                          1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

                                                                                          if -2.59999999999999999e59 < l < -4.5000000000000001e-303

                                                                                          1. Initial program 70.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -4.5000000000000001e-303 < l < 8.4999999999999997e38

                                                                                            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. Applied rewrites73.6%

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

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

                                                                                            if 8.4999999999999997e38 < l

                                                                                            1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\ \;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+38}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
                                                                                              5. Add Preprocessing

                                                                                              Alternative 14: 48.5% accurate, 4.5× speedup?

                                                                                              \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;\ell \leq -1.5 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\ \;\;\;\;t\_1 \cdot \left(\frac{0.125}{d} \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 6.5 \cdot 10^{-226}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\ \;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                              (FPCore (d h l M D)
                                                                                               :precision binary64
                                                                                               (let* ((t_0 (/ d (* (sqrt h) (sqrt l)))) (t_1 (sqrt (/ h (* l (* l l))))))
                                                                                                 (if (<= l -1.5e-206)
                                                                                                   (* (sqrt (/ 1.0 (* h l))) (- d))
                                                                                                   (if (<= l -4.5e-303)
                                                                                                     (* t_1 (* (/ 0.125 d) (* D (* D (* M M)))))
                                                                                                     (if (<= l 6.5e-226)
                                                                                                       t_0
                                                                                                       (if (<= l 1.6e-145)
                                                                                                         (* t_1 (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                                         t_0))))))
                                                                                              assert(d < h && h < l && l < M && M < D);
                                                                                              double code(double d, double h, double l, double M, double D) {
                                                                                              	double t_0 = d / (sqrt(h) * sqrt(l));
                                                                                              	double t_1 = sqrt((h / (l * (l * l))));
                                                                                              	double tmp;
                                                                                              	if (l <= -1.5e-206) {
                                                                                              		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                              	} else if (l <= -4.5e-303) {
                                                                                              		tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
                                                                                              	} else if (l <= 6.5e-226) {
                                                                                              		tmp = t_0;
                                                                                              	} else if (l <= 1.6e-145) {
                                                                                              		tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                              	} else {
                                                                                              		tmp = t_0;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                              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
                                                                                                  real(8) :: t_0
                                                                                                  real(8) :: t_1
                                                                                                  real(8) :: tmp
                                                                                                  t_0 = d / (sqrt(h) * sqrt(l))
                                                                                                  t_1 = sqrt((h / (l * (l * l))))
                                                                                                  if (l <= (-1.5d-206)) then
                                                                                                      tmp = sqrt((1.0d0 / (h * l))) * -d
                                                                                                  else if (l <= (-4.5d-303)) then
                                                                                                      tmp = t_1 * ((0.125d0 / d) * (d_1 * (d_1 * (m * m))))
                                                                                                  else if (l <= 6.5d-226) then
                                                                                                      tmp = t_0
                                                                                                  else if (l <= 1.6d-145) then
                                                                                                      tmp = t_1 * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
                                                                                                  else
                                                                                                      tmp = t_0
                                                                                                  end if
                                                                                                  code = tmp
                                                                                              end function
                                                                                              
                                                                                              assert d < h && h < l && l < M && M < D;
                                                                                              public static double code(double d, double h, double l, double M, double D) {
                                                                                              	double t_0 = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                              	double t_1 = Math.sqrt((h / (l * (l * l))));
                                                                                              	double tmp;
                                                                                              	if (l <= -1.5e-206) {
                                                                                              		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                                                                              	} else if (l <= -4.5e-303) {
                                                                                              		tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
                                                                                              	} else if (l <= 6.5e-226) {
                                                                                              		tmp = t_0;
                                                                                              	} else if (l <= 1.6e-145) {
                                                                                              		tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                              	} else {
                                                                                              		tmp = t_0;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                              def code(d, h, l, M, D):
                                                                                              	t_0 = d / (math.sqrt(h) * math.sqrt(l))
                                                                                              	t_1 = math.sqrt((h / (l * (l * l))))
                                                                                              	tmp = 0
                                                                                              	if l <= -1.5e-206:
                                                                                              		tmp = math.sqrt((1.0 / (h * l))) * -d
                                                                                              	elif l <= -4.5e-303:
                                                                                              		tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))))
                                                                                              	elif l <= 6.5e-226:
                                                                                              		tmp = t_0
                                                                                              	elif l <= 1.6e-145:
                                                                                              		tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d))
                                                                                              	else:
                                                                                              		tmp = t_0
                                                                                              	return tmp
                                                                                              
                                                                                              d, h, l, M, D = sort([d, h, l, M, D])
                                                                                              function code(d, h, l, M, D)
                                                                                              	t_0 = Float64(d / Float64(sqrt(h) * sqrt(l)))
                                                                                              	t_1 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                                                              	tmp = 0.0
                                                                                              	if (l <= -1.5e-206)
                                                                                              		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                                                                              	elseif (l <= -4.5e-303)
                                                                                              		tmp = Float64(t_1 * Float64(Float64(0.125 / d) * Float64(D * Float64(D * Float64(M * M)))));
                                                                                              	elseif (l <= 6.5e-226)
                                                                                              		tmp = t_0;
                                                                                              	elseif (l <= 1.6e-145)
                                                                                              		tmp = Float64(t_1 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                              	else
                                                                                              		tmp = t_0;
                                                                                              	end
                                                                                              	return tmp
                                                                                              end
                                                                                              
                                                                                              d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                              function tmp_2 = code(d, h, l, M, D)
                                                                                              	t_0 = d / (sqrt(h) * sqrt(l));
                                                                                              	t_1 = sqrt((h / (l * (l * l))));
                                                                                              	tmp = 0.0;
                                                                                              	if (l <= -1.5e-206)
                                                                                              		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                              	elseif (l <= -4.5e-303)
                                                                                              		tmp = t_1 * ((0.125 / d) * (D * (D * (M * M))));
                                                                                              	elseif (l <= 6.5e-226)
                                                                                              		tmp = t_0;
                                                                                              	elseif (l <= 1.6e-145)
                                                                                              		tmp = t_1 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                              	else
                                                                                              		tmp = t_0;
                                                                                              	end
                                                                                              	tmp_2 = tmp;
                                                                                              end
                                                                                              
                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                              code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.5e-206], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, -4.5e-303], N[(t$95$1 * N[(N[(0.125 / d), $MachinePrecision] * N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.5e-226], t$95$0, If[LessEqual[l, 1.6e-145], N[(t$95$1 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                              \\
                                                                                              \begin{array}{l}
                                                                                              t_0 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                              t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                                                              \mathbf{if}\;\ell \leq -1.5 \cdot 10^{-206}:\\
                                                                                              \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                                                                              
                                                                                              \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\
                                                                                              \;\;\;\;t\_1 \cdot \left(\frac{0.125}{d} \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)\right)\\
                                                                                              
                                                                                              \mathbf{elif}\;\ell \leq 6.5 \cdot 10^{-226}:\\
                                                                                              \;\;\;\;t\_0\\
                                                                                              
                                                                                              \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\
                                                                                              \;\;\;\;t\_1 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                              
                                                                                              \mathbf{else}:\\
                                                                                              \;\;\;\;t\_0\\
                                                                                              
                                                                                              
                                                                                              \end{array}
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Split input into 4 regimes
                                                                                              2. if l < -1.5000000000000001e-206

                                                                                                1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                if -1.5000000000000001e-206 < l < -4.5000000000000001e-303

                                                                                                1. Initial program 54.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                if -4.5000000000000001e-303 < l < 6.50000000000000033e-226 or 1.60000000000000004e-145 < l

                                                                                                1. Initial program 63.9%

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

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

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

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

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

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

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

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

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

                                                                                                    if 6.50000000000000033e-226 < l < 1.60000000000000004e-145

                                                                                                    1. Initial program 79.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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.5 \cdot 10^{-206}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq -4.5 \cdot 10^{-303}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{0.125}{d} \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 6.5 \cdot 10^{-226}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
                                                                                                  5. Add Preprocessing

                                                                                                  Alternative 15: 46.8% accurate, 4.8× speedup?

                                                                                                  \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;h \leq -32:\\ \;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot \frac{M \cdot M}{d}\right) \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)\\ \end{array} \end{array} \]
                                                                                                  NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                  (FPCore (d h l M D)
                                                                                                   :precision binary64
                                                                                                   (let* ((t_0 (sqrt (/ h (* l (* l l))))))
                                                                                                     (if (<= h -32.0)
                                                                                                       (* (* D t_0) (/ (* M (* D M)) (* d 8.0)))
                                                                                                       (if (<= h -5e-310)
                                                                                                         (* (sqrt (/ 1.0 (* h l))) (- d))
                                                                                                         (if (<= h 9e+140)
                                                                                                           (/ d (* (sqrt h) (sqrt l)))
                                                                                                           (* (* t_0 (/ (* M M) d)) (* -0.125 (* D D))))))))
                                                                                                  assert(d < h && h < l && l < M && M < D);
                                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                                  	double t_0 = sqrt((h / (l * (l * l))));
                                                                                                  	double tmp;
                                                                                                  	if (h <= -32.0) {
                                                                                                  		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                  	} else if (h <= -5e-310) {
                                                                                                  		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                  	} else if (h <= 9e+140) {
                                                                                                  		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                  	} else {
                                                                                                  		tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                  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
                                                                                                      real(8) :: t_0
                                                                                                      real(8) :: tmp
                                                                                                      t_0 = sqrt((h / (l * (l * l))))
                                                                                                      if (h <= (-32.0d0)) then
                                                                                                          tmp = (d_1 * t_0) * ((m * (d_1 * m)) / (d * 8.0d0))
                                                                                                      else if (h <= (-5d-310)) then
                                                                                                          tmp = sqrt((1.0d0 / (h * l))) * -d
                                                                                                      else if (h <= 9d+140) then
                                                                                                          tmp = d / (sqrt(h) * sqrt(l))
                                                                                                      else
                                                                                                          tmp = (t_0 * ((m * m) / d)) * ((-0.125d0) * (d_1 * d_1))
                                                                                                      end if
                                                                                                      code = tmp
                                                                                                  end function
                                                                                                  
                                                                                                  assert d < h && h < l && l < M && M < D;
                                                                                                  public static double code(double d, double h, double l, double M, double D) {
                                                                                                  	double t_0 = Math.sqrt((h / (l * (l * l))));
                                                                                                  	double tmp;
                                                                                                  	if (h <= -32.0) {
                                                                                                  		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                  	} else if (h <= -5e-310) {
                                                                                                  		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                                                                                  	} else if (h <= 9e+140) {
                                                                                                  		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                                  	} else {
                                                                                                  		tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                  def code(d, h, l, M, D):
                                                                                                  	t_0 = math.sqrt((h / (l * (l * l))))
                                                                                                  	tmp = 0
                                                                                                  	if h <= -32.0:
                                                                                                  		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0))
                                                                                                  	elif h <= -5e-310:
                                                                                                  		tmp = math.sqrt((1.0 / (h * l))) * -d
                                                                                                  	elif h <= 9e+140:
                                                                                                  		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                                  	else:
                                                                                                  		tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D))
                                                                                                  	return tmp
                                                                                                  
                                                                                                  d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                  function code(d, h, l, M, D)
                                                                                                  	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                                                                  	tmp = 0.0
                                                                                                  	if (h <= -32.0)
                                                                                                  		tmp = Float64(Float64(D * t_0) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0)));
                                                                                                  	elseif (h <= -5e-310)
                                                                                                  		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                                                                                  	elseif (h <= 9e+140)
                                                                                                  		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                  	else
                                                                                                  		tmp = Float64(Float64(t_0 * Float64(Float64(M * M) / d)) * Float64(-0.125 * Float64(D * D)));
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                  function tmp_2 = code(d, h, l, M, D)
                                                                                                  	t_0 = sqrt((h / (l * (l * l))));
                                                                                                  	tmp = 0.0;
                                                                                                  	if (h <= -32.0)
                                                                                                  		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                  	elseif (h <= -5e-310)
                                                                                                  		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                  	elseif (h <= 9e+140)
                                                                                                  		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                  	else
                                                                                                  		tmp = (t_0 * ((M * M) / d)) * (-0.125 * (D * D));
                                                                                                  	end
                                                                                                  	tmp_2 = tmp;
                                                                                                  end
                                                                                                  
                                                                                                  NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -32.0], N[(N[(D * t$95$0), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[h, 9e+140], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                                                                  \mathbf{if}\;h \leq -32:\\
                                                                                                  \;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
                                                                                                  
                                                                                                  \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
                                                                                                  \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                                                                                  
                                                                                                  \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\
                                                                                                  \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;\left(t\_0 \cdot \frac{M \cdot M}{d}\right) \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 4 regimes
                                                                                                  2. if h < -32

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      7. unpow2N/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      8. lower-*.f64N/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      9. unpow2N/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      10. lower-*.f64N/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      11. metadata-evalN/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                      12. distribute-lft-neg-inN/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)} \]
                                                                                                      13. distribute-rgt-neg-inN/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\frac{1}{8} \cdot \left(\mathsf{neg}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right)} \]
                                                                                                      14. distribute-neg-fracN/A

                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{1}{8} \cdot \color{blue}{\frac{\mathsf{neg}\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}{d}}\right) \]
                                                                                                    5. Applied rewrites41.1%

                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
                                                                                                    6. Step-by-step derivation
                                                                                                      1. Applied rewrites44.0%

                                                                                                        \[\leadsto \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot D\right) \cdot \color{blue}{\frac{M \cdot \left(M \cdot D\right)}{d \cdot 8}} \]

                                                                                                      if -32 < h < -4.999999999999985e-310

                                                                                                      1. Initial program 70.3%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in l around -inf

                                                                                                        \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. *-commutativeN/A

                                                                                                          \[\leadsto \color{blue}{\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. *-commutativeN/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                        5. lower-*.f64N/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                        6. lower-sqrt.f64N/A

                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                        7. lower-/.f64N/A

                                                                                                          \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                        8. lower-*.f64N/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                        9. mul-1-negN/A

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                        10. lower-neg.f6469.5

                                                                                                          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                      5. Applied rewrites69.5%

                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                      if -4.999999999999985e-310 < h < 9.0000000000000003e140

                                                                                                      1. Initial program 67.0%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Taylor expanded in d around inf

                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. lower-*.f64N/A

                                                                                                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                        2. lower-sqrt.f64N/A

                                                                                                          \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                        3. lower-/.f64N/A

                                                                                                          \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                        4. lower-*.f6456.6

                                                                                                          \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                      5. Applied rewrites56.6%

                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                      6. Step-by-step derivation
                                                                                                        1. Applied rewrites56.6%

                                                                                                          \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                        2. Step-by-step derivation
                                                                                                          1. Applied rewrites60.3%

                                                                                                            \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                                                                                                          if 9.0000000000000003e140 < h

                                                                                                          1. Initial program 62.6%

                                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                          2. Add Preprocessing
                                                                                                          3. Taylor expanded in d around inf

                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. lower-*.f64N/A

                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                            2. lower-sqrt.f64N/A

                                                                                                              \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                            3. lower-/.f64N/A

                                                                                                              \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                            4. lower-*.f6425.1

                                                                                                              \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                          5. Applied rewrites25.1%

                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                          6. Step-by-step derivation
                                                                                                            1. Applied rewrites18.5%

                                                                                                              \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                                                                                                            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. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\right) \cdot {D}^{2}} \]
                                                                                                              7. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\left(\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{-1}{8}\right)} \cdot {D}^{2} \]
                                                                                                              8. associate-*l*N/A

                                                                                                                \[\leadsto \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \left(\frac{-1}{8} \cdot {D}^{2}\right)} \]
                                                                                                              9. lower-*.f64N/A

                                                                                                                \[\leadsto \color{blue}{\left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \left(\frac{-1}{8} \cdot {D}^{2}\right)} \]
                                                                                                            4. Applied rewrites45.5%

                                                                                                              \[\leadsto \color{blue}{\left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{M \cdot M}{d}\right) \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)} \]
                                                                                                          7. Recombined 4 regimes into one program.
                                                                                                          8. Final simplification56.7%

                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -32:\\ \;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{M \cdot M}{d}\right) \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)\\ \end{array} \]
                                                                                                          9. Add Preprocessing

                                                                                                          Alternative 16: 46.9% accurate, 4.8× speedup?

                                                                                                          \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;h \leq -32:\\ \;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \end{array} \end{array} \]
                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                          (FPCore (d h l M D)
                                                                                                           :precision binary64
                                                                                                           (let* ((t_0 (sqrt (/ h (* l (* l l))))))
                                                                                                             (if (<= h -32.0)
                                                                                                               (* (* D t_0) (/ (* M (* D M)) (* d 8.0)))
                                                                                                               (if (<= h -5e-310)
                                                                                                                 (* (sqrt (/ 1.0 (* h l))) (- d))
                                                                                                                 (if (<= h 9e+140)
                                                                                                                   (/ d (* (sqrt h) (sqrt l)))
                                                                                                                   (* t_0 (* (* D D) (/ (* -0.125 (* M M)) d))))))))
                                                                                                          assert(d < h && h < l && l < M && M < D);
                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                          	double t_0 = sqrt((h / (l * (l * l))));
                                                                                                          	double tmp;
                                                                                                          	if (h <= -32.0) {
                                                                                                          		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                          	} else if (h <= -5e-310) {
                                                                                                          		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                          	} else if (h <= 9e+140) {
                                                                                                          		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                          	} else {
                                                                                                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                          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
                                                                                                              real(8) :: t_0
                                                                                                              real(8) :: tmp
                                                                                                              t_0 = sqrt((h / (l * (l * l))))
                                                                                                              if (h <= (-32.0d0)) then
                                                                                                                  tmp = (d_1 * t_0) * ((m * (d_1 * m)) / (d * 8.0d0))
                                                                                                              else if (h <= (-5d-310)) then
                                                                                                                  tmp = sqrt((1.0d0 / (h * l))) * -d
                                                                                                              else if (h <= 9d+140) then
                                                                                                                  tmp = d / (sqrt(h) * sqrt(l))
                                                                                                              else
                                                                                                                  tmp = t_0 * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
                                                                                                              end if
                                                                                                              code = tmp
                                                                                                          end function
                                                                                                          
                                                                                                          assert d < h && h < l && l < M && M < D;
                                                                                                          public static double code(double d, double h, double l, double M, double D) {
                                                                                                          	double t_0 = Math.sqrt((h / (l * (l * l))));
                                                                                                          	double tmp;
                                                                                                          	if (h <= -32.0) {
                                                                                                          		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                          	} else if (h <= -5e-310) {
                                                                                                          		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                                                                                          	} else if (h <= 9e+140) {
                                                                                                          		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                                          	} else {
                                                                                                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                          def code(d, h, l, M, D):
                                                                                                          	t_0 = math.sqrt((h / (l * (l * l))))
                                                                                                          	tmp = 0
                                                                                                          	if h <= -32.0:
                                                                                                          		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0))
                                                                                                          	elif h <= -5e-310:
                                                                                                          		tmp = math.sqrt((1.0 / (h * l))) * -d
                                                                                                          	elif h <= 9e+140:
                                                                                                          		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                                          	else:
                                                                                                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d))
                                                                                                          	return tmp
                                                                                                          
                                                                                                          d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                          function code(d, h, l, M, D)
                                                                                                          	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                                                                          	tmp = 0.0
                                                                                                          	if (h <= -32.0)
                                                                                                          		tmp = Float64(Float64(D * t_0) * Float64(Float64(M * Float64(D * M)) / Float64(d * 8.0)));
                                                                                                          	elseif (h <= -5e-310)
                                                                                                          		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                                                                                          	elseif (h <= 9e+140)
                                                                                                          		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                          	else
                                                                                                          		tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                          function tmp_2 = code(d, h, l, M, D)
                                                                                                          	t_0 = sqrt((h / (l * (l * l))));
                                                                                                          	tmp = 0.0;
                                                                                                          	if (h <= -32.0)
                                                                                                          		tmp = (D * t_0) * ((M * (D * M)) / (d * 8.0));
                                                                                                          	elseif (h <= -5e-310)
                                                                                                          		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                          	elseif (h <= 9e+140)
                                                                                                          		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                          	else
                                                                                                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                          	end
                                                                                                          	tmp_2 = tmp;
                                                                                                          end
                                                                                                          
                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -32.0], N[(N[(D * t$95$0), $MachinePrecision] * N[(N[(M * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[h, 9e+140], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                                                                          \mathbf{if}\;h \leq -32:\\
                                                                                                          \;\;\;\;\left(D \cdot t\_0\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\
                                                                                                          
                                                                                                          \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
                                                                                                          \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                                                                                          
                                                                                                          \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\
                                                                                                          \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 4 regimes
                                                                                                          2. if h < -32

                                                                                                            1. Initial program 59.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 h around -inf

                                                                                                              \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                            4. Step-by-step derivation
                                                                                                              1. associate-*r*N/A

                                                                                                                \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                              2. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                              3. lower-*.f64N/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                              4. lower-sqrt.f64N/A

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              5. lower-/.f64N/A

                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              6. cube-multN/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              7. unpow2N/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              8. lower-*.f64N/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              9. unpow2N/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              10. lower-*.f64N/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              11. metadata-evalN/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                              12. distribute-lft-neg-inN/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)} \]
                                                                                                              13. distribute-rgt-neg-inN/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\frac{1}{8} \cdot \left(\mathsf{neg}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right)} \]
                                                                                                              14. distribute-neg-fracN/A

                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{1}{8} \cdot \color{blue}{\frac{\mathsf{neg}\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}{d}}\right) \]
                                                                                                            5. Applied rewrites41.1%

                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
                                                                                                            6. Step-by-step derivation
                                                                                                              1. Applied rewrites44.0%

                                                                                                                \[\leadsto \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot D\right) \cdot \color{blue}{\frac{M \cdot \left(M \cdot D\right)}{d \cdot 8}} \]

                                                                                                              if -32 < h < -4.999999999999985e-310

                                                                                                              1. Initial program 70.3%

                                                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                              2. Add Preprocessing
                                                                                                              3. Taylor expanded in l around -inf

                                                                                                                \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              4. Step-by-step derivation
                                                                                                                1. *-commutativeN/A

                                                                                                                  \[\leadsto \color{blue}{\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. *-commutativeN/A

                                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                5. lower-*.f64N/A

                                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                6. lower-sqrt.f64N/A

                                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                7. lower-/.f64N/A

                                                                                                                  \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                8. lower-*.f64N/A

                                                                                                                  \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                9. mul-1-negN/A

                                                                                                                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                10. lower-neg.f6469.5

                                                                                                                  \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                              5. Applied rewrites69.5%

                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                              if -4.999999999999985e-310 < h < 9.0000000000000003e140

                                                                                                              1. Initial program 67.0%

                                                                                                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                              2. Add Preprocessing
                                                                                                              3. Taylor expanded in d around inf

                                                                                                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              4. Step-by-step derivation
                                                                                                                1. lower-*.f64N/A

                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                2. lower-sqrt.f64N/A

                                                                                                                  \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                3. lower-/.f64N/A

                                                                                                                  \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                4. lower-*.f6456.6

                                                                                                                  \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                              5. Applied rewrites56.6%

                                                                                                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                              6. Step-by-step derivation
                                                                                                                1. Applied rewrites56.6%

                                                                                                                  \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                2. Step-by-step derivation
                                                                                                                  1. Applied rewrites60.3%

                                                                                                                    \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]

                                                                                                                  if 9.0000000000000003e140 < h

                                                                                                                  1. Initial program 62.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 0

                                                                                                                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                  4. Step-by-step derivation
                                                                                                                    1. associate-*r*N/A

                                                                                                                      \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                    2. *-commutativeN/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                    3. lower-*.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                    4. lower-sqrt.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    5. lower-/.f64N/A

                                                                                                                      \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    6. cube-multN/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    7. unpow2N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    8. lower-*.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    9. unpow2N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    10. lower-*.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                    11. associate-*r/N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d}} \]
                                                                                                                    12. *-commutativeN/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left({M}^{2} \cdot {D}^{2}\right)}}{d} \]
                                                                                                                    13. associate-*r*N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}}{d} \]
                                                                                                                    14. *-commutativeN/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}}{d} \]
                                                                                                                    15. associate-*r/N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \frac{\frac{-1}{8} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                    16. associate-*r/N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right) \]
                                                                                                                    17. lower-*.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right)} \]
                                                                                                                    18. unpow2N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                    19. lower-*.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                    20. associate-*r/N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                    21. lower-/.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                  5. Applied rewrites45.5%

                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)} \]
                                                                                                                3. Recombined 4 regimes into one program.
                                                                                                                4. Final simplification56.7%

                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -32:\\ \;\;\;\;\left(D \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right) \cdot \frac{M \cdot \left(D \cdot M\right)}{d \cdot 8}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq 9 \cdot 10^{+140}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \end{array} \]
                                                                                                                5. Add Preprocessing

                                                                                                                Alternative 17: 46.7% accurate, 4.8× speedup?

                                                                                                                \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \frac{1}{h \cdot \ell}\\ \mathbf{if}\;\ell \leq -2.9 \cdot 10^{-222}:\\ \;\;\;\;\sqrt{t\_0} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                                                NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                (FPCore (d h l M D)
                                                                                                                 :precision binary64
                                                                                                                 (let* ((t_0 (/ 1.0 (* h l))))
                                                                                                                   (if (<= l -2.9e-222)
                                                                                                                     (* (sqrt t_0) (- d))
                                                                                                                     (if (<= l 4.5e-226)
                                                                                                                       (* d (sqrt (sqrt (* t_0 t_0))))
                                                                                                                       (if (<= l 1.6e-145)
                                                                                                                         (* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                                                         (/ d (* (sqrt h) (sqrt l))))))))
                                                                                                                assert(d < h && h < l && l < M && M < D);
                                                                                                                double code(double d, double h, double l, double M, double D) {
                                                                                                                	double t_0 = 1.0 / (h * l);
                                                                                                                	double tmp;
                                                                                                                	if (l <= -2.9e-222) {
                                                                                                                		tmp = sqrt(t_0) * -d;
                                                                                                                	} else if (l <= 4.5e-226) {
                                                                                                                		tmp = d * sqrt(sqrt((t_0 * t_0)));
                                                                                                                	} else if (l <= 1.6e-145) {
                                                                                                                		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                	} else {
                                                                                                                		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                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
                                                                                                                    real(8) :: t_0
                                                                                                                    real(8) :: tmp
                                                                                                                    t_0 = 1.0d0 / (h * l)
                                                                                                                    if (l <= (-2.9d-222)) then
                                                                                                                        tmp = sqrt(t_0) * -d
                                                                                                                    else if (l <= 4.5d-226) then
                                                                                                                        tmp = d * sqrt(sqrt((t_0 * t_0)))
                                                                                                                    else if (l <= 1.6d-145) then
                                                                                                                        tmp = sqrt((h / (l * (l * l)))) * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
                                                                                                                    else
                                                                                                                        tmp = d / (sqrt(h) * sqrt(l))
                                                                                                                    end if
                                                                                                                    code = tmp
                                                                                                                end function
                                                                                                                
                                                                                                                assert d < h && h < l && l < M && M < D;
                                                                                                                public static double code(double d, double h, double l, double M, double D) {
                                                                                                                	double t_0 = 1.0 / (h * l);
                                                                                                                	double tmp;
                                                                                                                	if (l <= -2.9e-222) {
                                                                                                                		tmp = Math.sqrt(t_0) * -d;
                                                                                                                	} else if (l <= 4.5e-226) {
                                                                                                                		tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
                                                                                                                	} else if (l <= 1.6e-145) {
                                                                                                                		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                	} else {
                                                                                                                		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                def code(d, h, l, M, D):
                                                                                                                	t_0 = 1.0 / (h * l)
                                                                                                                	tmp = 0
                                                                                                                	if l <= -2.9e-222:
                                                                                                                		tmp = math.sqrt(t_0) * -d
                                                                                                                	elif l <= 4.5e-226:
                                                                                                                		tmp = d * math.sqrt(math.sqrt((t_0 * t_0)))
                                                                                                                	elif l <= 1.6e-145:
                                                                                                                		tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d))
                                                                                                                	else:
                                                                                                                		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                                                	return tmp
                                                                                                                
                                                                                                                d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                function code(d, h, l, M, D)
                                                                                                                	t_0 = Float64(1.0 / Float64(h * l))
                                                                                                                	tmp = 0.0
                                                                                                                	if (l <= -2.9e-222)
                                                                                                                		tmp = Float64(sqrt(t_0) * Float64(-d));
                                                                                                                	elseif (l <= 4.5e-226)
                                                                                                                		tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0))));
                                                                                                                	elseif (l <= 1.6e-145)
                                                                                                                		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                                                	else
                                                                                                                		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                                	end
                                                                                                                	return tmp
                                                                                                                end
                                                                                                                
                                                                                                                d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                function tmp_2 = code(d, h, l, M, D)
                                                                                                                	t_0 = 1.0 / (h * l);
                                                                                                                	tmp = 0.0;
                                                                                                                	if (l <= -2.9e-222)
                                                                                                                		tmp = sqrt(t_0) * -d;
                                                                                                                	elseif (l <= 4.5e-226)
                                                                                                                		tmp = d * sqrt(sqrt((t_0 * t_0)));
                                                                                                                	elseif (l <= 1.6e-145)
                                                                                                                		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                	else
                                                                                                                		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                	end
                                                                                                                	tmp_2 = tmp;
                                                                                                                end
                                                                                                                
                                                                                                                NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.9e-222], N[(N[Sqrt[t$95$0], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, 4.5e-226], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e-145], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                                                                
                                                                                                                \begin{array}{l}
                                                                                                                [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                \\
                                                                                                                \begin{array}{l}
                                                                                                                t_0 := \frac{1}{h \cdot \ell}\\
                                                                                                                \mathbf{if}\;\ell \leq -2.9 \cdot 10^{-222}:\\
                                                                                                                \;\;\;\;\sqrt{t\_0} \cdot \left(-d\right)\\
                                                                                                                
                                                                                                                \mathbf{elif}\;\ell \leq 4.5 \cdot 10^{-226}:\\
                                                                                                                \;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\
                                                                                                                
                                                                                                                \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\
                                                                                                                \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                                                
                                                                                                                \mathbf{else}:\\
                                                                                                                \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                                
                                                                                                                
                                                                                                                \end{array}
                                                                                                                \end{array}
                                                                                                                
                                                                                                                Derivation
                                                                                                                1. Split input into 4 regimes
                                                                                                                2. if l < -2.9000000000000002e-222

                                                                                                                  1. Initial program 66.0%

                                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                  2. Add Preprocessing
                                                                                                                  3. Taylor expanded in l around -inf

                                                                                                                    \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                  4. Step-by-step derivation
                                                                                                                    1. *-commutativeN/A

                                                                                                                      \[\leadsto \color{blue}{\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. *-commutativeN/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                    5. lower-*.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                    6. lower-sqrt.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                    7. lower-/.f64N/A

                                                                                                                      \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                    8. lower-*.f64N/A

                                                                                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                    9. mul-1-negN/A

                                                                                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                    10. lower-neg.f6452.0

                                                                                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                  5. Applied rewrites52.0%

                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                  if -2.9000000000000002e-222 < l < 4.50000000000000011e-226

                                                                                                                  1. Initial program 63.7%

                                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                  2. Add Preprocessing
                                                                                                                  3. Taylor expanded in d around inf

                                                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                  4. Step-by-step derivation
                                                                                                                    1. lower-*.f64N/A

                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                    2. lower-sqrt.f64N/A

                                                                                                                      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                    3. lower-/.f64N/A

                                                                                                                      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                    4. lower-*.f6428.2

                                                                                                                      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                  5. Applied rewrites28.2%

                                                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                  6. Step-by-step derivation
                                                                                                                    1. Applied rewrites38.3%

                                                                                                                      \[\leadsto d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}}} \]

                                                                                                                    if 4.50000000000000011e-226 < l < 1.60000000000000004e-145

                                                                                                                    1. Initial program 79.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 0

                                                                                                                      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                    4. Step-by-step derivation
                                                                                                                      1. associate-*r*N/A

                                                                                                                        \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                      2. *-commutativeN/A

                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                      3. lower-*.f64N/A

                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                      4. lower-sqrt.f64N/A

                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      5. lower-/.f64N/A

                                                                                                                        \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      6. cube-multN/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      7. unpow2N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      8. lower-*.f64N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      9. unpow2N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      10. lower-*.f64N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                      11. associate-*r/N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d}} \]
                                                                                                                      12. *-commutativeN/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left({M}^{2} \cdot {D}^{2}\right)}}{d} \]
                                                                                                                      13. associate-*r*N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}}{d} \]
                                                                                                                      14. *-commutativeN/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}}{d} \]
                                                                                                                      15. associate-*r/N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \frac{\frac{-1}{8} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                      16. associate-*r/N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right) \]
                                                                                                                      17. lower-*.f64N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right)} \]
                                                                                                                      18. unpow2N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                      19. lower-*.f64N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                      20. associate-*r/N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                      21. lower-/.f64N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                    5. Applied rewrites68.8%

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)} \]

                                                                                                                    if 1.60000000000000004e-145 < l

                                                                                                                    1. Initial program 62.2%

                                                                                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                    2. Add Preprocessing
                                                                                                                    3. Taylor expanded in d around inf

                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                    4. Step-by-step derivation
                                                                                                                      1. lower-*.f64N/A

                                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                      2. lower-sqrt.f64N/A

                                                                                                                        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                      3. lower-/.f64N/A

                                                                                                                        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                      4. lower-*.f6457.7

                                                                                                                        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                    5. Applied rewrites57.7%

                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                    6. Step-by-step derivation
                                                                                                                      1. Applied rewrites57.7%

                                                                                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites60.7%

                                                                                                                          \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                                      3. Recombined 4 regimes into one program.
                                                                                                                      4. Final simplification54.4%

                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.9 \cdot 10^{-222}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}}}\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-145}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
                                                                                                                      5. Add Preprocessing

                                                                                                                      Alternative 18: 46.8% accurate, 9.6× speedup?

                                                                                                                      \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                                                      NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                      (FPCore (d h l M D)
                                                                                                                       :precision binary64
                                                                                                                       (if (<= l 3e-298)
                                                                                                                         (* (sqrt (/ 1.0 (* h l))) (- d))
                                                                                                                         (/ d (* (sqrt h) (sqrt l)))))
                                                                                                                      assert(d < h && h < l && l < M && M < D);
                                                                                                                      double code(double d, double h, double l, double M, double D) {
                                                                                                                      	double tmp;
                                                                                                                      	if (l <= 3e-298) {
                                                                                                                      		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                                      	} else {
                                                                                                                      		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                      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
                                                                                                                          real(8) :: tmp
                                                                                                                          if (l <= 3d-298) then
                                                                                                                              tmp = sqrt((1.0d0 / (h * l))) * -d
                                                                                                                          else
                                                                                                                              tmp = d / (sqrt(h) * sqrt(l))
                                                                                                                          end if
                                                                                                                          code = tmp
                                                                                                                      end function
                                                                                                                      
                                                                                                                      assert d < h && h < l && l < M && M < D;
                                                                                                                      public static double code(double d, double h, double l, double M, double D) {
                                                                                                                      	double tmp;
                                                                                                                      	if (l <= 3e-298) {
                                                                                                                      		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                                                                                                      	} else {
                                                                                                                      		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                      def code(d, h, l, M, D):
                                                                                                                      	tmp = 0
                                                                                                                      	if l <= 3e-298:
                                                                                                                      		tmp = math.sqrt((1.0 / (h * l))) * -d
                                                                                                                      	else:
                                                                                                                      		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                                                      	return tmp
                                                                                                                      
                                                                                                                      d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                      function code(d, h, l, M, D)
                                                                                                                      	tmp = 0.0
                                                                                                                      	if (l <= 3e-298)
                                                                                                                      		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                                                                                                      	else
                                                                                                                      		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                      function tmp_2 = code(d, h, l, M, D)
                                                                                                                      	tmp = 0.0;
                                                                                                                      	if (l <= 3e-298)
                                                                                                                      		tmp = sqrt((1.0 / (h * l))) * -d;
                                                                                                                      	else
                                                                                                                      		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                      	end
                                                                                                                      	tmp_2 = tmp;
                                                                                                                      end
                                                                                                                      
                                                                                                                      NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                      code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3e-298], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                      \\
                                                                                                                      \begin{array}{l}
                                                                                                                      \mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\
                                                                                                                      \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 2 regimes
                                                                                                                      2. if l < 2.9999999999999999e-298

                                                                                                                        1. Initial program 64.6%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in l around -inf

                                                                                                                          \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\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. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                          5. lower-*.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                          6. lower-sqrt.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          7. lower-/.f64N/A

                                                                                                                            \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          8. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          9. mul-1-negN/A

                                                                                                                            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                          10. lower-neg.f6446.4

                                                                                                                            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                        5. Applied rewrites46.4%

                                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                        if 2.9999999999999999e-298 < l

                                                                                                                        1. Initial program 65.9%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in d around inf

                                                                                                                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. lower-*.f64N/A

                                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                          2. lower-sqrt.f64N/A

                                                                                                                            \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                          3. lower-/.f64N/A

                                                                                                                            \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                          4. lower-*.f6450.7

                                                                                                                            \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                        5. Applied rewrites50.7%

                                                                                                                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                        6. Step-by-step derivation
                                                                                                                          1. Applied rewrites50.6%

                                                                                                                            \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                          2. Step-by-step derivation
                                                                                                                            1. Applied rewrites53.6%

                                                                                                                              \[\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}\;\ell \leq 3 \cdot 10^{-298}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
                                                                                                                          5. Add Preprocessing

                                                                                                                          Alternative 19: 43.1% accurate, 10.3× speedup?

                                                                                                                          \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\ \;\;\;\;t\_0 \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot t\_0\\ \end{array} \end{array} \]
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          (FPCore (d h l M D)
                                                                                                                           :precision binary64
                                                                                                                           (let* ((t_0 (sqrt (/ 1.0 (* h l)))))
                                                                                                                             (if (<= l 3e-298) (* t_0 (- d)) (* d t_0))))
                                                                                                                          assert(d < h && h < l && l < M && M < D);
                                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                                          	double t_0 = sqrt((1.0 / (h * l)));
                                                                                                                          	double tmp;
                                                                                                                          	if (l <= 3e-298) {
                                                                                                                          		tmp = t_0 * -d;
                                                                                                                          	} else {
                                                                                                                          		tmp = d * t_0;
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          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
                                                                                                                              real(8) :: t_0
                                                                                                                              real(8) :: tmp
                                                                                                                              t_0 = sqrt((1.0d0 / (h * l)))
                                                                                                                              if (l <= 3d-298) then
                                                                                                                                  tmp = t_0 * -d
                                                                                                                              else
                                                                                                                                  tmp = d * t_0
                                                                                                                              end if
                                                                                                                              code = tmp
                                                                                                                          end function
                                                                                                                          
                                                                                                                          assert d < h && h < l && l < M && M < D;
                                                                                                                          public static double code(double d, double h, double l, double M, double D) {
                                                                                                                          	double t_0 = Math.sqrt((1.0 / (h * l)));
                                                                                                                          	double tmp;
                                                                                                                          	if (l <= 3e-298) {
                                                                                                                          		tmp = t_0 * -d;
                                                                                                                          	} else {
                                                                                                                          		tmp = d * t_0;
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                          def code(d, h, l, M, D):
                                                                                                                          	t_0 = math.sqrt((1.0 / (h * l)))
                                                                                                                          	tmp = 0
                                                                                                                          	if l <= 3e-298:
                                                                                                                          		tmp = t_0 * -d
                                                                                                                          	else:
                                                                                                                          		tmp = d * t_0
                                                                                                                          	return tmp
                                                                                                                          
                                                                                                                          d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                          function code(d, h, l, M, D)
                                                                                                                          	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
                                                                                                                          	tmp = 0.0
                                                                                                                          	if (l <= 3e-298)
                                                                                                                          		tmp = Float64(t_0 * Float64(-d));
                                                                                                                          	else
                                                                                                                          		tmp = Float64(d * t_0);
                                                                                                                          	end
                                                                                                                          	return tmp
                                                                                                                          end
                                                                                                                          
                                                                                                                          d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                          function tmp_2 = code(d, h, l, M, D)
                                                                                                                          	t_0 = sqrt((1.0 / (h * l)));
                                                                                                                          	tmp = 0.0;
                                                                                                                          	if (l <= 3e-298)
                                                                                                                          		tmp = t_0 * -d;
                                                                                                                          	else
                                                                                                                          		tmp = d * t_0;
                                                                                                                          	end
                                                                                                                          	tmp_2 = tmp;
                                                                                                                          end
                                                                                                                          
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 3e-298], N[(t$95$0 * (-d)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
                                                                                                                          
                                                                                                                          \begin{array}{l}
                                                                                                                          [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                          \\
                                                                                                                          \begin{array}{l}
                                                                                                                          t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                          \mathbf{if}\;\ell \leq 3 \cdot 10^{-298}:\\
                                                                                                                          \;\;\;\;t\_0 \cdot \left(-d\right)\\
                                                                                                                          
                                                                                                                          \mathbf{else}:\\
                                                                                                                          \;\;\;\;d \cdot t\_0\\
                                                                                                                          
                                                                                                                          
                                                                                                                          \end{array}
                                                                                                                          \end{array}
                                                                                                                          
                                                                                                                          Derivation
                                                                                                                          1. Split input into 2 regimes
                                                                                                                          2. if l < 2.9999999999999999e-298

                                                                                                                            1. Initial program 64.6%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Taylor expanded in l around -inf

                                                                                                                              \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\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. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                              5. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                              6. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              7. lower-/.f64N/A

                                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              8. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              9. mul-1-negN/A

                                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                              10. lower-neg.f6446.4

                                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                            5. Applied rewrites46.4%

                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                            if 2.9999999999999999e-298 < l

                                                                                                                            1. Initial program 65.9%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Taylor expanded in d around inf

                                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              2. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              3. lower-/.f64N/A

                                                                                                                                \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              4. lower-*.f6450.7

                                                                                                                                \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                            5. Applied rewrites50.7%

                                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                          3. Recombined 2 regimes into one program.
                                                                                                                          4. Add Preprocessing

                                                                                                                          Alternative 20: 34.8% accurate, 10.9× speedup?

                                                                                                                          \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          (FPCore (d h l M D)
                                                                                                                           :precision binary64
                                                                                                                           (if (<= h -2.8e-247) (sqrt (* d (/ d (* h l)))) (* d (sqrt (/ 1.0 (* h l))))))
                                                                                                                          assert(d < h && h < l && l < M && M < D);
                                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                                          	double tmp;
                                                                                                                          	if (h <= -2.8e-247) {
                                                                                                                          		tmp = sqrt((d * (d / (h * l))));
                                                                                                                          	} else {
                                                                                                                          		tmp = d * sqrt((1.0 / (h * l)));
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          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
                                                                                                                              real(8) :: tmp
                                                                                                                              if (h <= (-2.8d-247)) then
                                                                                                                                  tmp = sqrt((d * (d / (h * l))))
                                                                                                                              else
                                                                                                                                  tmp = d * sqrt((1.0d0 / (h * l)))
                                                                                                                              end if
                                                                                                                              code = tmp
                                                                                                                          end function
                                                                                                                          
                                                                                                                          assert d < h && h < l && l < M && M < D;
                                                                                                                          public static double code(double d, double h, double l, double M, double D) {
                                                                                                                          	double tmp;
                                                                                                                          	if (h <= -2.8e-247) {
                                                                                                                          		tmp = Math.sqrt((d * (d / (h * l))));
                                                                                                                          	} else {
                                                                                                                          		tmp = d * Math.sqrt((1.0 / (h * l)));
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                          def code(d, h, l, M, D):
                                                                                                                          	tmp = 0
                                                                                                                          	if h <= -2.8e-247:
                                                                                                                          		tmp = math.sqrt((d * (d / (h * l))))
                                                                                                                          	else:
                                                                                                                          		tmp = d * math.sqrt((1.0 / (h * l)))
                                                                                                                          	return tmp
                                                                                                                          
                                                                                                                          d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                          function code(d, h, l, M, D)
                                                                                                                          	tmp = 0.0
                                                                                                                          	if (h <= -2.8e-247)
                                                                                                                          		tmp = sqrt(Float64(d * Float64(d / Float64(h * l))));
                                                                                                                          	else
                                                                                                                          		tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                          	end
                                                                                                                          	return tmp
                                                                                                                          end
                                                                                                                          
                                                                                                                          d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                          function tmp_2 = code(d, h, l, M, D)
                                                                                                                          	tmp = 0.0;
                                                                                                                          	if (h <= -2.8e-247)
                                                                                                                          		tmp = sqrt((d * (d / (h * l))));
                                                                                                                          	else
                                                                                                                          		tmp = d * sqrt((1.0 / (h * l)));
                                                                                                                          	end
                                                                                                                          	tmp_2 = tmp;
                                                                                                                          end
                                                                                                                          
                                                                                                                          NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                          code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e-247], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                                                          
                                                                                                                          \begin{array}{l}
                                                                                                                          [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                          \\
                                                                                                                          \begin{array}{l}
                                                                                                                          \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\
                                                                                                                          \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
                                                                                                                          
                                                                                                                          \mathbf{else}:\\
                                                                                                                          \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                          
                                                                                                                          
                                                                                                                          \end{array}
                                                                                                                          \end{array}
                                                                                                                          
                                                                                                                          Derivation
                                                                                                                          1. Split input into 2 regimes
                                                                                                                          2. if h < -2.79999999999999986e-247

                                                                                                                            1. Initial program 66.9%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Taylor expanded in d around inf

                                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              2. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              3. lower-/.f64N/A

                                                                                                                                \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              4. lower-*.f645.8

                                                                                                                                \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                            5. Applied rewrites5.8%

                                                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                            6. Step-by-step derivation
                                                                                                                              1. Applied rewrites34.2%

                                                                                                                                \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                                                                                                                              2. Step-by-step derivation
                                                                                                                                1. Applied rewrites38.4%

                                                                                                                                  \[\leadsto \sqrt{\frac{d}{h \cdot \ell} \cdot d} \]

                                                                                                                                if -2.79999999999999986e-247 < h

                                                                                                                                1. Initial program 64.0%

                                                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                2. Add Preprocessing
                                                                                                                                3. Taylor expanded in d around inf

                                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                4. Step-by-step derivation
                                                                                                                                  1. lower-*.f64N/A

                                                                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  2. lower-sqrt.f64N/A

                                                                                                                                    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  3. lower-/.f64N/A

                                                                                                                                    \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  4. lower-*.f6446.2

                                                                                                                                    \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                5. Applied rewrites46.2%

                                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                              3. Recombined 2 regimes into one program.
                                                                                                                              4. Final simplification42.7%

                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \]
                                                                                                                              5. Add Preprocessing

                                                                                                                              Alternative 21: 34.9% accurate, 10.9× speedup?

                                                                                                                              \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                              (FPCore (d h l M D)
                                                                                                                               :precision binary64
                                                                                                                               (if (<= h -2.8e-247) (sqrt (* d (/ d (* h l)))) (/ d (sqrt (* h l)))))
                                                                                                                              assert(d < h && h < l && l < M && M < D);
                                                                                                                              double code(double d, double h, double l, double M, double D) {
                                                                                                                              	double tmp;
                                                                                                                              	if (h <= -2.8e-247) {
                                                                                                                              		tmp = sqrt((d * (d / (h * l))));
                                                                                                                              	} else {
                                                                                                                              		tmp = d / sqrt((h * l));
                                                                                                                              	}
                                                                                                                              	return tmp;
                                                                                                                              }
                                                                                                                              
                                                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                              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
                                                                                                                                  real(8) :: tmp
                                                                                                                                  if (h <= (-2.8d-247)) then
                                                                                                                                      tmp = sqrt((d * (d / (h * l))))
                                                                                                                                  else
                                                                                                                                      tmp = d / sqrt((h * l))
                                                                                                                                  end if
                                                                                                                                  code = tmp
                                                                                                                              end function
                                                                                                                              
                                                                                                                              assert d < h && h < l && l < M && M < D;
                                                                                                                              public static double code(double d, double h, double l, double M, double D) {
                                                                                                                              	double tmp;
                                                                                                                              	if (h <= -2.8e-247) {
                                                                                                                              		tmp = Math.sqrt((d * (d / (h * l))));
                                                                                                                              	} else {
                                                                                                                              		tmp = d / Math.sqrt((h * l));
                                                                                                                              	}
                                                                                                                              	return tmp;
                                                                                                                              }
                                                                                                                              
                                                                                                                              [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                              def code(d, h, l, M, D):
                                                                                                                              	tmp = 0
                                                                                                                              	if h <= -2.8e-247:
                                                                                                                              		tmp = math.sqrt((d * (d / (h * l))))
                                                                                                                              	else:
                                                                                                                              		tmp = d / math.sqrt((h * l))
                                                                                                                              	return tmp
                                                                                                                              
                                                                                                                              d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                              function code(d, h, l, M, D)
                                                                                                                              	tmp = 0.0
                                                                                                                              	if (h <= -2.8e-247)
                                                                                                                              		tmp = sqrt(Float64(d * Float64(d / Float64(h * l))));
                                                                                                                              	else
                                                                                                                              		tmp = Float64(d / sqrt(Float64(h * l)));
                                                                                                                              	end
                                                                                                                              	return tmp
                                                                                                                              end
                                                                                                                              
                                                                                                                              d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                              function tmp_2 = code(d, h, l, M, D)
                                                                                                                              	tmp = 0.0;
                                                                                                                              	if (h <= -2.8e-247)
                                                                                                                              		tmp = sqrt((d * (d / (h * l))));
                                                                                                                              	else
                                                                                                                              		tmp = d / sqrt((h * l));
                                                                                                                              	end
                                                                                                                              	tmp_2 = tmp;
                                                                                                                              end
                                                                                                                              
                                                                                                                              NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                              code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e-247], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                                                              
                                                                                                                              \begin{array}{l}
                                                                                                                              [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                              \\
                                                                                                                              \begin{array}{l}
                                                                                                                              \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\
                                                                                                                              \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
                                                                                                                              
                                                                                                                              \mathbf{else}:\\
                                                                                                                              \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                                                              
                                                                                                                              
                                                                                                                              \end{array}
                                                                                                                              \end{array}
                                                                                                                              
                                                                                                                              Derivation
                                                                                                                              1. Split input into 2 regimes
                                                                                                                              2. if h < -2.79999999999999986e-247

                                                                                                                                1. Initial program 66.9%

                                                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                2. Add Preprocessing
                                                                                                                                3. Taylor expanded in d around inf

                                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                4. Step-by-step derivation
                                                                                                                                  1. lower-*.f64N/A

                                                                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  2. lower-sqrt.f64N/A

                                                                                                                                    \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  3. lower-/.f64N/A

                                                                                                                                    \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                  4. lower-*.f645.8

                                                                                                                                    \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                5. Applied rewrites5.8%

                                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                6. Step-by-step derivation
                                                                                                                                  1. Applied rewrites34.2%

                                                                                                                                    \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                                                                                                                                  2. Step-by-step derivation
                                                                                                                                    1. Applied rewrites38.4%

                                                                                                                                      \[\leadsto \sqrt{\frac{d}{h \cdot \ell} \cdot d} \]

                                                                                                                                    if -2.79999999999999986e-247 < h

                                                                                                                                    1. Initial program 64.0%

                                                                                                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                    2. Add Preprocessing
                                                                                                                                    3. Taylor expanded in d around inf

                                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                    4. Step-by-step derivation
                                                                                                                                      1. lower-*.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      2. lower-sqrt.f64N/A

                                                                                                                                        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      3. lower-/.f64N/A

                                                                                                                                        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      4. lower-*.f6446.2

                                                                                                                                        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                    5. Applied rewrites46.2%

                                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                    6. Step-by-step derivation
                                                                                                                                      1. Applied rewrites46.2%

                                                                                                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                    7. Recombined 2 regimes into one program.
                                                                                                                                    8. Final simplification42.6%

                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -2.8 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                                    9. Add Preprocessing

                                                                                                                                    Alternative 22: 26.7% accurate, 15.3× speedup?

                                                                                                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
                                                                                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                                    (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
                                                                                                                                    assert(d < h && h < l && l < M && M < D);
                                                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                                                    	return d / sqrt((h * l));
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                                    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 / sqrt((h * l))
                                                                                                                                    end function
                                                                                                                                    
                                                                                                                                    assert d < h && h < l && l < M && M < D;
                                                                                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                                                                                    	return d / Math.sqrt((h * l));
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                                                                                    def code(d, h, l, M, D):
                                                                                                                                    	return d / math.sqrt((h * l))
                                                                                                                                    
                                                                                                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                                                                                                    function code(d, h, l, M, D)
                                                                                                                                    	return Float64(d / sqrt(Float64(h * l)))
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                                                                                    function tmp = code(d, h, l, M, D)
                                                                                                                                    	tmp = d / sqrt((h * l));
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                                                                                    code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                                                    
                                                                                                                                    \begin{array}{l}
                                                                                                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                                                                                    \\
                                                                                                                                    \frac{d}{\sqrt{h \cdot \ell}}
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    1. Initial program 65.3%

                                                                                                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                    2. Add Preprocessing
                                                                                                                                    3. Taylor expanded in d around inf

                                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                    4. Step-by-step derivation
                                                                                                                                      1. lower-*.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      2. lower-sqrt.f64N/A

                                                                                                                                        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      3. lower-/.f64N/A

                                                                                                                                        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      4. lower-*.f6427.9

                                                                                                                                        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                    5. Applied rewrites27.9%

                                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                    6. Step-by-step derivation
                                                                                                                                      1. Applied rewrites27.9%

                                                                                                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                      2. Add Preprocessing

                                                                                                                                      Reproduce

                                                                                                                                      ?
                                                                                                                                      herbie shell --seed 2024221 
                                                                                                                                      (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)))))