Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.9% → 78.7%
Time: 15.5s
Alternatives: 23
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 23 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: 65.9% 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: 78.7% accurate, 0.9× speedup?

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

\mathbf{elif}\;\ell \leq 6.4 \cdot 10^{-163}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.25 \cdot t\_0}{\ell}, \left(0.5 \cdot \frac{h}{d}\right) \cdot \left(M \cdot D\_m\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -5.00000000000023e-311

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000023e-311 < l < 6.39999999999999976e-163

    1. Initial program 63.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 rewrites64.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.39999999999999976e-163 < l

    1. Initial program 60.8%

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

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

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

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

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

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

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

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

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

Alternative 2: 75.7% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\frac{--1}{h}}{\ell}} \cdot d\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+188}:\\
\;\;\;\;\frac{t\_2}{{t\_1}^{-1}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-174

    1. Initial program 81.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 rewrites80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

            if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
            7. Recombined 4 regimes into one program.
            8. Final simplification75.7%

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

            Alternative 3: 69.1% accurate, 0.2× speedup?

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

              1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                      if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                      7. Recombined 4 regimes into one program.
                      8. Final simplification72.5%

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

                      Alternative 4: 60.8% accurate, 0.2× speedup?

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

                        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 rewrites79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

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

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

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

                            1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                                if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                7. Recombined 4 regimes into one program.
                                8. Final simplification59.8%

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

                                Alternative 5: 55.7% accurate, 0.2× speedup?

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

                                  1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                        1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                                            if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                            7. Recombined 4 regimes into one program.
                                            8. Final simplification56.3%

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

                                            Alternative 6: 55.9% accurate, 0.2× speedup?

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

                                              1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

                                                        1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                                                            if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                            7. Recombined 4 regimes into one program.
                                                            8. Final simplification53.4%

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

                                                            Alternative 7: 53.1% accurate, 0.2× speedup?

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

                                                              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. Taylor expanded in d around inf

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \frac{\sqrt{\frac{d}{\ell}}}{-\frac{1}{\sqrt{\frac{d}{h}}}} \]

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

                                                                    1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                            if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                            7. Recombined 4 regimes into one program.
                                                                            8. Final simplification51.8%

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

                                                                            Alternative 8: 53.0% accurate, 0.2× speedup?

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

                                                                              1. Initial program 81.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                  1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                                          if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                          7. Recombined 4 regimes into one program.
                                                                                          8. Final simplification51.8%

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

                                                                                          Alternative 9: 53.0% accurate, 0.2× speedup?

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

                                                                                            1. Initial program 81.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                                                                                                1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

                                                                                                      if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                          \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                      7. Recombined 4 regimes into one program.
                                                                                                      8. Final simplification51.8%

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

                                                                                                      Alternative 10: 51.1% accurate, 0.3× speedup?

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

                                                                                                        1. Initial program 77.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                                                                                            1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

                                                                                                              if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                  \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                              7. Recombined 3 regimes into one program.
                                                                                                              8. Final simplification50.2%

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

                                                                                                              Alternative 11: 49.2% accurate, 0.3× speedup?

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

                                                                                                                1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    if 1.00000000000000002e-232 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.0000000000000001e148

                                                                                                                    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                        1. Initial program 30.9%

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

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

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

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

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

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

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

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

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

                                                                                                                            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                        7. Recombined 3 regimes into one program.
                                                                                                                        8. Final simplification49.1%

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

                                                                                                                        Alternative 12: 49.0% accurate, 0.3× speedup?

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

                                                                                                                          1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

                                                                                                                            if 1.00000000000000002e-232 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.0000000000000001e148

                                                                                                                            1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                1. Initial program 30.9%

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

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

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

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

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

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

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

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

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

                                                                                                                                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                7. Recombined 3 regimes into one program.
                                                                                                                                8. Final simplification48.8%

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

                                                                                                                                Alternative 13: 48.0% accurate, 0.3× speedup?

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

                                                                                                                                  1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

                                                                                                                                    if 1.00000000000000002e-232 < (*.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)))) < 5e152

                                                                                                                                    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                        if 5e152 < (*.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 28.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                        7. Recombined 3 regimes into one program.
                                                                                                                                        8. Final simplification48.1%

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

                                                                                                                                        Alternative 14: 75.8% accurate, 0.5× speedup?

                                                                                                                                        \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2 \cdot d}{M \cdot D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \end{array} \end{array} \]
                                                                                                                                        D_m = (fabs.f64 D)
                                                                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                        (FPCore (d h l M D_m)
                                                                                                                                         :precision binary64
                                                                                                                                         (if (<=
                                                                                                                                              (*
                                                                                                                                               (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                                                                               (-
                                                                                                                                                1.0
                                                                                                                                                (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                                                                              5e+188)
                                                                                                                                           (*
                                                                                                                                            (*
                                                                                                                                             (fma (* -0.5 (/ h l)) (pow (/ (* 2.0 d) (* M D_m)) -2.0) 1.0)
                                                                                                                                             (sqrt (/ d h)))
                                                                                                                                            (sqrt (/ d l)))
                                                                                                                                           (fabs (/ d (sqrt (* l h))))))
                                                                                                                                        D_m = fabs(D);
                                                                                                                                        assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                        double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                        	double tmp;
                                                                                                                                        	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+188) {
                                                                                                                                        		tmp = (fma((-0.5 * (h / l)), pow(((2.0 * d) / (M * D_m)), -2.0), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                                                                                                                        	} else {
                                                                                                                                        		tmp = fabs((d / sqrt((l * h))));
                                                                                                                                        	}
                                                                                                                                        	return tmp;
                                                                                                                                        }
                                                                                                                                        
                                                                                                                                        D_m = abs(D)
                                                                                                                                        d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                        function code(d, h, l, M, D_m)
                                                                                                                                        	tmp = 0.0
                                                                                                                                        	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+188)
                                                                                                                                        		tmp = Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(2.0 * d) / Float64(M * D_m)) ^ -2.0), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                                                                                                                        	else
                                                                                                                                        		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                                                                                                                                        	end
                                                                                                                                        	return tmp
                                                                                                                                        end
                                                                                                                                        
                                                                                                                                        D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                        code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+188], N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 * d), $MachinePrecision] / N[(M * D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                        
                                                                                                                                        \begin{array}{l}
                                                                                                                                        D_m = \left|D\right|
                                                                                                                                        \\
                                                                                                                                        [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                        \\
                                                                                                                                        \begin{array}{l}
                                                                                                                                        \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\
                                                                                                                                        \;\;\;\;\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2 \cdot d}{M \cdot D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                                                                        
                                                                                                                                        \mathbf{else}:\\
                                                                                                                                        \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                                                                                                                                        
                                                                                                                                        
                                                                                                                                        \end{array}
                                                                                                                                        \end{array}
                                                                                                                                        
                                                                                                                                        Derivation
                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000001e188

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                          if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                          7. Recombined 2 regimes into one program.
                                                                                                                                          8. Final simplification76.2%

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

                                                                                                                                          Alternative 15: 46.6% accurate, 0.5× speedup?

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

                                                                                                                                            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. 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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

                                                                                                                                            1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                            7. Recombined 2 regimes into one program.
                                                                                                                                            8. Final simplification44.8%

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

                                                                                                                                            Alternative 16: 76.2% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                              if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                  \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                              7. Recombined 2 regimes into one program.
                                                                                                                                              8. Final simplification76.8%

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

                                                                                                                                              Alternative 17: 74.3% accurate, 0.5× speedup?

                                                                                                                                              \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\frac{M}{d}}{\ell} \cdot \left(0.25 \cdot D\_m\right), \left(0.5 \cdot \left(-h\right)\right) \cdot \left(M \cdot \frac{D\_m}{d}\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \end{array} \end{array} \]
                                                                                                                                              D_m = (fabs.f64 D)
                                                                                                                                              NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                              (FPCore (d h l M D_m)
                                                                                                                                               :precision binary64
                                                                                                                                               (if (<=
                                                                                                                                                    (*
                                                                                                                                                     (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                                                                                     (-
                                                                                                                                                      1.0
                                                                                                                                                      (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                                                                                    5e+188)
                                                                                                                                                 (*
                                                                                                                                                  (*
                                                                                                                                                   (fma (* (/ (/ M d) l) (* 0.25 D_m)) (* (* 0.5 (- h)) (* M (/ D_m d))) 1.0)
                                                                                                                                                   (sqrt (/ d h)))
                                                                                                                                                  (sqrt (/ d l)))
                                                                                                                                                 (fabs (/ d (sqrt (* l h))))))
                                                                                                                                              D_m = fabs(D);
                                                                                                                                              assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                              double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                              	double tmp;
                                                                                                                                              	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+188) {
                                                                                                                                              		tmp = (fma((((M / d) / l) * (0.25 * D_m)), ((0.5 * -h) * (M * (D_m / d))), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                                                                                                                              	} else {
                                                                                                                                              		tmp = fabs((d / sqrt((l * h))));
                                                                                                                                              	}
                                                                                                                                              	return tmp;
                                                                                                                                              }
                                                                                                                                              
                                                                                                                                              D_m = abs(D)
                                                                                                                                              d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                              function code(d, h, l, M, D_m)
                                                                                                                                              	tmp = 0.0
                                                                                                                                              	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+188)
                                                                                                                                              		tmp = Float64(Float64(fma(Float64(Float64(Float64(M / d) / l) * Float64(0.25 * D_m)), Float64(Float64(0.5 * Float64(-h)) * Float64(M * Float64(D_m / d))), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                                                                                                                              	else
                                                                                                                                              		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                                                                                                                                              	end
                                                                                                                                              	return tmp
                                                                                                                                              end
                                                                                                                                              
                                                                                                                                              D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                              NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                              code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+188], N[(N[(N[(N[(N[(N[(M / d), $MachinePrecision] / l), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * (-h)), $MachinePrecision] * N[(M * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                              
                                                                                                                                              \begin{array}{l}
                                                                                                                                              D_m = \left|D\right|
                                                                                                                                              \\
                                                                                                                                              [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                              \\
                                                                                                                                              \begin{array}{l}
                                                                                                                                              \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\
                                                                                                                                              \;\;\;\;\left(\mathsf{fma}\left(\frac{\frac{M}{d}}{\ell} \cdot \left(0.25 \cdot D\_m\right), \left(0.5 \cdot \left(-h\right)\right) \cdot \left(M \cdot \frac{D\_m}{d}\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                                                                              
                                                                                                                                              \mathbf{else}:\\
                                                                                                                                              \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                                                                                                                                              
                                                                                                                                              
                                                                                                                                              \end{array}
                                                                                                                                              \end{array}
                                                                                                                                              
                                                                                                                                              Derivation
                                                                                                                                              1. Split input into 2 regimes
                                                                                                                                              2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000001e188

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

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

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

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

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

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

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

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

                                                                                                                                                if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                                7. Recombined 2 regimes into one program.
                                                                                                                                                8. Final simplification73.5%

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

                                                                                                                                                Alternative 18: 73.8% accurate, 0.5× speedup?

                                                                                                                                                \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(0.25 \cdot D\_m\right)}{-\ell} \cdot \left(M \cdot D\_m\right), 0.5 \cdot \frac{h}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \end{array} \end{array} \]
                                                                                                                                                D_m = (fabs.f64 D)
                                                                                                                                                NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                (FPCore (d h l M D_m)
                                                                                                                                                 :precision binary64
                                                                                                                                                 (if (<=
                                                                                                                                                      (*
                                                                                                                                                       (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                                                                                       (-
                                                                                                                                                        1.0
                                                                                                                                                        (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                                                                                      5e+188)
                                                                                                                                                   (*
                                                                                                                                                    (*
                                                                                                                                                     (fma (* (/ (* (/ M d) (* 0.25 D_m)) (- l)) (* M D_m)) (* 0.5 (/ h d)) 1.0)
                                                                                                                                                     (sqrt (/ d h)))
                                                                                                                                                    (sqrt (/ d l)))
                                                                                                                                                   (fabs (/ d (sqrt (* l h))))))
                                                                                                                                                D_m = fabs(D);
                                                                                                                                                assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                                double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                	double tmp;
                                                                                                                                                	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+188) {
                                                                                                                                                		tmp = (fma(((((M / d) * (0.25 * D_m)) / -l) * (M * D_m)), (0.5 * (h / d)), 1.0) * sqrt((d / h))) * sqrt((d / l));
                                                                                                                                                	} else {
                                                                                                                                                		tmp = fabs((d / sqrt((l * h))));
                                                                                                                                                	}
                                                                                                                                                	return tmp;
                                                                                                                                                }
                                                                                                                                                
                                                                                                                                                D_m = abs(D)
                                                                                                                                                d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                                function code(d, h, l, M, D_m)
                                                                                                                                                	tmp = 0.0
                                                                                                                                                	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+188)
                                                                                                                                                		tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(M / d) * Float64(0.25 * D_m)) / Float64(-l)) * Float64(M * D_m)), Float64(0.5 * Float64(h / d)), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
                                                                                                                                                	else
                                                                                                                                                		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                                                                                                                                                	end
                                                                                                                                                	return tmp
                                                                                                                                                end
                                                                                                                                                
                                                                                                                                                D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                                NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+188], N[(N[(N[(N[(N[(N[(N[(M / d), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] * N[(M * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(0.5 * N[(h / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                                
                                                                                                                                                \begin{array}{l}
                                                                                                                                                D_m = \left|D\right|
                                                                                                                                                \\
                                                                                                                                                [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                                \\
                                                                                                                                                \begin{array}{l}
                                                                                                                                                \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\
                                                                                                                                                \;\;\;\;\left(\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(0.25 \cdot D\_m\right)}{-\ell} \cdot \left(M \cdot D\_m\right), 0.5 \cdot \frac{h}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                                                                                
                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                                                                                                                                                
                                                                                                                                                
                                                                                                                                                \end{array}
                                                                                                                                                \end{array}
                                                                                                                                                
                                                                                                                                                Derivation
                                                                                                                                                1. Split input into 2 regimes
                                                                                                                                                2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000001e188

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                  if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                      \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                                  7. Recombined 2 regimes into one program.
                                                                                                                                                  8. Final simplification72.7%

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

                                                                                                                                                  Alternative 19: 73.6% accurate, 0.5× speedup?

                                                                                                                                                  \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(0.25 \cdot D\_m\right)}{-\ell} \cdot \left(M \cdot D\_m\right), 0.5 \cdot \frac{h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \end{array} \end{array} \]
                                                                                                                                                  D_m = (fabs.f64 D)
                                                                                                                                                  NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                  (FPCore (d h l M D_m)
                                                                                                                                                   :precision binary64
                                                                                                                                                   (if (<=
                                                                                                                                                        (*
                                                                                                                                                         (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                                                                                         (-
                                                                                                                                                          1.0
                                                                                                                                                          (* (* (pow 2.0 -1.0) (pow (/ (* M D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                                                                                        5e+188)
                                                                                                                                                     (*
                                                                                                                                                      (*
                                                                                                                                                       (sqrt (/ d l))
                                                                                                                                                       (fma
                                                                                                                                                        (* (/ (* (/ M d) (* 0.25 D_m)) (- l)) (* M D_m))
                                                                                                                                                        (* 0.5 (/ h d))
                                                                                                                                                        1.0))
                                                                                                                                                      (sqrt (/ d h)))
                                                                                                                                                     (fabs (/ d (sqrt (* l h))))))
                                                                                                                                                  D_m = fabs(D);
                                                                                                                                                  assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                                  double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                  	double tmp;
                                                                                                                                                  	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+188) {
                                                                                                                                                  		tmp = (sqrt((d / l)) * fma(((((M / d) * (0.25 * D_m)) / -l) * (M * D_m)), (0.5 * (h / d)), 1.0)) * sqrt((d / h));
                                                                                                                                                  	} else {
                                                                                                                                                  		tmp = fabs((d / sqrt((l * h))));
                                                                                                                                                  	}
                                                                                                                                                  	return tmp;
                                                                                                                                                  }
                                                                                                                                                  
                                                                                                                                                  D_m = abs(D)
                                                                                                                                                  d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                                  function code(d, h, l, M, D_m)
                                                                                                                                                  	tmp = 0.0
                                                                                                                                                  	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+188)
                                                                                                                                                  		tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(M / d) * Float64(0.25 * D_m)) / Float64(-l)) * Float64(M * D_m)), Float64(0.5 * Float64(h / d)), 1.0)) * sqrt(Float64(d / h)));
                                                                                                                                                  	else
                                                                                                                                                  		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                                                                                                                                                  	end
                                                                                                                                                  	return tmp
                                                                                                                                                  end
                                                                                                                                                  
                                                                                                                                                  D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                                  NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                  code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+188], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(M / d), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] * N[(M * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(0.5 * N[(h / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                                  
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  D_m = \left|D\right|
                                                                                                                                                  \\
                                                                                                                                                  [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                                  \\
                                                                                                                                                  \begin{array}{l}
                                                                                                                                                  \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 5 \cdot 10^{+188}:\\
                                                                                                                                                  \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(0.25 \cdot D\_m\right)}{-\ell} \cdot \left(M \cdot D\_m\right), 0.5 \cdot \frac{h}{d}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
                                                                                                                                                  
                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                  \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                                                                                                                                                  
                                                                                                                                                  
                                                                                                                                                  \end{array}
                                                                                                                                                  \end{array}
                                                                                                                                                  
                                                                                                                                                  Derivation
                                                                                                                                                  1. Split input into 2 regimes
                                                                                                                                                  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.0000000000000001e188

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                    if 5.0000000000000001e188 < (*.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 24.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                                    7. Recombined 2 regimes into one program.
                                                                                                                                                    8. Final simplification72.4%

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

                                                                                                                                                    Alternative 20: 46.2% accurate, 0.6× speedup?

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

                                                                                                                                                      1. Initial program 81.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

                                                                                                                                                        1. Initial program 53.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. *-commutativeN/A

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

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

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

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

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

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

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

                                                                                                                                                            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                                                                                        7. Recombined 2 regimes into one program.
                                                                                                                                                        8. Final simplification44.1%

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

                                                                                                                                                        Alternative 21: 77.9% accurate, 2.0× speedup?

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

                                                                                                                                                          1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(0.5 \cdot h\right)}{d}\right) \]
                                                                                                                                                            3. lift-pow.f64N/A

                                                                                                                                                              \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            4. pow1/2N/A

                                                                                                                                                              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            5. lift-/.f64N/A

                                                                                                                                                              \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            6. frac-2negN/A

                                                                                                                                                              \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            7. lift-neg.f64N/A

                                                                                                                                                              \[\leadsto \left(\sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            8. sqrt-divN/A

                                                                                                                                                              \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            9. lift-sqrt.f64N/A

                                                                                                                                                              \[\leadsto \left(\frac{\color{blue}{\sqrt{-d}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            10. lower-/.f64N/A

                                                                                                                                                              \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            11. lower-sqrt.f64N/A

                                                                                                                                                              \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\frac{1}{2} \cdot h\right)}{d}\right) \]
                                                                                                                                                            12. lower-neg.f6477.5

                                                                                                                                                              \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(0.5 \cdot h\right)}{d}\right) \]
                                                                                                                                                          9. Applied rewrites77.5%

                                                                                                                                                            \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(0.5 \cdot h\right)}{d}\right) \]

                                                                                                                                                          if -5.00000000000023e-311 < l < 6.39999999999999976e-163

                                                                                                                                                          1. Initial program 63.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 rewrites64.5%

                                                                                                                                                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(\frac{D}{d} \cdot M\right) \cdot 0.5}{{h}^{-1}}}\right) \]
                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                            1. lift-/.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \color{blue}{\frac{\left(\frac{D}{d} \cdot M\right) \cdot \frac{1}{2}}{{h}^{-1}}}\right) \]
                                                                                                                                                            2. lift-*.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\color{blue}{\left(\frac{D}{d} \cdot M\right) \cdot \frac{1}{2}}}{{h}^{-1}}\right) \]
                                                                                                                                                            3. associate-/l*N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \color{blue}{\left(\left(\frac{D}{d} \cdot M\right) \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)}\right) \]
                                                                                                                                                            4. lift-*.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)\right) \]
                                                                                                                                                            5. lift-/.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \left(\left(\color{blue}{\frac{D}{d}} \cdot M\right) \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)\right) \]
                                                                                                                                                            6. associate-*l/N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \left(\color{blue}{\frac{D \cdot M}{d}} \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)\right) \]
                                                                                                                                                            7. *-commutativeN/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \left(\frac{\color{blue}{M \cdot D}}{d} \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)\right) \]
                                                                                                                                                            8. lift-*.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \left(\frac{\color{blue}{M \cdot D}}{d} \cdot \frac{\frac{1}{2}}{{h}^{-1}}\right)\right) \]
                                                                                                                                                            9. associate-*l/N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{\frac{1}{2}}{{h}^{-1}}}{d}}\right) \]
                                                                                                                                                            10. lower-/.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{\frac{1}{2}}{{h}^{-1}}}{d}}\right) \]
                                                                                                                                                            11. lower-*.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\color{blue}{\left(M \cdot D\right) \cdot \frac{\frac{1}{2}}{{h}^{-1}}}}{d}\right) \]
                                                                                                                                                            12. lift-pow.f64N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \frac{\frac{1}{2}}{\color{blue}{{h}^{-1}}}}{d}\right) \]
                                                                                                                                                            13. unpow-1N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \frac{\frac{1}{2}}{\color{blue}{\frac{1}{h}}}}{d}\right) \]
                                                                                                                                                            14. associate-/r/N/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \color{blue}{\left(\frac{\frac{1}{2}}{1} \cdot h\right)}}{d}\right) \]
                                                                                                                                                            15. metadata-evalN/A

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(\color{blue}{\frac{1}{2}} \cdot h\right)}{d}\right) \]
                                                                                                                                                            16. lower-*.f6464.5

                                                                                                                                                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \color{blue}{\left(0.5 \cdot h\right)}}{d}\right) \]
                                                                                                                                                          5. Applied rewrites64.5%

                                                                                                                                                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{\ell} \cdot \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(0.5 \cdot h\right)}{d}}\right) \]
                                                                                                                                                          6. Applied rewrites86.6%

                                                                                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.25 \cdot \left(\frac{D}{d} \cdot M\right)}{\ell}, \left(0.5 \cdot \frac{h}{d}\right) \cdot \left(M \cdot D\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

                                                                                                                                                          if 6.39999999999999976e-163 < l

                                                                                                                                                          1. Initial program 60.8%

                                                                                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                            1. lift-*.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
                                                                                                                                                            2. *-commutativeN/A

                                                                                                                                                              \[\leadsto \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) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                                                                            3. lift-*.f64N/A

                                                                                                                                                              \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                                                                            4. associate-*r*N/A

                                                                                                                                                              \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                                                                            5. lower-*.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                                                                          4. Applied rewrites60.8%

                                                                                                                                                            \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                                                                                                          5. Applied rewrites78.3%

                                                                                                                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(\frac{2}{M \cdot \frac{D}{d}}\right)}^{-2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
                                                                                                                                                        3. Recombined 3 regimes into one program.
                                                                                                                                                        4. Add Preprocessing

                                                                                                                                                        Alternative 22: 46.9% accurate, 3.2× speedup?

                                                                                                                                                        \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 1.35 \cdot 10^{-261}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                                                                        D_m = (fabs.f64 D)
                                                                                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                        (FPCore (d h l M D_m)
                                                                                                                                                         :precision binary64
                                                                                                                                                         (if (<= d 1.35e-261)
                                                                                                                                                           (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                                                                                                           (/ d (* (sqrt l) (sqrt h)))))
                                                                                                                                                        D_m = fabs(D);
                                                                                                                                                        assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                                        double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                        	double tmp;
                                                                                                                                                        	if (d <= 1.35e-261) {
                                                                                                                                                        		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                                                                                                        	} else {
                                                                                                                                                        		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                                                                        	}
                                                                                                                                                        	return tmp;
                                                                                                                                                        }
                                                                                                                                                        
                                                                                                                                                        D_m = abs(d)
                                                                                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                        real(8) function code(d, h, l, m, d_m)
                                                                                                                                                            real(8), intent (in) :: d
                                                                                                                                                            real(8), intent (in) :: h
                                                                                                                                                            real(8), intent (in) :: l
                                                                                                                                                            real(8), intent (in) :: m
                                                                                                                                                            real(8), intent (in) :: d_m
                                                                                                                                                            real(8) :: tmp
                                                                                                                                                            if (d <= 1.35d-261) then
                                                                                                                                                                tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                                                                                                                                            else
                                                                                                                                                                tmp = d / (sqrt(l) * sqrt(h))
                                                                                                                                                            end if
                                                                                                                                                            code = tmp
                                                                                                                                                        end function
                                                                                                                                                        
                                                                                                                                                        D_m = Math.abs(D);
                                                                                                                                                        assert d < h && h < l && l < M && M < D_m;
                                                                                                                                                        public static double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                        	double tmp;
                                                                                                                                                        	if (d <= 1.35e-261) {
                                                                                                                                                        		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                                                                                                                                        	} else {
                                                                                                                                                        		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                                                                                                        	}
                                                                                                                                                        	return tmp;
                                                                                                                                                        }
                                                                                                                                                        
                                                                                                                                                        D_m = math.fabs(D)
                                                                                                                                                        [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                                                                                                        def code(d, h, l, M, D_m):
                                                                                                                                                        	tmp = 0
                                                                                                                                                        	if d <= 1.35e-261:
                                                                                                                                                        		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                                                                                                                                        	else:
                                                                                                                                                        		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                                                                                                        	return tmp
                                                                                                                                                        
                                                                                                                                                        D_m = abs(D)
                                                                                                                                                        d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                                        function code(d, h, l, M, D_m)
                                                                                                                                                        	tmp = 0.0
                                                                                                                                                        	if (d <= 1.35e-261)
                                                                                                                                                        		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                                                                                                        	else
                                                                                                                                                        		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                                                                        	end
                                                                                                                                                        	return tmp
                                                                                                                                                        end
                                                                                                                                                        
                                                                                                                                                        D_m = abs(D);
                                                                                                                                                        d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                                                                                                        function tmp_2 = code(d, h, l, M, D_m)
                                                                                                                                                        	tmp = 0.0;
                                                                                                                                                        	if (d <= 1.35e-261)
                                                                                                                                                        		tmp = -d * sqrt(((l * h) ^ -1.0));
                                                                                                                                                        	else
                                                                                                                                                        		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                                                                        	end
                                                                                                                                                        	tmp_2 = tmp;
                                                                                                                                                        end
                                                                                                                                                        
                                                                                                                                                        D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                                        NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                        code[d_, h_, l_, M_, D$95$m_] := If[LessEqual[d, 1.35e-261], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                        
                                                                                                                                                        \begin{array}{l}
                                                                                                                                                        D_m = \left|D\right|
                                                                                                                                                        \\
                                                                                                                                                        [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                                        \\
                                                                                                                                                        \begin{array}{l}
                                                                                                                                                        \mathbf{if}\;d \leq 1.35 \cdot 10^{-261}:\\
                                                                                                                                                        \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                                                                                        
                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                                                                        
                                                                                                                                                        
                                                                                                                                                        \end{array}
                                                                                                                                                        \end{array}
                                                                                                                                                        
                                                                                                                                                        Derivation
                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                        2. if d < 1.3499999999999999e-261

                                                                                                                                                          1. Initial program 65.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. lower-*.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                                            5. mul-1-negN/A

                                                                                                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                                                            6. lower-neg.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                                                            7. lower-sqrt.f64N/A

                                                                                                                                                              \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                                            8. lower-/.f64N/A

                                                                                                                                                              \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                                            9. *-commutativeN/A

                                                                                                                                                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                                                                            10. lower-*.f6435.7

                                                                                                                                                              \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                                                                                                                          5. Applied rewrites35.7%

                                                                                                                                                            \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                                                                                                                          if 1.3499999999999999e-261 < d

                                                                                                                                                          1. Initial program 62.7%

                                                                                                                                                            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                          3. Taylor expanded in d around inf

                                                                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                            1. *-commutativeN/A

                                                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                                                                            2. lower-*.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                                                                            3. lower-sqrt.f64N/A

                                                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                                                                            4. lower-/.f64N/A

                                                                                                                                                              \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                                                                            5. *-commutativeN/A

                                                                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                                                                            6. lower-*.f6449.5

                                                                                                                                                              \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                                                                          5. Applied rewrites49.5%

                                                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                                                                          6. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites49.6%

                                                                                                                                                              \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites56.3%

                                                                                                                                                                \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                                                                            3. Recombined 2 regimes into one program.
                                                                                                                                                            4. Final simplification45.6%

                                                                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.35 \cdot 10^{-261}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                                                                                            5. Add Preprocessing

                                                                                                                                                            Alternative 23: 26.3% accurate, 15.3× speedup?

                                                                                                                                                            \[\begin{array}{l} D_m = \left|D\right| \\ [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                                                                                                                            D_m = (fabs.f64 D)
                                                                                                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                            (FPCore (d h l M D_m) :precision binary64 (/ d (sqrt (* l h))))
                                                                                                                                                            D_m = fabs(D);
                                                                                                                                                            assert(d < h && h < l && l < M && M < D_m);
                                                                                                                                                            double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                            	return d / sqrt((l * h));
                                                                                                                                                            }
                                                                                                                                                            
                                                                                                                                                            D_m = abs(d)
                                                                                                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                            real(8) function code(d, h, l, m, d_m)
                                                                                                                                                                real(8), intent (in) :: d
                                                                                                                                                                real(8), intent (in) :: h
                                                                                                                                                                real(8), intent (in) :: l
                                                                                                                                                                real(8), intent (in) :: m
                                                                                                                                                                real(8), intent (in) :: d_m
                                                                                                                                                                code = d / sqrt((l * h))
                                                                                                                                                            end function
                                                                                                                                                            
                                                                                                                                                            D_m = Math.abs(D);
                                                                                                                                                            assert d < h && h < l && l < M && M < D_m;
                                                                                                                                                            public static double code(double d, double h, double l, double M, double D_m) {
                                                                                                                                                            	return d / Math.sqrt((l * h));
                                                                                                                                                            }
                                                                                                                                                            
                                                                                                                                                            D_m = math.fabs(D)
                                                                                                                                                            [d, h, l, M, D_m] = sort([d, h, l, M, D_m])
                                                                                                                                                            def code(d, h, l, M, D_m):
                                                                                                                                                            	return d / math.sqrt((l * h))
                                                                                                                                                            
                                                                                                                                                            D_m = abs(D)
                                                                                                                                                            d, h, l, M, D_m = sort([d, h, l, M, D_m])
                                                                                                                                                            function code(d, h, l, M, D_m)
                                                                                                                                                            	return Float64(d / sqrt(Float64(l * h)))
                                                                                                                                                            end
                                                                                                                                                            
                                                                                                                                                            D_m = abs(D);
                                                                                                                                                            d, h, l, M, D_m = num2cell(sort([d, h, l, M, D_m])){:}
                                                                                                                                                            function tmp = code(d, h, l, M, D_m)
                                                                                                                                                            	tmp = d / sqrt((l * h));
                                                                                                                                                            end
                                                                                                                                                            
                                                                                                                                                            D_m = N[Abs[D], $MachinePrecision]
                                                                                                                                                            NOTE: d, h, l, M, and D_m should be sorted in increasing order before calling this function.
                                                                                                                                                            code[d_, h_, l_, M_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                                                                            
                                                                                                                                                            \begin{array}{l}
                                                                                                                                                            D_m = \left|D\right|
                                                                                                                                                            \\
                                                                                                                                                            [d, h, l, M, D_m] = \mathsf{sort}([d, h, l, M, D_m])\\
                                                                                                                                                            \\
                                                                                                                                                            \frac{d}{\sqrt{\ell \cdot h}}
                                                                                                                                                            \end{array}
                                                                                                                                                            
                                                                                                                                                            Derivation
                                                                                                                                                            1. Initial program 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. *-commutativeN/A

                                                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                                                                              2. lower-*.f64N/A

                                                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                                                                              3. lower-sqrt.f64N/A

                                                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                                                                              4. lower-/.f64N/A

                                                                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                                                                              5. *-commutativeN/A

                                                                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                                                                              6. lower-*.f6428.5

                                                                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                                                                            5. Applied rewrites28.5%

                                                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                                                                            6. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites28.5%

                                                                                                                                                                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                                                                                              2. Add Preprocessing

                                                                                                                                                              Reproduce

                                                                                                                                                              ?
                                                                                                                                                              herbie shell --seed 2024307 
                                                                                                                                                              (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)))))