Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.7% → 74.3%
Time: 24.4s
Alternatives: 30
Speedup: 3.2×

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

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

Initial Program: 66.7% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{t\_1}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D\_m \cdot \left(M \cdot D\_m\right)\right)}{d}, \frac{\frac{h \cdot -0.5}{\ell}}{d \cdot 4}, 1\right)}{\sqrt{\frac{h}{d}}}\\

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


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

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999984e-151 < d < -1.999999999999994e-310

    1. Initial program 41.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. Applied rewrites19.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < d

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_3 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{d}}\\

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
\;\;\;\;t\_0 \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\


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

    1. Initial program 84.3%

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

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

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

      \[\leadsto \left(\color{blue}{\left(1 + \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e235 < (*.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-167

    1. Initial program 98.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. Applied rewrites52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 36.4%

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

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

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

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

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

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

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

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

        if 9.99999999999999962e-292 < (*.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.00000000000000007e234

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

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

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

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

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

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

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

          if 4.00000000000000007e234 < (*.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 23.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. lower-*.f64N/A

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

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

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

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

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

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

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

          Reproduce

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