Henrywood and Agarwal, Equation (12)

Percentage Accurate: 67.0% → 79.8%
Time: 22.0s
Alternatives: 31
Speedup: 2.6×

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 31 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: 67.0% accurate, 1.0× speedup?

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

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

Alternative 1: 79.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 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}}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{-227}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{M \cdot \left(M \cdot D\right)}{d}, D \cdot \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right), d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+
          1.0
          (*
           (/ (/ (* M (* D 0.5)) (* d 2.0)) l)
           (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
   (if (<= d -1.25e-271)
     (* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
     (if (<= d 1.7e-227)
       (/
        (fma
         (/ (* M (* M D)) d)
         (* D (* -0.125 (pow (/ h l) 1.5)))
         (* d (sqrt (/ h l))))
        h)
       (* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
	double tmp;
	if (d <= -1.25e-271) {
		tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
	} else if (d <= 1.7e-227) {
		tmp = fma(((M * (M * D)) / d), (D * (-0.125 * pow((h / l), 1.5))), (d * sqrt((h / l)))) / h;
	} else {
		tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
	tmp = 0.0
	if (d <= -1.25e-271)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0);
	elseif (d <= 1.7e-227)
		tmp = Float64(fma(Float64(Float64(M * Float64(M * D)) / d), Float64(D * Float64(-0.125 * (Float64(h / l) ^ 1.5))), Float64(d * sqrt(Float64(h / l)))) / h);
	else
		tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e-271], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.7e-227], N[(N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(D * N[(-0.125 * N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 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}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\


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

    1. Initial program 76.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.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 rewrites79.4%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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. 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 - \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. lower-sqrt.f6479.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{\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 rewrites79.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{\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-eval79.4

        \[\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. unpow1/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. lower-sqrt.f6479.4

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 rewrites79.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{\mathsf{neg}\left(d\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      9. lower-neg.f6486.6

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\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 -1.2500000000000001e-271 < d < 1.69999999999999989e-227

    1. Initial program 34.0%

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

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

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

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

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

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

        if 1.69999999999999989e-227 < d

        1. Initial program 80.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-*.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 rewrites82.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 - \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. 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 - \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. lower-sqrt.f6482.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{\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 rewrites82.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{\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-eval82.6

            \[\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. unpow1/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. sqrt-divN/A

            \[\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 \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
          7. pow1/2N/A

            \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{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) \]
          8. pow1/2N/A

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

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

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

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

            \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{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) \]
          13. lower-sqrt.f6490.9

            \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\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) \]
        8. Applied rewrites90.9%

          \[\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) \]
      3. Recombined 3 regimes into one program.
      4. Final simplification84.7%

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

      Alternative 2: 52.6% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\ \;\;\;\;\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot t\_2\right)}{d}\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t\_2 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \end{array} \end{array} \]
      (FPCore (d h l M D)
       :precision binary64
       (let* ((t_0 (sqrt (/ h l)))
              (t_1
               (*
                (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                (+
                 1.0
                 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
              (t_2 (sqrt (/ h (* l (* l l))))))
         (if (<= t_1 -5e+275)
           (/ (* (* -0.125 (* D D)) (* (* M M) t_2)) d)
           (if (<= t_1 0.0)
             (* t_2 (* (* M D) (* M (/ D (* d 8.0)))))
             (if (<= t_1 5e+170)
               (* (sqrt (/ d h)) (sqrt (/ d l)))
               (if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))))
      double code(double d, double h, double l, double M, double D) {
      	double t_0 = sqrt((h / l));
      	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
      	double t_2 = sqrt((h / (l * (l * l))));
      	double tmp;
      	if (t_1 <= -5e+275) {
      		tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d;
      	} else if (t_1 <= 0.0) {
      		tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))));
      	} else if (t_1 <= 5e+170) {
      		tmp = sqrt((d / h)) * sqrt((d / l));
      	} else if (t_1 <= ((double) INFINITY)) {
      		tmp = (d * t_0) / h;
      	} else {
      		tmp = (-d * t_0) / h;
      	}
      	return tmp;
      }
      
      public static double code(double d, double h, double l, double M, double D) {
      	double t_0 = Math.sqrt((h / l));
      	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
      	double t_2 = Math.sqrt((h / (l * (l * l))));
      	double tmp;
      	if (t_1 <= -5e+275) {
      		tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d;
      	} else if (t_1 <= 0.0) {
      		tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))));
      	} else if (t_1 <= 5e+170) {
      		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
      	} else if (t_1 <= Double.POSITIVE_INFINITY) {
      		tmp = (d * t_0) / h;
      	} else {
      		tmp = (-d * t_0) / h;
      	}
      	return tmp;
      }
      
      def code(d, h, l, M, D):
      	t_0 = math.sqrt((h / l))
      	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
      	t_2 = math.sqrt((h / (l * (l * l))))
      	tmp = 0
      	if t_1 <= -5e+275:
      		tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d
      	elif t_1 <= 0.0:
      		tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))))
      	elif t_1 <= 5e+170:
      		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
      	elif t_1 <= math.inf:
      		tmp = (d * t_0) / h
      	else:
      		tmp = (-d * t_0) / h
      	return tmp
      
      function code(d, h, l, M, D)
      	t_0 = sqrt(Float64(h / l))
      	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
      	t_2 = sqrt(Float64(h / Float64(l * Float64(l * l))))
      	tmp = 0.0
      	if (t_1 <= -5e+275)
      		tmp = Float64(Float64(Float64(-0.125 * Float64(D * D)) * Float64(Float64(M * M) * t_2)) / d);
      	elseif (t_1 <= 0.0)
      		tmp = Float64(t_2 * Float64(Float64(M * D) * Float64(M * Float64(D / Float64(d * 8.0)))));
      	elseif (t_1 <= 5e+170)
      		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
      	elseif (t_1 <= Inf)
      		tmp = Float64(Float64(d * t_0) / h);
      	else
      		tmp = Float64(Float64(Float64(-d) * t_0) / h);
      	end
      	return tmp
      end
      
      function tmp_2 = code(d, h, l, M, D)
      	t_0 = sqrt((h / l));
      	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
      	t_2 = sqrt((h / (l * (l * l))));
      	tmp = 0.0;
      	if (t_1 <= -5e+275)
      		tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d;
      	elseif (t_1 <= 0.0)
      		tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))));
      	elseif (t_1 <= 5e+170)
      		tmp = sqrt((d / h)) * sqrt((d / l));
      	elseif (t_1 <= Inf)
      		tmp = (d * t_0) / h;
      	else
      		tmp = (-d * t_0) / h;
      	end
      	tmp_2 = tmp;
      end
      
      code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$2 * N[(N[(M * D), $MachinePrecision] * N[(M * N[(D / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sqrt{\frac{h}{\ell}}\\
      t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
      t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
      \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
      \;\;\;\;\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot t\_2\right)}{d}\\
      
      \mathbf{elif}\;t\_1 \leq 0:\\
      \;\;\;\;t\_2 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\
      
      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
      \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
      
      \mathbf{elif}\;t\_1 \leq \infty:\\
      \;\;\;\;\frac{d \cdot t\_0}{h}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
      
      
      \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)))) < -5.0000000000000003e275

        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 rewrites17.3%

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

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

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

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

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

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

        if -5.0000000000000003e275 < (*.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 80.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 rewrites25.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 99.0%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. 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-*.f6443.4

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 0.0%

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

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

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

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

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

                    \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                8. Recombined 5 regimes into one program.
                9. Final simplification59.5%

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

                Alternative 3: 52.3% accurate, 0.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_2 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t\_0 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_2}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\ \end{array} \end{array} \]
                (FPCore (d h l M D)
                 :precision binary64
                 (let* ((t_0 (sqrt (/ h (* l (* l l)))))
                        (t_1
                         (*
                          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                          (+
                           1.0
                           (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
                        (t_2 (sqrt (/ h l))))
                   (if (<= t_1 -5e+275)
                     (* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
                     (if (<= t_1 0.0)
                       (* t_0 (* (* M D) (* M (/ D (* d 8.0)))))
                       (if (<= t_1 5e+170)
                         (* (sqrt (/ d h)) (sqrt (/ d l)))
                         (if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
                double code(double d, double h, double l, double M, double D) {
                	double t_0 = sqrt((h / (l * (l * l))));
                	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                	double t_2 = sqrt((h / l));
                	double tmp;
                	if (t_1 <= -5e+275) {
                		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                	} else if (t_1 <= 0.0) {
                		tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))));
                	} else if (t_1 <= 5e+170) {
                		tmp = sqrt((d / h)) * sqrt((d / l));
                	} else if (t_1 <= ((double) INFINITY)) {
                		tmp = (d * t_2) / h;
                	} else {
                		tmp = (-d * t_2) / h;
                	}
                	return tmp;
                }
                
                public static double code(double d, double h, double l, double M, double D) {
                	double t_0 = Math.sqrt((h / (l * (l * l))));
                	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                	double t_2 = Math.sqrt((h / l));
                	double tmp;
                	if (t_1 <= -5e+275) {
                		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                	} else if (t_1 <= 0.0) {
                		tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))));
                	} else if (t_1 <= 5e+170) {
                		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                	} else if (t_1 <= Double.POSITIVE_INFINITY) {
                		tmp = (d * t_2) / h;
                	} else {
                		tmp = (-d * t_2) / h;
                	}
                	return tmp;
                }
                
                def code(d, h, l, M, D):
                	t_0 = math.sqrt((h / (l * (l * l))))
                	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                	t_2 = math.sqrt((h / l))
                	tmp = 0
                	if t_1 <= -5e+275:
                		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d))
                	elif t_1 <= 0.0:
                		tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))))
                	elif t_1 <= 5e+170:
                		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                	elif t_1 <= math.inf:
                		tmp = (d * t_2) / h
                	else:
                		tmp = (-d * t_2) / h
                	return tmp
                
                function code(d, h, l, M, D)
                	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                	t_2 = sqrt(Float64(h / l))
                	tmp = 0.0
                	if (t_1 <= -5e+275)
                		tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                	elseif (t_1 <= 0.0)
                		tmp = Float64(t_0 * Float64(Float64(M * D) * Float64(M * Float64(D / Float64(d * 8.0)))));
                	elseif (t_1 <= 5e+170)
                		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                	elseif (t_1 <= Inf)
                		tmp = Float64(Float64(d * t_2) / h);
                	else
                		tmp = Float64(Float64(Float64(-d) * t_2) / h);
                	end
                	return tmp
                end
                
                function tmp_2 = code(d, h, l, M, D)
                	t_0 = sqrt((h / (l * (l * l))));
                	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                	t_2 = sqrt((h / l));
                	tmp = 0.0;
                	if (t_1 <= -5e+275)
                		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                	elseif (t_1 <= 0.0)
                		tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))));
                	elseif (t_1 <= 5e+170)
                		tmp = sqrt((d / h)) * sqrt((d / l));
                	elseif (t_1 <= Inf)
                		tmp = (d * t_2) / h;
                	else
                		tmp = (-d * t_2) / h;
                	end
                	tmp_2 = tmp;
                end
                
                code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(N[(M * D), $MachinePrecision] * N[(M * N[(D / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                t_2 := \sqrt{\frac{h}{\ell}}\\
                \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
                \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                
                \mathbf{elif}\;t\_1 \leq 0:\\
                \;\;\;\;t\_0 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\
                
                \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                
                \mathbf{elif}\;t\_1 \leq \infty:\\
                \;\;\;\;\frac{d \cdot t\_2}{h}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
                
                
                \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)))) < -5.0000000000000003e275

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -5.0000000000000003e275 < (*.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 80.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 rewrites25.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 99.0%

                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                      2. Add Preprocessing
                      3. 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-*.f6443.4

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

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

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

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

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

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

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

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

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

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

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

                          1. Initial program 0.0%

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

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

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

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

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

                              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                          8. Recombined 5 regimes into one program.
                          9. Final simplification59.1%

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

                          Alternative 4: 51.9% accurate, 0.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_2 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t\_0 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d \cdot 8}\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_2}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\ \end{array} \end{array} \]
                          (FPCore (d h l M D)
                           :precision binary64
                           (let* ((t_0 (sqrt (/ h (* l (* l l)))))
                                  (t_1
                                   (*
                                    (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                    (+
                                     1.0
                                     (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
                                  (t_2 (sqrt (/ h l))))
                             (if (<= t_1 -5e+275)
                               (* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
                               (if (<= t_1 0.0)
                                 (* t_0 (* M (/ (* M (* D D)) (* d 8.0))))
                                 (if (<= t_1 5e+170)
                                   (* (sqrt (/ d h)) (sqrt (/ d l)))
                                   (if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
                          double code(double d, double h, double l, double M, double D) {
                          	double t_0 = sqrt((h / (l * (l * l))));
                          	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                          	double t_2 = sqrt((h / l));
                          	double tmp;
                          	if (t_1 <= -5e+275) {
                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                          	} else if (t_1 <= 0.0) {
                          		tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)));
                          	} else if (t_1 <= 5e+170) {
                          		tmp = sqrt((d / h)) * sqrt((d / l));
                          	} else if (t_1 <= ((double) INFINITY)) {
                          		tmp = (d * t_2) / h;
                          	} else {
                          		tmp = (-d * t_2) / h;
                          	}
                          	return tmp;
                          }
                          
                          public static double code(double d, double h, double l, double M, double D) {
                          	double t_0 = Math.sqrt((h / (l * (l * l))));
                          	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                          	double t_2 = Math.sqrt((h / l));
                          	double tmp;
                          	if (t_1 <= -5e+275) {
                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                          	} else if (t_1 <= 0.0) {
                          		tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)));
                          	} else if (t_1 <= 5e+170) {
                          		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                          	} else if (t_1 <= Double.POSITIVE_INFINITY) {
                          		tmp = (d * t_2) / h;
                          	} else {
                          		tmp = (-d * t_2) / h;
                          	}
                          	return tmp;
                          }
                          
                          def code(d, h, l, M, D):
                          	t_0 = math.sqrt((h / (l * (l * l))))
                          	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                          	t_2 = math.sqrt((h / l))
                          	tmp = 0
                          	if t_1 <= -5e+275:
                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d))
                          	elif t_1 <= 0.0:
                          		tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)))
                          	elif t_1 <= 5e+170:
                          		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                          	elif t_1 <= math.inf:
                          		tmp = (d * t_2) / h
                          	else:
                          		tmp = (-d * t_2) / h
                          	return tmp
                          
                          function code(d, h, l, M, D)
                          	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                          	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                          	t_2 = sqrt(Float64(h / l))
                          	tmp = 0.0
                          	if (t_1 <= -5e+275)
                          		tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                          	elseif (t_1 <= 0.0)
                          		tmp = Float64(t_0 * Float64(M * Float64(Float64(M * Float64(D * D)) / Float64(d * 8.0))));
                          	elseif (t_1 <= 5e+170)
                          		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                          	elseif (t_1 <= Inf)
                          		tmp = Float64(Float64(d * t_2) / h);
                          	else
                          		tmp = Float64(Float64(Float64(-d) * t_2) / h);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(d, h, l, M, D)
                          	t_0 = sqrt((h / (l * (l * l))));
                          	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                          	t_2 = sqrt((h / l));
                          	tmp = 0.0;
                          	if (t_1 <= -5e+275)
                          		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                          	elseif (t_1 <= 0.0)
                          		tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)));
                          	elseif (t_1 <= 5e+170)
                          		tmp = sqrt((d / h)) * sqrt((d / l));
                          	elseif (t_1 <= Inf)
                          		tmp = (d * t_2) / h;
                          	else
                          		tmp = (-d * t_2) / h;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                          t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                          t_2 := \sqrt{\frac{h}{\ell}}\\
                          \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
                          \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                          
                          \mathbf{elif}\;t\_1 \leq 0:\\
                          \;\;\;\;t\_0 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d \cdot 8}\right)\\
                          
                          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                          \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                          
                          \mathbf{elif}\;t\_1 \leq \infty:\\
                          \;\;\;\;\frac{d \cdot t\_2}{h}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
                          
                          
                          \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)))) < -5.0000000000000003e275

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if -5.0000000000000003e275 < (*.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 80.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 rewrites25.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              1. Initial program 99.0%

                                \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              2. Add Preprocessing
                              3. 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-*.f6443.4

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

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

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

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

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

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

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

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

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

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

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

                                  1. Initial program 0.0%

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

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

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

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

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

                                      \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                  8. Recombined 5 regimes into one program.
                                  9. Final simplification57.6%

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

                                  Alternative 5: 51.8% accurate, 0.2× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_2 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;t\_0 \cdot \left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \frac{0.125}{d}\right)\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_2}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\ \end{array} \end{array} \]
                                  (FPCore (d h l M D)
                                   :precision binary64
                                   (let* ((t_0 (sqrt (/ h (* l (* l l)))))
                                          (t_1
                                           (*
                                            (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                            (+
                                             1.0
                                             (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
                                          (t_2 (sqrt (/ h l))))
                                     (if (<= t_1 -5e+275)
                                       (* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
                                       (if (<= t_1 0.0)
                                         (* t_0 (* (* M (* D D)) (* M (/ 0.125 d))))
                                         (if (<= t_1 5e+170)
                                           (* (sqrt (/ d h)) (sqrt (/ d l)))
                                           (if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
                                  double code(double d, double h, double l, double M, double D) {
                                  	double t_0 = sqrt((h / (l * (l * l))));
                                  	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                  	double t_2 = sqrt((h / l));
                                  	double tmp;
                                  	if (t_1 <= -5e+275) {
                                  		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                  	} else if (t_1 <= 0.0) {
                                  		tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)));
                                  	} else if (t_1 <= 5e+170) {
                                  		tmp = sqrt((d / h)) * sqrt((d / l));
                                  	} else if (t_1 <= ((double) INFINITY)) {
                                  		tmp = (d * t_2) / h;
                                  	} else {
                                  		tmp = (-d * t_2) / h;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  public static double code(double d, double h, double l, double M, double D) {
                                  	double t_0 = Math.sqrt((h / (l * (l * l))));
                                  	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                  	double t_2 = Math.sqrt((h / l));
                                  	double tmp;
                                  	if (t_1 <= -5e+275) {
                                  		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                  	} else if (t_1 <= 0.0) {
                                  		tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)));
                                  	} else if (t_1 <= 5e+170) {
                                  		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                                  	} else if (t_1 <= Double.POSITIVE_INFINITY) {
                                  		tmp = (d * t_2) / h;
                                  	} else {
                                  		tmp = (-d * t_2) / h;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(d, h, l, M, D):
                                  	t_0 = math.sqrt((h / (l * (l * l))))
                                  	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                  	t_2 = math.sqrt((h / l))
                                  	tmp = 0
                                  	if t_1 <= -5e+275:
                                  		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d))
                                  	elif t_1 <= 0.0:
                                  		tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)))
                                  	elif t_1 <= 5e+170:
                                  		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                                  	elif t_1 <= math.inf:
                                  		tmp = (d * t_2) / h
                                  	else:
                                  		tmp = (-d * t_2) / h
                                  	return tmp
                                  
                                  function code(d, h, l, M, D)
                                  	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                  	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                  	t_2 = sqrt(Float64(h / l))
                                  	tmp = 0.0
                                  	if (t_1 <= -5e+275)
                                  		tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                  	elseif (t_1 <= 0.0)
                                  		tmp = Float64(t_0 * Float64(Float64(M * Float64(D * D)) * Float64(M * Float64(0.125 / d))));
                                  	elseif (t_1 <= 5e+170)
                                  		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                                  	elseif (t_1 <= Inf)
                                  		tmp = Float64(Float64(d * t_2) / h);
                                  	else
                                  		tmp = Float64(Float64(Float64(-d) * t_2) / h);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(d, h, l, M, D)
                                  	t_0 = sqrt((h / (l * (l * l))));
                                  	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                  	t_2 = sqrt((h / l));
                                  	tmp = 0.0;
                                  	if (t_1 <= -5e+275)
                                  		tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
                                  	elseif (t_1 <= 0.0)
                                  		tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)));
                                  	elseif (t_1 <= 5e+170)
                                  		tmp = sqrt((d / h)) * sqrt((d / l));
                                  	elseif (t_1 <= Inf)
                                  		tmp = (d * t_2) / h;
                                  	else
                                  		tmp = (-d * t_2) / h;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                  t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                  t_2 := \sqrt{\frac{h}{\ell}}\\
                                  \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
                                  \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                  
                                  \mathbf{elif}\;t\_1 \leq 0:\\
                                  \;\;\;\;t\_0 \cdot \left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \frac{0.125}{d}\right)\right)\\
                                  
                                  \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                  \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                                  
                                  \mathbf{elif}\;t\_1 \leq \infty:\\
                                  \;\;\;\;\frac{d \cdot t\_2}{h}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
                                  
                                  
                                  \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)))) < -5.0000000000000003e275

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -5.0000000000000003e275 < (*.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 80.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 rewrites25.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      1. Initial program 99.0%

                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      2. Add Preprocessing
                                      3. 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-*.f6443.4

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

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

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

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

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

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

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

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

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

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

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

                                          1. Initial program 0.0%

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

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

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

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

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

                                              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                          8. Recombined 5 regimes into one program.
                                          9. Final simplification57.5%

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

                                          Alternative 6: 65.7% accurate, 0.3× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-91}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot d}, \frac{-h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot 0.125\right), 1\right)\right)\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_2}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\ \end{array} \end{array} \]
                                          (FPCore (d h l M D)
                                           :precision binary64
                                           (let* ((t_0 (sqrt (/ d h)))
                                                  (t_1 (sqrt (/ d l)))
                                                  (t_2 (sqrt (/ h l)))
                                                  (t_3
                                                   (*
                                                    (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                    (+
                                                     1.0
                                                     (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                             (if (<= t_3 -5e-91)
                                               (*
                                                t_0
                                                (* t_1 (fma (/ (* M D) (* d d)) (* (/ (- h) l) (* (* M D) 0.125)) 1.0)))
                                               (if (<= t_3 5e+170)
                                                 (* t_0 t_1)
                                                 (if (<= t_3 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h))))))
                                          double code(double d, double h, double l, double M, double D) {
                                          	double t_0 = sqrt((d / h));
                                          	double t_1 = sqrt((d / l));
                                          	double t_2 = sqrt((h / l));
                                          	double t_3 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                          	double tmp;
                                          	if (t_3 <= -5e-91) {
                                          		tmp = t_0 * (t_1 * fma(((M * D) / (d * d)), ((-h / l) * ((M * D) * 0.125)), 1.0));
                                          	} else if (t_3 <= 5e+170) {
                                          		tmp = t_0 * t_1;
                                          	} else if (t_3 <= ((double) INFINITY)) {
                                          		tmp = (d * t_2) / h;
                                          	} else {
                                          		tmp = (-d * t_2) / h;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(d, h, l, M, D)
                                          	t_0 = sqrt(Float64(d / h))
                                          	t_1 = sqrt(Float64(d / l))
                                          	t_2 = sqrt(Float64(h / l))
                                          	t_3 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                          	tmp = 0.0
                                          	if (t_3 <= -5e-91)
                                          		tmp = Float64(t_0 * Float64(t_1 * fma(Float64(Float64(M * D) / Float64(d * d)), Float64(Float64(Float64(-h) / l) * Float64(Float64(M * D) * 0.125)), 1.0)));
                                          	elseif (t_3 <= 5e+170)
                                          		tmp = Float64(t_0 * t_1);
                                          	elseif (t_3 <= Inf)
                                          		tmp = Float64(Float64(d * t_2) / h);
                                          	else
                                          		tmp = Float64(Float64(Float64(-d) * t_2) / h);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(M * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[((-h) / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \sqrt{\frac{d}{h}}\\
                                          t_1 := \sqrt{\frac{d}{\ell}}\\
                                          t_2 := \sqrt{\frac{h}{\ell}}\\
                                          t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                          \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-91}:\\
                                          \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot d}, \frac{-h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot 0.125\right), 1\right)\right)\\
                                          
                                          \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\
                                          \;\;\;\;t\_0 \cdot t\_1\\
                                          
                                          \mathbf{elif}\;t\_3 \leq \infty:\\
                                          \;\;\;\;\frac{d \cdot t\_2}{h}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
                                          
                                          
                                          \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.99999999999999997e-91

                                            1. Initial program 87.3%

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

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

                                                \[\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 rewrites88.2%

                                              \[\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. Applied rewrites59.3%

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

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

                                            if -4.99999999999999997e-91 < (*.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.99999999999999977e170

                                            1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                1. Initial program 0.0%

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

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

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

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

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

                                                    \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                8. Recombined 4 regimes into one program.
                                                9. Final simplification68.6%

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

                                                Alternative 7: 64.3% accurate, 0.3× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_3 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-91}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_3}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\ \end{array} \end{array} \]
                                                (FPCore (d h l M D)
                                                 :precision binary64
                                                 (let* ((t_0 (sqrt (/ d h)))
                                                        (t_1 (sqrt (/ d l)))
                                                        (t_2
                                                         (*
                                                          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                          (+
                                                           1.0
                                                           (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
                                                        (t_3 (sqrt (/ h l))))
                                                   (if (<= t_2 -5e-91)
                                                     (*
                                                      t_0
                                                      (* t_1 (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0)))
                                                     (if (<= t_2 5e+170)
                                                       (* t_0 t_1)
                                                       (if (<= t_2 INFINITY) (/ (* d t_3) h) (/ (* (- d) t_3) h))))))
                                                double code(double d, double h, double l, double M, double D) {
                                                	double t_0 = sqrt((d / h));
                                                	double t_1 = sqrt((d / l));
                                                	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                	double t_3 = sqrt((h / l));
                                                	double tmp;
                                                	if (t_2 <= -5e-91) {
                                                		tmp = t_0 * (t_1 * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0));
                                                	} else if (t_2 <= 5e+170) {
                                                		tmp = t_0 * t_1;
                                                	} else if (t_2 <= ((double) INFINITY)) {
                                                		tmp = (d * t_3) / h;
                                                	} else {
                                                		tmp = (-d * t_3) / h;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(d, h, l, M, D)
                                                	t_0 = sqrt(Float64(d / h))
                                                	t_1 = sqrt(Float64(d / l))
                                                	t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                	t_3 = sqrt(Float64(h / l))
                                                	tmp = 0.0
                                                	if (t_2 <= -5e-91)
                                                		tmp = Float64(t_0 * Float64(t_1 * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)));
                                                	elseif (t_2 <= 5e+170)
                                                		tmp = Float64(t_0 * t_1);
                                                	elseif (t_2 <= Inf)
                                                		tmp = Float64(Float64(d * t_3) / h);
                                                	else
                                                		tmp = Float64(Float64(Float64(-d) * t_3) / h);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$3), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_0 := \sqrt{\frac{d}{h}}\\
                                                t_1 := \sqrt{\frac{d}{\ell}}\\
                                                t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                t_3 := \sqrt{\frac{h}{\ell}}\\
                                                \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-91}:\\
                                                \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)\right)\\
                                                
                                                \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
                                                \;\;\;\;t\_0 \cdot t\_1\\
                                                
                                                \mathbf{elif}\;t\_2 \leq \infty:\\
                                                \;\;\;\;\frac{d \cdot t\_3}{h}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\
                                                
                                                
                                                \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.99999999999999997e-91

                                                  1. Initial program 87.3%

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

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

                                                      \[\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 rewrites88.2%

                                                    \[\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. Applied rewrites59.3%

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

                                                  if -4.99999999999999997e-91 < (*.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.99999999999999977e170

                                                  1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      1. Initial program 0.0%

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

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

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

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

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

                                                          \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                      8. Recombined 4 regimes into one program.
                                                      9. Final simplification66.8%

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

                                                      Alternative 8: 64.5% accurate, 0.3× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-91}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;t\_1 \cdot t\_0\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_2}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\ \end{array} \end{array} \]
                                                      (FPCore (d h l M D)
                                                       :precision binary64
                                                       (let* ((t_0 (sqrt (/ d l)))
                                                              (t_1 (sqrt (/ d h)))
                                                              (t_2 (sqrt (/ h l)))
                                                              (t_3
                                                               (*
                                                                (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                (+
                                                                 1.0
                                                                 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                         (if (<= t_3 -5e-91)
                                                           (*
                                                            t_0
                                                            (* t_1 (- 1.0 (* (/ h l) (* (* M D) (* 0.125 (* M (/ D (* d d)))))))))
                                                           (if (<= t_3 5e+170)
                                                             (* t_1 t_0)
                                                             (if (<= t_3 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h))))))
                                                      double code(double d, double h, double l, double M, double D) {
                                                      	double t_0 = sqrt((d / l));
                                                      	double t_1 = sqrt((d / h));
                                                      	double t_2 = sqrt((h / l));
                                                      	double t_3 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                      	double tmp;
                                                      	if (t_3 <= -5e-91) {
                                                      		tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))));
                                                      	} else if (t_3 <= 5e+170) {
                                                      		tmp = t_1 * t_0;
                                                      	} else if (t_3 <= ((double) INFINITY)) {
                                                      		tmp = (d * t_2) / h;
                                                      	} else {
                                                      		tmp = (-d * t_2) / h;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      public static double code(double d, double h, double l, double M, double D) {
                                                      	double t_0 = Math.sqrt((d / l));
                                                      	double t_1 = Math.sqrt((d / h));
                                                      	double t_2 = Math.sqrt((h / l));
                                                      	double t_3 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                      	double tmp;
                                                      	if (t_3 <= -5e-91) {
                                                      		tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))));
                                                      	} else if (t_3 <= 5e+170) {
                                                      		tmp = t_1 * t_0;
                                                      	} else if (t_3 <= Double.POSITIVE_INFINITY) {
                                                      		tmp = (d * t_2) / h;
                                                      	} else {
                                                      		tmp = (-d * t_2) / h;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(d, h, l, M, D):
                                                      	t_0 = math.sqrt((d / l))
                                                      	t_1 = math.sqrt((d / h))
                                                      	t_2 = math.sqrt((h / l))
                                                      	t_3 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                                      	tmp = 0
                                                      	if t_3 <= -5e-91:
                                                      		tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))))
                                                      	elif t_3 <= 5e+170:
                                                      		tmp = t_1 * t_0
                                                      	elif t_3 <= math.inf:
                                                      		tmp = (d * t_2) / h
                                                      	else:
                                                      		tmp = (-d * t_2) / h
                                                      	return tmp
                                                      
                                                      function code(d, h, l, M, D)
                                                      	t_0 = sqrt(Float64(d / l))
                                                      	t_1 = sqrt(Float64(d / h))
                                                      	t_2 = sqrt(Float64(h / l))
                                                      	t_3 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                      	tmp = 0.0
                                                      	if (t_3 <= -5e-91)
                                                      		tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(M * D) * Float64(0.125 * Float64(M * Float64(D / Float64(d * d)))))))));
                                                      	elseif (t_3 <= 5e+170)
                                                      		tmp = Float64(t_1 * t_0);
                                                      	elseif (t_3 <= Inf)
                                                      		tmp = Float64(Float64(d * t_2) / h);
                                                      	else
                                                      		tmp = Float64(Float64(Float64(-d) * t_2) / h);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(d, h, l, M, D)
                                                      	t_0 = sqrt((d / l));
                                                      	t_1 = sqrt((d / h));
                                                      	t_2 = sqrt((h / l));
                                                      	t_3 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                                      	tmp = 0.0;
                                                      	if (t_3 <= -5e-91)
                                                      		tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))));
                                                      	elseif (t_3 <= 5e+170)
                                                      		tmp = t_1 * t_0;
                                                      	elseif (t_3 <= Inf)
                                                      		tmp = (d * t_2) / h;
                                                      	else
                                                      		tmp = (-d * t_2) / h;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[d_, h_, l_, M_, D_] := 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[(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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(0.125 * N[(M * N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+170], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      t_0 := \sqrt{\frac{d}{\ell}}\\
                                                      t_1 := \sqrt{\frac{d}{h}}\\
                                                      t_2 := \sqrt{\frac{h}{\ell}}\\
                                                      t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                      \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-91}:\\
                                                      \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right)\right)\\
                                                      
                                                      \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\
                                                      \;\;\;\;t\_1 \cdot t\_0\\
                                                      
                                                      \mathbf{elif}\;t\_3 \leq \infty:\\
                                                      \;\;\;\;\frac{d \cdot t\_2}{h}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
                                                      
                                                      
                                                      \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.99999999999999997e-91

                                                        1. Initial program 87.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 rewrites21.7%

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

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

                                                        if -4.99999999999999997e-91 < (*.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.99999999999999977e170

                                                        1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            1. Initial program 0.0%

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

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

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

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

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

                                                                \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                            8. Recombined 4 regimes into one program.
                                                            9. Final simplification67.9%

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

                                                            Alternative 9: 51.6% accurate, 0.3× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-166}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \end{array} \end{array} \]
                                                            (FPCore (d h l M D)
                                                             :precision binary64
                                                             (let* ((t_0 (sqrt (/ h l)))
                                                                    (t_1
                                                                     (*
                                                                      (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                      (+
                                                                       1.0
                                                                       (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                               (if (<= t_1 -2e-166)
                                                                 (* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                 (if (<= t_1 5e+170)
                                                                   (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                   (if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h))))))
                                                            double code(double d, double h, double l, double M, double D) {
                                                            	double t_0 = sqrt((h / l));
                                                            	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                            	double tmp;
                                                            	if (t_1 <= -2e-166) {
                                                            		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                            	} else if (t_1 <= 5e+170) {
                                                            		tmp = sqrt((d / h)) * sqrt((d / l));
                                                            	} else if (t_1 <= ((double) INFINITY)) {
                                                            		tmp = (d * t_0) / h;
                                                            	} else {
                                                            		tmp = (-d * t_0) / h;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            public static double code(double d, double h, double l, double M, double D) {
                                                            	double t_0 = Math.sqrt((h / l));
                                                            	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                            	double tmp;
                                                            	if (t_1 <= -2e-166) {
                                                            		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                            	} else if (t_1 <= 5e+170) {
                                                            		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                                                            	} else if (t_1 <= Double.POSITIVE_INFINITY) {
                                                            		tmp = (d * t_0) / h;
                                                            	} else {
                                                            		tmp = (-d * t_0) / h;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(d, h, l, M, D):
                                                            	t_0 = math.sqrt((h / l))
                                                            	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                                            	tmp = 0
                                                            	if t_1 <= -2e-166:
                                                            		tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d))
                                                            	elif t_1 <= 5e+170:
                                                            		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                                                            	elif t_1 <= math.inf:
                                                            		tmp = (d * t_0) / h
                                                            	else:
                                                            		tmp = (-d * t_0) / h
                                                            	return tmp
                                                            
                                                            function code(d, h, l, M, D)
                                                            	t_0 = sqrt(Float64(h / l))
                                                            	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                            	tmp = 0.0
                                                            	if (t_1 <= -2e-166)
                                                            		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                            	elseif (t_1 <= 5e+170)
                                                            		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                                                            	elseif (t_1 <= Inf)
                                                            		tmp = Float64(Float64(d * t_0) / h);
                                                            	else
                                                            		tmp = Float64(Float64(Float64(-d) * t_0) / h);
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(d, h, l, M, D)
                                                            	t_0 = sqrt((h / l));
                                                            	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                                            	tmp = 0.0;
                                                            	if (t_1 <= -2e-166)
                                                            		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                            	elseif (t_1 <= 5e+170)
                                                            		tmp = sqrt((d / h)) * sqrt((d / l));
                                                            	elseif (t_1 <= Inf)
                                                            		tmp = (d * t_0) / h;
                                                            	else
                                                            		tmp = (-d * t_0) / h;
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-166], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            t_0 := \sqrt{\frac{h}{\ell}}\\
                                                            t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                            \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-166}:\\
                                                            \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                            
                                                            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                                            \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                                                            
                                                            \mathbf{elif}\;t\_1 \leq \infty:\\
                                                            \;\;\;\;\frac{d \cdot t\_0}{h}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
                                                            
                                                            
                                                            \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)))) < -2.00000000000000008e-166

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              if -2.00000000000000008e-166 < (*.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.99999999999999977e170

                                                              1. Initial program 91.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-*.f6447.1

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

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

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

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

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

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

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

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

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

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

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

                                                                  1. Initial program 0.0%

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

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

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

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

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

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

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

                                                                  Alternative 10: 48.0% accurate, 0.3× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ t_3 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\ \;\;\;\;t\_0 \cdot \left(-t\_1\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_3}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\ \end{array} \end{array} \]
                                                                  (FPCore (d h l M D)
                                                                   :precision binary64
                                                                   (let* ((t_0 (sqrt (/ d h)))
                                                                          (t_1 (sqrt (/ d l)))
                                                                          (t_2
                                                                           (*
                                                                            (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                            (+
                                                                             1.0
                                                                             (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
                                                                          (t_3 (sqrt (/ h l))))
                                                                     (if (<= t_2 -2e-166)
                                                                       (* t_0 (- t_1))
                                                                       (if (<= t_2 5e+170)
                                                                         (* t_0 t_1)
                                                                         (if (<= t_2 INFINITY) (/ (* d t_3) h) (/ (* (- d) t_3) h))))))
                                                                  double code(double d, double h, double l, double M, double D) {
                                                                  	double t_0 = sqrt((d / h));
                                                                  	double t_1 = sqrt((d / l));
                                                                  	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                  	double t_3 = sqrt((h / l));
                                                                  	double tmp;
                                                                  	if (t_2 <= -2e-166) {
                                                                  		tmp = t_0 * -t_1;
                                                                  	} else if (t_2 <= 5e+170) {
                                                                  		tmp = t_0 * t_1;
                                                                  	} else if (t_2 <= ((double) INFINITY)) {
                                                                  		tmp = (d * t_3) / h;
                                                                  	} else {
                                                                  		tmp = (-d * t_3) / h;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  public static double code(double d, double h, double l, double M, double D) {
                                                                  	double t_0 = Math.sqrt((d / h));
                                                                  	double t_1 = Math.sqrt((d / l));
                                                                  	double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                  	double t_3 = Math.sqrt((h / l));
                                                                  	double tmp;
                                                                  	if (t_2 <= -2e-166) {
                                                                  		tmp = t_0 * -t_1;
                                                                  	} else if (t_2 <= 5e+170) {
                                                                  		tmp = t_0 * t_1;
                                                                  	} else if (t_2 <= Double.POSITIVE_INFINITY) {
                                                                  		tmp = (d * t_3) / h;
                                                                  	} else {
                                                                  		tmp = (-d * t_3) / h;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(d, h, l, M, D):
                                                                  	t_0 = math.sqrt((d / h))
                                                                  	t_1 = math.sqrt((d / l))
                                                                  	t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                                                  	t_3 = math.sqrt((h / l))
                                                                  	tmp = 0
                                                                  	if t_2 <= -2e-166:
                                                                  		tmp = t_0 * -t_1
                                                                  	elif t_2 <= 5e+170:
                                                                  		tmp = t_0 * t_1
                                                                  	elif t_2 <= math.inf:
                                                                  		tmp = (d * t_3) / h
                                                                  	else:
                                                                  		tmp = (-d * t_3) / h
                                                                  	return tmp
                                                                  
                                                                  function code(d, h, l, M, D)
                                                                  	t_0 = sqrt(Float64(d / h))
                                                                  	t_1 = sqrt(Float64(d / l))
                                                                  	t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                  	t_3 = sqrt(Float64(h / l))
                                                                  	tmp = 0.0
                                                                  	if (t_2 <= -2e-166)
                                                                  		tmp = Float64(t_0 * Float64(-t_1));
                                                                  	elseif (t_2 <= 5e+170)
                                                                  		tmp = Float64(t_0 * t_1);
                                                                  	elseif (t_2 <= Inf)
                                                                  		tmp = Float64(Float64(d * t_3) / h);
                                                                  	else
                                                                  		tmp = Float64(Float64(Float64(-d) * t_3) / h);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(d, h, l, M, D)
                                                                  	t_0 = sqrt((d / h));
                                                                  	t_1 = sqrt((d / l));
                                                                  	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                                                  	t_3 = sqrt((h / l));
                                                                  	tmp = 0.0;
                                                                  	if (t_2 <= -2e-166)
                                                                  		tmp = t_0 * -t_1;
                                                                  	elseif (t_2 <= 5e+170)
                                                                  		tmp = t_0 * t_1;
                                                                  	elseif (t_2 <= Inf)
                                                                  		tmp = (d * t_3) / h;
                                                                  	else
                                                                  		tmp = (-d * t_3) / h;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -2e-166], N[(t$95$0 * (-t$95$1)), $MachinePrecision], If[LessEqual[t$95$2, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$3), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  t_0 := \sqrt{\frac{d}{h}}\\
                                                                  t_1 := \sqrt{\frac{d}{\ell}}\\
                                                                  t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                  t_3 := \sqrt{\frac{h}{\ell}}\\
                                                                  \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
                                                                  \;\;\;\;t\_0 \cdot \left(-t\_1\right)\\
                                                                  
                                                                  \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
                                                                  \;\;\;\;t\_0 \cdot t\_1\\
                                                                  
                                                                  \mathbf{elif}\;t\_2 \leq \infty:\\
                                                                  \;\;\;\;\frac{d \cdot t\_3}{h}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\
                                                                  
                                                                  
                                                                  \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)))) < -2.00000000000000008e-166

                                                                    1. Initial program 87.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 \left({\left(\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 rewrites88.3%

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

                                                                        \[\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 rewrites88.3%

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

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

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

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

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

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

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

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

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

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

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

                                                                    if -2.00000000000000008e-166 < (*.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.99999999999999977e170

                                                                    1. Initial program 91.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-*.f6447.1

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

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

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

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

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

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

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

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

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

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

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

                                                                        1. Initial program 0.0%

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

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

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

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

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

                                                                            \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                                        8. Recombined 4 regimes into one program.
                                                                        9. Final simplification51.5%

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

                                                                        Alternative 11: 49.5% accurate, 0.3× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                        (FPCore (d h l M D)
                                                                         :precision binary64
                                                                         (let* ((t_0 (sqrt (/ h l)))
                                                                                (t_1 (/ (* (- d) t_0) h))
                                                                                (t_2
                                                                                 (*
                                                                                  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                  (+
                                                                                   1.0
                                                                                   (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                           (if (<= t_2 -2e-166)
                                                                             t_1
                                                                             (if (<= t_2 5e+170)
                                                                               (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                               (if (<= t_2 INFINITY) (/ (* d t_0) h) t_1)))))
                                                                        double code(double d, double h, double l, double M, double D) {
                                                                        	double t_0 = sqrt((h / l));
                                                                        	double t_1 = (-d * t_0) / h;
                                                                        	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                        	double tmp;
                                                                        	if (t_2 <= -2e-166) {
                                                                        		tmp = t_1;
                                                                        	} else if (t_2 <= 5e+170) {
                                                                        		tmp = sqrt((d / h)) * sqrt((d / l));
                                                                        	} else if (t_2 <= ((double) INFINITY)) {
                                                                        		tmp = (d * t_0) / h;
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        public static double code(double d, double h, double l, double M, double D) {
                                                                        	double t_0 = Math.sqrt((h / l));
                                                                        	double t_1 = (-d * t_0) / h;
                                                                        	double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                        	double tmp;
                                                                        	if (t_2 <= -2e-166) {
                                                                        		tmp = t_1;
                                                                        	} else if (t_2 <= 5e+170) {
                                                                        		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                                                                        	} else if (t_2 <= Double.POSITIVE_INFINITY) {
                                                                        		tmp = (d * t_0) / h;
                                                                        	} else {
                                                                        		tmp = t_1;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(d, h, l, M, D):
                                                                        	t_0 = math.sqrt((h / l))
                                                                        	t_1 = (-d * t_0) / h
                                                                        	t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                                                        	tmp = 0
                                                                        	if t_2 <= -2e-166:
                                                                        		tmp = t_1
                                                                        	elif t_2 <= 5e+170:
                                                                        		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                                                                        	elif t_2 <= math.inf:
                                                                        		tmp = (d * t_0) / h
                                                                        	else:
                                                                        		tmp = t_1
                                                                        	return tmp
                                                                        
                                                                        function code(d, h, l, M, D)
                                                                        	t_0 = sqrt(Float64(h / l))
                                                                        	t_1 = Float64(Float64(Float64(-d) * t_0) / h)
                                                                        	t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                        	tmp = 0.0
                                                                        	if (t_2 <= -2e-166)
                                                                        		tmp = t_1;
                                                                        	elseif (t_2 <= 5e+170)
                                                                        		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                                                                        	elseif (t_2 <= Inf)
                                                                        		tmp = Float64(Float64(d * t_0) / h);
                                                                        	else
                                                                        		tmp = t_1;
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(d, h, l, M, D)
                                                                        	t_0 = sqrt((h / l));
                                                                        	t_1 = (-d * t_0) / h;
                                                                        	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                                                        	tmp = 0.0;
                                                                        	if (t_2 <= -2e-166)
                                                                        		tmp = t_1;
                                                                        	elseif (t_2 <= 5e+170)
                                                                        		tmp = sqrt((d / h)) * sqrt((d / l));
                                                                        	elseif (t_2 <= Inf)
                                                                        		tmp = (d * t_0) / h;
                                                                        	else
                                                                        		tmp = t_1;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]}, Block[{t$95$2 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-166], t$95$1, If[LessEqual[t$95$2, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        t_0 := \sqrt{\frac{h}{\ell}}\\
                                                                        t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\
                                                                        t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                        \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
                                                                        \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                                                                        
                                                                        \mathbf{elif}\;t\_2 \leq \infty:\\
                                                                        \;\;\;\;\frac{d \cdot t\_0}{h}\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t\_1\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 3 regimes
                                                                        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.00000000000000008e-166 or +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

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

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

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

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

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

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

                                                                            if -2.00000000000000008e-166 < (*.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.99999999999999977e170

                                                                            1. Initial program 91.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-*.f6447.1

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \frac{d \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                                                              8. Recombined 3 regimes into one program.
                                                                              9. Final simplification50.9%

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

                                                                              Alternative 12: 74.5% accurate, 0.4× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M \cdot D}{d \cdot 2}\\ t_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 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\ \end{array} \end{array} \]
                                                                              (FPCore (d h l M D)
                                                                               :precision binary64
                                                                               (let* ((t_0 (/ (* M D) (* d 2.0)))
                                                                                      (t_1
                                                                                       (*
                                                                                        (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                        (+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0)))))))
                                                                                 (if (<= t_1 5e+170)
                                                                                   (*
                                                                                    (+ 1.0 (* (/ (/ (* M (* D 0.5)) (* d 2.0)) l) (/ t_0 (/ -1.0 h))))
                                                                                    (* (sqrt (/ d h)) (sqrt (/ d l))))
                                                                                   (if (<= t_1 INFINITY)
                                                                                     (/ (* d (sqrt (/ h l))) h)
                                                                                     (*
                                                                                      h
                                                                                      (fma
                                                                                       d
                                                                                       (sqrt (/ 1.0 (* l (* h (* h h)))))
                                                                                       (*
                                                                                        (* -0.125 (/ (* M (* M (* D D))) d))
                                                                                        (sqrt (/ 1.0 (* l (* h (* l l))))))))))))
                                                                              double code(double d, double h, double l, double M, double D) {
                                                                              	double t_0 = (M * D) / (d * 2.0);
                                                                              	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0))));
                                                                              	double tmp;
                                                                              	if (t_1 <= 5e+170) {
                                                                              		tmp = (1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (t_0 / (-1.0 / h)))) * (sqrt((d / h)) * sqrt((d / l)));
                                                                              	} else if (t_1 <= ((double) INFINITY)) {
                                                                              		tmp = (d * sqrt((h / l))) / h;
                                                                              	} else {
                                                                              		tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              function code(d, h, l, M, D)
                                                                              	t_0 = Float64(Float64(M * D) / Float64(d * 2.0))
                                                                              	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                              	tmp = 0.0
                                                                              	if (t_1 <= 5e+170)
                                                                              		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(t_0 / Float64(-1.0 / h)))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))));
                                                                              	elseif (t_1 <= Inf)
                                                                              		tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h);
                                                                              	else
                                                                              		tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l))))))));
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              t_0 := \frac{M \cdot D}{d \cdot 2}\\
                                                                              t_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 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                              \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                                                              \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
                                                                              
                                                                              \mathbf{elif}\;t\_1 \leq \infty:\\
                                                                              \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\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)))) < 4.99999999999999977e170

                                                                                1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                  \[\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-eval89.7

                                                                                    \[\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. unpow1/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. lower-sqrt.f6489.7

                                                                                    \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 rewrites89.7%

                                                                                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 4.99999999999999977e170 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

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

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

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

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

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

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

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

                                                                                  1. Initial program 0.0%

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

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

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

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

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

                                                                                Alternative 13: 74.5% accurate, 0.4× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M \cdot D}{d \cdot 2}\\ t_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 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\left(\sqrt{\frac{d}{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 \left(h \cdot t\_0\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\ \end{array} \end{array} \]
                                                                                (FPCore (d h l M D)
                                                                                 :precision binary64
                                                                                 (let* ((t_0 (/ (* M D) (* d 2.0)))
                                                                                        (t_1
                                                                                         (*
                                                                                          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                          (+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0)))))))
                                                                                   (if (<= t_1 5e+170)
                                                                                     (*
                                                                                      (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                                      (- 1.0 (* (/ (/ (* M (* D 0.5)) (* d 2.0)) l) (* h t_0))))
                                                                                     (if (<= t_1 INFINITY)
                                                                                       (/ (* d (sqrt (/ h l))) h)
                                                                                       (*
                                                                                        h
                                                                                        (fma
                                                                                         d
                                                                                         (sqrt (/ 1.0 (* l (* h (* h h)))))
                                                                                         (*
                                                                                          (* -0.125 (/ (* M (* M (* D D))) d))
                                                                                          (sqrt (/ 1.0 (* l (* h (* l l))))))))))))
                                                                                double code(double d, double h, double l, double M, double D) {
                                                                                	double t_0 = (M * D) / (d * 2.0);
                                                                                	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0))));
                                                                                	double tmp;
                                                                                	if (t_1 <= 5e+170) {
                                                                                		tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((((M * (D * 0.5)) / (d * 2.0)) / l) * (h * t_0)));
                                                                                	} else if (t_1 <= ((double) INFINITY)) {
                                                                                		tmp = (d * sqrt((h / l))) / h;
                                                                                	} else {
                                                                                		tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                function code(d, h, l, M, D)
                                                                                	t_0 = Float64(Float64(M * D) / Float64(d * 2.0))
                                                                                	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                	tmp = 0.0
                                                                                	if (t_1 <= 5e+170)
                                                                                		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(h * t_0))));
                                                                                	elseif (t_1 <= Inf)
                                                                                		tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h);
                                                                                	else
                                                                                		tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l))))))));
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                t_0 := \frac{M \cdot D}{d \cdot 2}\\
                                                                                t_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 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                                                                \;\;\;\;\left(\sqrt{\frac{d}{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 \left(h \cdot t\_0\right)\right)\\
                                                                                
                                                                                \mathbf{elif}\;t\_1 \leq \infty:\\
                                                                                \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\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)))) < 4.99999999999999977e170

                                                                                  1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                    \[\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-eval89.7

                                                                                      \[\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. unpow1/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. lower-sqrt.f6489.7

                                                                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 rewrites89.7%

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

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

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

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

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

                                                                                      \[\leadsto \left(\sqrt{\frac{d}{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 \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]
                                                                                  10. Applied rewrites89.7%

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

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

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

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

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

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

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

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

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

                                                                                    1. Initial program 0.0%

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

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

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

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

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

                                                                                  Alternative 14: 72.5% accurate, 0.4× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\ \end{array} \end{array} \]
                                                                                  (FPCore (d h l M D)
                                                                                   :precision binary64
                                                                                   (let* ((t_0
                                                                                           (*
                                                                                            (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                            (+
                                                                                             1.0
                                                                                             (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                                     (if (<= t_0 5e+170)
                                                                                       (*
                                                                                        (sqrt (/ d h))
                                                                                        (*
                                                                                         (sqrt (/ d l))
                                                                                         (fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
                                                                                       (if (<= t_0 INFINITY)
                                                                                         (/ (* d (sqrt (/ h l))) h)
                                                                                         (*
                                                                                          h
                                                                                          (fma
                                                                                           d
                                                                                           (sqrt (/ 1.0 (* l (* h (* h h)))))
                                                                                           (*
                                                                                            (* -0.125 (/ (* M (* M (* D D))) d))
                                                                                            (sqrt (/ 1.0 (* l (* h (* l l))))))))))))
                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                  	double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                  	double tmp;
                                                                                  	if (t_0 <= 5e+170) {
                                                                                  		tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
                                                                                  	} else if (t_0 <= ((double) INFINITY)) {
                                                                                  		tmp = (d * sqrt((h / l))) / h;
                                                                                  	} else {
                                                                                  		tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  function code(d, h, l, M, D)
                                                                                  	t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                  	tmp = 0.0
                                                                                  	if (t_0 <= 5e+170)
                                                                                  		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0)));
                                                                                  	elseif (t_0 <= Inf)
                                                                                  		tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h);
                                                                                  	else
                                                                                  		tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l))))))));
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                  \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\
                                                                                  \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
                                                                                  
                                                                                  \mathbf{elif}\;t\_0 \leq \infty:\\
                                                                                  \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\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)))) < 4.99999999999999977e170

                                                                                    1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                      \[\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. Applied rewrites65.5%

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

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

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

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

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

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

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

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

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

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

                                                                                      1. Initial program 0.0%

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

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

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

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

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

                                                                                    Alternative 15: 72.8% accurate, 0.4× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\ \end{array} \end{array} \]
                                                                                    (FPCore (d h l M D)
                                                                                     :precision binary64
                                                                                     (let* ((t_0
                                                                                             (*
                                                                                              (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                              (+
                                                                                               1.0
                                                                                               (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                                       (if (<= t_0 5e+170)
                                                                                         (*
                                                                                          (sqrt (/ d h))
                                                                                          (*
                                                                                           (sqrt (/ d l))
                                                                                           (fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
                                                                                         (if (<= t_0 INFINITY)
                                                                                           (/ (* d (sqrt (/ h l))) h)
                                                                                           (*
                                                                                            h
                                                                                            (fma
                                                                                             d
                                                                                             (sqrt (/ 1.0 (* h (* l (* h h)))))
                                                                                             (*
                                                                                              (sqrt (/ 1.0 (* l (* h (* l l)))))
                                                                                              (* (* D (* D (* M M))) (/ -0.125 d)))))))))
                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                    	double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                    	double tmp;
                                                                                    	if (t_0 <= 5e+170) {
                                                                                    		tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
                                                                                    	} else if (t_0 <= ((double) INFINITY)) {
                                                                                    		tmp = (d * sqrt((h / l))) / h;
                                                                                    	} else {
                                                                                    		tmp = h * fma(d, sqrt((1.0 / (h * (l * (h * h))))), (sqrt((1.0 / (l * (h * (l * l))))) * ((D * (D * (M * M))) * (-0.125 / d))));
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    function code(d, h, l, M, D)
                                                                                    	t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                    	tmp = 0.0
                                                                                    	if (t_0 <= 5e+170)
                                                                                    		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0)));
                                                                                    	elseif (t_0 <= Inf)
                                                                                    		tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h);
                                                                                    	else
                                                                                    		tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(h * h))))), Float64(sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l))))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d)))));
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(h * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                    \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\
                                                                                    \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
                                                                                    
                                                                                    \mathbf{elif}\;t\_0 \leq \infty:\\
                                                                                    \;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\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)))) < 4.99999999999999977e170

                                                                                      1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                        \[\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. Applied rewrites65.5%

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

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

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

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

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

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

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

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

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

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

                                                                                        1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      Alternative 16: 71.5% accurate, 0.5× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \end{array} \end{array} \]
                                                                                      (FPCore (d h l M D)
                                                                                       :precision binary64
                                                                                       (let* ((t_0 (sqrt (/ h l)))
                                                                                              (t_1
                                                                                               (*
                                                                                                (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                                (+
                                                                                                 1.0
                                                                                                 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                                         (if (<= t_1 5e+170)
                                                                                           (*
                                                                                            (sqrt (/ d h))
                                                                                            (*
                                                                                             (sqrt (/ d l))
                                                                                             (fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
                                                                                           (if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))
                                                                                      double code(double d, double h, double l, double M, double D) {
                                                                                      	double t_0 = sqrt((h / l));
                                                                                      	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                      	double tmp;
                                                                                      	if (t_1 <= 5e+170) {
                                                                                      		tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
                                                                                      	} else if (t_1 <= ((double) INFINITY)) {
                                                                                      		tmp = (d * t_0) / h;
                                                                                      	} else {
                                                                                      		tmp = (-d * t_0) / h;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      function code(d, h, l, M, D)
                                                                                      	t_0 = sqrt(Float64(h / l))
                                                                                      	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                      	tmp = 0.0
                                                                                      	if (t_1 <= 5e+170)
                                                                                      		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0)));
                                                                                      	elseif (t_1 <= Inf)
                                                                                      		tmp = Float64(Float64(d * t_0) / h);
                                                                                      	else
                                                                                      		tmp = Float64(Float64(Float64(-d) * t_0) / h);
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      t_0 := \sqrt{\frac{h}{\ell}}\\
                                                                                      t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                      \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                                                                      \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
                                                                                      
                                                                                      \mathbf{elif}\;t\_1 \leq \infty:\\
                                                                                      \;\;\;\;\frac{d \cdot t\_0}{h}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 3 regimes
                                                                                      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999977e170

                                                                                        1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                          \[\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. Applied rewrites65.5%

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

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

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

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

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

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

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

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

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

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

                                                                                          1. Initial program 0.0%

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

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

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

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

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

                                                                                              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                                                          8. Recombined 3 regimes into one program.
                                                                                          9. Final simplification77.2%

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

                                                                                          Alternative 17: 69.6% accurate, 0.5× speedup?

                                                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(\frac{D \cdot \frac{M}{d}}{d} \cdot 0.125\right)\right), \frac{-h}{\ell}, 1\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \end{array} \end{array} \]
                                                                                          (FPCore (d h l M D)
                                                                                           :precision binary64
                                                                                           (let* ((t_0 (sqrt (/ h l)))
                                                                                                  (t_1
                                                                                                   (*
                                                                                                    (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                                    (+
                                                                                                     1.0
                                                                                                     (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                                             (if (<= t_1 5e+170)
                                                                                               (*
                                                                                                (sqrt (/ d h))
                                                                                                (*
                                                                                                 (sqrt (/ d l))
                                                                                                 (fma (* D (* M (* (/ (* D (/ M d)) d) 0.125))) (/ (- h) l) 1.0)))
                                                                                               (if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))
                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                          	double t_0 = sqrt((h / l));
                                                                                          	double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                          	double tmp;
                                                                                          	if (t_1 <= 5e+170) {
                                                                                          		tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((D * (M * (((D * (M / d)) / d) * 0.125))), (-h / l), 1.0));
                                                                                          	} else if (t_1 <= ((double) INFINITY)) {
                                                                                          		tmp = (d * t_0) / h;
                                                                                          	} else {
                                                                                          		tmp = (-d * t_0) / h;
                                                                                          	}
                                                                                          	return tmp;
                                                                                          }
                                                                                          
                                                                                          function code(d, h, l, M, D)
                                                                                          	t_0 = sqrt(Float64(h / l))
                                                                                          	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                          	tmp = 0.0
                                                                                          	if (t_1 <= 5e+170)
                                                                                          		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(D * Float64(M * Float64(Float64(Float64(D * Float64(M / d)) / d) * 0.125))), Float64(Float64(-h) / l), 1.0)));
                                                                                          	elseif (t_1 <= Inf)
                                                                                          		tmp = Float64(Float64(d * t_0) / h);
                                                                                          	else
                                                                                          		tmp = Float64(Float64(Float64(-d) * t_0) / h);
                                                                                          	end
                                                                                          	return tmp
                                                                                          end
                                                                                          
                                                                                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(M * N[(N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          
                                                                                          \\
                                                                                          \begin{array}{l}
                                                                                          t_0 := \sqrt{\frac{h}{\ell}}\\
                                                                                          t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                          \mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
                                                                                          \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(\frac{D \cdot \frac{M}{d}}{d} \cdot 0.125\right)\right), \frac{-h}{\ell}, 1\right)\right)\\
                                                                                          
                                                                                          \mathbf{elif}\;t\_1 \leq \infty:\\
                                                                                          \;\;\;\;\frac{d \cdot t\_0}{h}\\
                                                                                          
                                                                                          \mathbf{else}:\\
                                                                                          \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
                                                                                          
                                                                                          
                                                                                          \end{array}
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Split input into 3 regimes
                                                                                          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999977e170

                                                                                            1. Initial program 89.2%

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

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

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

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

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

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

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

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

                                                                                              \[\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. Applied rewrites65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              1. Initial program 0.0%

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

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

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

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

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

                                                                                                  \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h} \]
                                                                                              8. Recombined 3 regimes into one program.
                                                                                              9. Final simplification74.1%

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

                                                                                              Alternative 18: 45.8% accurate, 0.5× speedup?

                                                                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\ t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{d \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                                              (FPCore (d h l M D)
                                                                                               :precision binary64
                                                                                               (let* ((t_0 (sqrt (/ h l)))
                                                                                                      (t_1 (/ (* (- d) t_0) h))
                                                                                                      (t_2
                                                                                                       (*
                                                                                                        (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
                                                                                                        (+
                                                                                                         1.0
                                                                                                         (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
                                                                                                 (if (<= t_2 -2e-166) t_1 (if (<= t_2 INFINITY) (/ (* d t_0) h) t_1))))
                                                                                              double code(double d, double h, double l, double M, double D) {
                                                                                              	double t_0 = sqrt((h / l));
                                                                                              	double t_1 = (-d * t_0) / h;
                                                                                              	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                              	double tmp;
                                                                                              	if (t_2 <= -2e-166) {
                                                                                              		tmp = t_1;
                                                                                              	} else if (t_2 <= ((double) INFINITY)) {
                                                                                              		tmp = (d * t_0) / h;
                                                                                              	} else {
                                                                                              		tmp = t_1;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              public static double code(double d, double h, double l, double M, double D) {
                                                                                              	double t_0 = Math.sqrt((h / l));
                                                                                              	double t_1 = (-d * t_0) / h;
                                                                                              	double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
                                                                                              	double tmp;
                                                                                              	if (t_2 <= -2e-166) {
                                                                                              		tmp = t_1;
                                                                                              	} else if (t_2 <= Double.POSITIVE_INFINITY) {
                                                                                              		tmp = (d * t_0) / h;
                                                                                              	} else {
                                                                                              		tmp = t_1;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              def code(d, h, l, M, D):
                                                                                              	t_0 = math.sqrt((h / l))
                                                                                              	t_1 = (-d * t_0) / h
                                                                                              	t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))
                                                                                              	tmp = 0
                                                                                              	if t_2 <= -2e-166:
                                                                                              		tmp = t_1
                                                                                              	elif t_2 <= math.inf:
                                                                                              		tmp = (d * t_0) / h
                                                                                              	else:
                                                                                              		tmp = t_1
                                                                                              	return tmp
                                                                                              
                                                                                              function code(d, h, l, M, D)
                                                                                              	t_0 = sqrt(Float64(h / l))
                                                                                              	t_1 = Float64(Float64(Float64(-d) * t_0) / h)
                                                                                              	t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))))
                                                                                              	tmp = 0.0
                                                                                              	if (t_2 <= -2e-166)
                                                                                              		tmp = t_1;
                                                                                              	elseif (t_2 <= Inf)
                                                                                              		tmp = Float64(Float64(d * t_0) / h);
                                                                                              	else
                                                                                              		tmp = t_1;
                                                                                              	end
                                                                                              	return tmp
                                                                                              end
                                                                                              
                                                                                              function tmp_2 = code(d, h, l, M, D)
                                                                                              	t_0 = sqrt((h / l));
                                                                                              	t_1 = (-d * t_0) / h;
                                                                                              	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))));
                                                                                              	tmp = 0.0;
                                                                                              	if (t_2 <= -2e-166)
                                                                                              		tmp = t_1;
                                                                                              	elseif (t_2 <= Inf)
                                                                                              		tmp = (d * t_0) / h;
                                                                                              	else
                                                                                              		tmp = t_1;
                                                                                              	end
                                                                                              	tmp_2 = tmp;
                                                                                              end
                                                                                              
                                                                                              code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]}, Block[{t$95$2 = 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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-166], t$95$1, If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              
                                                                                              \\
                                                                                              \begin{array}{l}
                                                                                              t_0 := \sqrt{\frac{h}{\ell}}\\
                                                                                              t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\
                                                                                              t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
                                                                                              \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
                                                                                              \;\;\;\;t\_1\\
                                                                                              
                                                                                              \mathbf{elif}\;t\_2 \leq \infty:\\
                                                                                              \;\;\;\;\frac{d \cdot t\_0}{h}\\
                                                                                              
                                                                                              \mathbf{else}:\\
                                                                                              \;\;\;\;t\_1\\
                                                                                              
                                                                                              
                                                                                              \end{array}
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Split input into 2 regimes
                                                                                              2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.00000000000000008e-166 or +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      \[\leadsto \frac{d \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                                                                                  8. Recombined 2 regimes into one program.
                                                                                                  9. Final simplification48.7%

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

                                                                                                  Alternative 19: 79.7% accurate, 2.1× speedup?

                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := 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}}\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-227}:\\ \;\;\;\;\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right)\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \end{array} \end{array} \]
                                                                                                  (FPCore (d h l M D)
                                                                                                   :precision binary64
                                                                                                   (let* ((t_0
                                                                                                           (+
                                                                                                            1.0
                                                                                                            (*
                                                                                                             (/ (/ (* M (* D 0.5)) (* d 2.0)) l)
                                                                                                             (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
                                                                                                     (if (<= d -1.25e-271)
                                                                                                       (* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
                                                                                                       (if (<= d 1.5e-227)
                                                                                                         (/
                                                                                                          (fma
                                                                                                           d
                                                                                                           (sqrt (/ h l))
                                                                                                           (* (* -0.125 (pow (/ h l) 1.5)) (* D (/ (* D (* M M)) d))))
                                                                                                          h)
                                                                                                         (* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l))))))))
                                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                                  	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
                                                                                                  	double tmp;
                                                                                                  	if (d <= -1.25e-271) {
                                                                                                  		tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
                                                                                                  	} else if (d <= 1.5e-227) {
                                                                                                  		tmp = fma(d, sqrt((h / l)), ((-0.125 * pow((h / l), 1.5)) * (D * ((D * (M * M)) / d)))) / h;
                                                                                                  	} else {
                                                                                                  		tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  function code(d, h, l, M, D)
                                                                                                  	t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
                                                                                                  	tmp = 0.0
                                                                                                  	if (d <= -1.25e-271)
                                                                                                  		tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0);
                                                                                                  	elseif (d <= 1.5e-227)
                                                                                                  		tmp = Float64(fma(d, sqrt(Float64(h / l)), Float64(Float64(-0.125 * (Float64(h / l) ^ 1.5)) * Float64(D * Float64(Float64(D * Float64(M * M)) / d)))) / h);
                                                                                                  	else
                                                                                                  		tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))));
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e-271], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.5e-227], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision] * N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  t_0 := 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}}\\
                                                                                                  \mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\
                                                                                                  \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
                                                                                                  
                                                                                                  \mathbf{elif}\;d \leq 1.5 \cdot 10^{-227}:\\
                                                                                                  \;\;\;\;\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right)\right)}{h}\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 3 regimes
                                                                                                  2. if d < -1.2500000000000001e-271

                                                                                                    1. Initial program 76.6%

                                                                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                    2. Add Preprocessing
                                                                                                    3. Step-by-step derivation
                                                                                                      1. lift-*.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 rewrites79.4%

                                                                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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. 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 - \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. lower-sqrt.f6479.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{\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 rewrites79.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{\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-eval79.4

                                                                                                        \[\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. unpow1/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. lower-sqrt.f6479.4

                                                                                                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 rewrites79.4%

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

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{\mathsf{neg}\left(d\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\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) \]
                                                                                                      9. lower-neg.f6486.6

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

                                                                                                      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\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 -1.2500000000000001e-271 < d < 1.5e-227

                                                                                                    1. Initial program 34.0%

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

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

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

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

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

                                                                                                      if 1.5e-227 < d

                                                                                                      1. Initial program 80.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-*.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 rewrites82.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 - \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. 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 - \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. lower-sqrt.f6482.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{\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 rewrites82.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{\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-eval82.6

                                                                                                          \[\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. unpow1/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. sqrt-divN/A

                                                                                                          \[\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 \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
                                                                                                        7. pow1/2N/A

                                                                                                          \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{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) \]
                                                                                                        8. pow1/2N/A

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

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

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

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

                                                                                                          \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{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) \]
                                                                                                        13. lower-sqrt.f6490.9

                                                                                                          \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\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) \]
                                                                                                      8. Applied rewrites90.9%

                                                                                                        \[\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) \]
                                                                                                    7. Recombined 3 regimes into one program.
                                                                                                    8. Final simplification84.6%

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

                                                                                                    Alternative 20: 79.7% accurate, 2.6× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 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}}\\ \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \end{array} \end{array} \]
                                                                                                    (FPCore (d h l M D)
                                                                                                     :precision binary64
                                                                                                     (let* ((t_0
                                                                                                             (+
                                                                                                              1.0
                                                                                                              (*
                                                                                                               (/ (/ (* M (* D 0.5)) (* d 2.0)) l)
                                                                                                               (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
                                                                                                       (if (<= l -2e-310)
                                                                                                         (* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
                                                                                                         (* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))))))
                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                    	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
                                                                                                    	double tmp;
                                                                                                    	if (l <= -2e-310) {
                                                                                                    		tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
                                                                                                    	} else {
                                                                                                    		tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(d, h, l, m, d_1)
                                                                                                        real(8), intent (in) :: d
                                                                                                        real(8), intent (in) :: h
                                                                                                        real(8), intent (in) :: l
                                                                                                        real(8), intent (in) :: m
                                                                                                        real(8), intent (in) :: d_1
                                                                                                        real(8) :: t_0
                                                                                                        real(8) :: tmp
                                                                                                        t_0 = 1.0d0 + ((((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l) * (((m * d_1) / (d * 2.0d0)) / ((-1.0d0) / h)))
                                                                                                        if (l <= (-2d-310)) then
                                                                                                            tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0
                                                                                                        else
                                                                                                            tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)))
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                                                    	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
                                                                                                    	double tmp;
                                                                                                    	if (l <= -2e-310) {
                                                                                                    		tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l))) * t_0;
                                                                                                    	} else {
                                                                                                    		tmp = t_0 * ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l)));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(d, h, l, M, D):
                                                                                                    	t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)))
                                                                                                    	tmp = 0
                                                                                                    	if l <= -2e-310:
                                                                                                    		tmp = (math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l))) * t_0
                                                                                                    	else:
                                                                                                    		tmp = t_0 * ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l)))
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(d, h, l, M, D)
                                                                                                    	t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
                                                                                                    	tmp = 0.0
                                                                                                    	if (l <= -2e-310)
                                                                                                    		tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0);
                                                                                                    	else
                                                                                                    		tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l))));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(d, h, l, M, D)
                                                                                                    	t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
                                                                                                    	tmp = 0.0;
                                                                                                    	if (l <= -2e-310)
                                                                                                    		tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
                                                                                                    	else
                                                                                                    		tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    t_0 := 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}}\\
                                                                                                    \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
                                                                                                    \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 2 regimes
                                                                                                    2. if l < -1.999999999999994e-310

                                                                                                      1. Initial program 73.6%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Step-by-step derivation
                                                                                                        1. lift-*.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 rewrites75.3%

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

                                                                                                          \[\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 rewrites75.3%

                                                                                                        \[\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-eval75.3

                                                                                                          \[\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. unpow1/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. lower-sqrt.f6475.3

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

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

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

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

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

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

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

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

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

                                                                                                          \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{\mathsf{neg}\left(d\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\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) \]
                                                                                                        9. lower-neg.f6482.1

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

                                                                                                        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\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 -1.999999999999994e-310 < l

                                                                                                      1. Initial program 72.1%

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

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

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

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

                                                                                                          \[\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. unpow1/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. sqrt-divN/A

                                                                                                          \[\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 \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
                                                                                                        7. pow1/2N/A

                                                                                                          \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{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) \]
                                                                                                        8. pow1/2N/A

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

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

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

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

                                                                                                          \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{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) \]
                                                                                                        13. lower-sqrt.f6481.3

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

                                                                                                        \[\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) \]
                                                                                                    3. Recombined 2 regimes into one program.
                                                                                                    4. Final simplification81.7%

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

                                                                                                    Alternative 21: 76.1% accurate, 2.6× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \frac{M \cdot D}{d \cdot 2}\\ \mathbf{if}\;d \leq 3.7 \cdot 10^{-296}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_1\right) \cdot \left(1 - t\_0 \cdot \left(h \cdot t\_2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + t\_0 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right)\\ \end{array} \end{array} \]
                                                                                                    (FPCore (d h l M D)
                                                                                                     :precision binary64
                                                                                                     (let* ((t_0 (/ (/ (* M (* D 0.5)) (* d 2.0)) l))
                                                                                                            (t_1 (sqrt (/ d l)))
                                                                                                            (t_2 (/ (* M D) (* d 2.0))))
                                                                                                       (if (<= d 3.7e-296)
                                                                                                         (* (* (sqrt (/ d h)) t_1) (- 1.0 (* t_0 (* h t_2))))
                                                                                                         (* (+ 1.0 (* t_0 (/ t_2 (/ -1.0 h)))) (* (/ (sqrt d) (sqrt h)) t_1)))))
                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                    	double t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
                                                                                                    	double t_1 = sqrt((d / l));
                                                                                                    	double t_2 = (M * D) / (d * 2.0);
                                                                                                    	double tmp;
                                                                                                    	if (d <= 3.7e-296) {
                                                                                                    		tmp = (sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)));
                                                                                                    	} else {
                                                                                                    		tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((sqrt(d) / sqrt(h)) * t_1);
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(d, h, l, m, d_1)
                                                                                                        real(8), intent (in) :: d
                                                                                                        real(8), intent (in) :: h
                                                                                                        real(8), intent (in) :: l
                                                                                                        real(8), intent (in) :: m
                                                                                                        real(8), intent (in) :: d_1
                                                                                                        real(8) :: t_0
                                                                                                        real(8) :: t_1
                                                                                                        real(8) :: t_2
                                                                                                        real(8) :: tmp
                                                                                                        t_0 = ((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l
                                                                                                        t_1 = sqrt((d / l))
                                                                                                        t_2 = (m * d_1) / (d * 2.0d0)
                                                                                                        if (d <= 3.7d-296) then
                                                                                                            tmp = (sqrt((d / h)) * t_1) * (1.0d0 - (t_0 * (h * t_2)))
                                                                                                        else
                                                                                                            tmp = (1.0d0 + (t_0 * (t_2 / ((-1.0d0) / h)))) * ((sqrt(d) / sqrt(h)) * t_1)
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                                                    	double t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
                                                                                                    	double t_1 = Math.sqrt((d / l));
                                                                                                    	double t_2 = (M * D) / (d * 2.0);
                                                                                                    	double tmp;
                                                                                                    	if (d <= 3.7e-296) {
                                                                                                    		tmp = (Math.sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)));
                                                                                                    	} else {
                                                                                                    		tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((Math.sqrt(d) / Math.sqrt(h)) * t_1);
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(d, h, l, M, D):
                                                                                                    	t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l
                                                                                                    	t_1 = math.sqrt((d / l))
                                                                                                    	t_2 = (M * D) / (d * 2.0)
                                                                                                    	tmp = 0
                                                                                                    	if d <= 3.7e-296:
                                                                                                    		tmp = (math.sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)))
                                                                                                    	else:
                                                                                                    		tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((math.sqrt(d) / math.sqrt(h)) * t_1)
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(d, h, l, M, D)
                                                                                                    	t_0 = Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l)
                                                                                                    	t_1 = sqrt(Float64(d / l))
                                                                                                    	t_2 = Float64(Float64(M * D) / Float64(d * 2.0))
                                                                                                    	tmp = 0.0
                                                                                                    	if (d <= 3.7e-296)
                                                                                                    		tmp = Float64(Float64(sqrt(Float64(d / h)) * t_1) * Float64(1.0 - Float64(t_0 * Float64(h * t_2))));
                                                                                                    	else
                                                                                                    		tmp = Float64(Float64(1.0 + Float64(t_0 * Float64(t_2 / Float64(-1.0 / h)))) * Float64(Float64(sqrt(d) / sqrt(h)) * t_1));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(d, h, l, M, D)
                                                                                                    	t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
                                                                                                    	t_1 = sqrt((d / l));
                                                                                                    	t_2 = (M * D) / (d * 2.0);
                                                                                                    	tmp = 0.0;
                                                                                                    	if (d <= 3.7e-296)
                                                                                                    		tmp = (sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)));
                                                                                                    	else
                                                                                                    		tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((sqrt(d) / sqrt(h)) * t_1);
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 3.7e-296], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(h * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$0 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    t_0 := \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell}\\
                                                                                                    t_1 := \sqrt{\frac{d}{\ell}}\\
                                                                                                    t_2 := \frac{M \cdot D}{d \cdot 2}\\
                                                                                                    \mathbf{if}\;d \leq 3.7 \cdot 10^{-296}:\\
                                                                                                    \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_1\right) \cdot \left(1 - t\_0 \cdot \left(h \cdot t\_2\right)\right)\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\left(1 + t\_0 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right)\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 2 regimes
                                                                                                    2. if d < 3.70000000000000027e-296

                                                                                                      1. Initial program 72.1%

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

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

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

                                                                                                        \[\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.9

                                                                                                          \[\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. unpow1/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. lower-sqrt.f6473.9

                                                                                                          \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{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 rewrites73.9%

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

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

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

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

                                                                                                          \[\leadsto \left(\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 \left(\frac{M \cdot D}{d \cdot 2} \cdot \color{blue}{h}\right)\right) \]
                                                                                                        5. lower-*.f6473.9

                                                                                                          \[\leadsto \left(\sqrt{\frac{d}{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 \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]
                                                                                                      10. Applied rewrites73.9%

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

                                                                                                      if 3.70000000000000027e-296 < d

                                                                                                      1. Initial program 73.6%

                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Step-by-step derivation
                                                                                                        1. lift-*.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 rewrites75.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{\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. 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 - \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. lower-sqrt.f6475.2

                                                                                                          \[\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 rewrites75.2%

                                                                                                        \[\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-eval75.2

                                                                                                          \[\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. unpow1/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. sqrt-divN/A

                                                                                                          \[\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 \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
                                                                                                        7. pow1/2N/A

                                                                                                          \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{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) \]
                                                                                                        8. pow1/2N/A

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

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

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

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

                                                                                                          \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{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) \]
                                                                                                        13. lower-sqrt.f6483.0

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

                                                                                                        \[\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) \]
                                                                                                    3. Recombined 2 regimes into one program.
                                                                                                    4. Final simplification78.4%

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

                                                                                                    Alternative 22: 57.7% accurate, 3.8× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6.2 \cdot 10^{-58}:\\ \;\;\;\;\mathsf{fma}\left(d, -\sqrt{\frac{1}{h \cdot \ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)\\ \mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                                    (FPCore (d h l M D)
                                                                                                     :precision binary64
                                                                                                     (if (<= l -6.2e-58)
                                                                                                       (fma
                                                                                                        d
                                                                                                        (- (sqrt (/ 1.0 (* h l))))
                                                                                                        (* (* D (/ (* D (* M M)) d)) (* 0.125 (sqrt (/ h (* l (* l l)))))))
                                                                                                       (if (<= l -4.3e-290)
                                                                                                         (* (/ (sqrt (/ h l)) (sqrt (* l l))) (* (* M (* M (* D D))) (/ 0.125 d)))
                                                                                                         (if (<= l 1.2e+207)
                                                                                                           (/
                                                                                                            (* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
                                                                                                            (sqrt (* h l)))
                                                                                                           (/ d (* (sqrt h) (sqrt l)))))))
                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                    	double tmp;
                                                                                                    	if (l <= -6.2e-58) {
                                                                                                    		tmp = fma(d, -sqrt((1.0 / (h * l))), ((D * ((D * (M * M)) / d)) * (0.125 * sqrt((h / (l * (l * l)))))));
                                                                                                    	} else if (l <= -4.3e-290) {
                                                                                                    		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
                                                                                                    	} else if (l <= 1.2e+207) {
                                                                                                    		tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
                                                                                                    	} else {
                                                                                                    		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    function code(d, h, l, M, D)
                                                                                                    	tmp = 0.0
                                                                                                    	if (l <= -6.2e-58)
                                                                                                    		tmp = fma(d, Float64(-sqrt(Float64(1.0 / Float64(h * l)))), Float64(Float64(D * Float64(Float64(D * Float64(M * M)) / d)) * Float64(0.125 * sqrt(Float64(h / Float64(l * Float64(l * l)))))));
                                                                                                    	elseif (l <= -4.3e-290)
                                                                                                    		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d)));
                                                                                                    	elseif (l <= 1.2e+207)
                                                                                                    		tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l)));
                                                                                                    	else
                                                                                                    		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.2e-58], N[(d * (-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) + N[(N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.3e-290], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+207], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;\ell \leq -6.2 \cdot 10^{-58}:\\
                                                                                                    \;\;\;\;\mathsf{fma}\left(d, -\sqrt{\frac{1}{h \cdot \ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)\\
                                                                                                    
                                                                                                    \mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\
                                                                                                    \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
                                                                                                    
                                                                                                    \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\
                                                                                                    \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 4 regimes
                                                                                                    2. if l < -6.1999999999999998e-58

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      if -6.1999999999999998e-58 < l < -4.3000000000000002e-290

                                                                                                      1. Initial program 75.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 rewrites17.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                        if -4.3000000000000002e-290 < l < 1.2e207

                                                                                                        1. Initial program 77.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 rewrites79.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{\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. 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 - \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. lower-sqrt.f6479.1

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

                                                                                                          \[\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. Applied rewrites67.0%

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

                                                                                                        if 1.2e207 < l

                                                                                                        1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

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

                                                                                                          Alternative 23: 57.2% accurate, 3.8× speedup?

                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.3 \cdot 10^{-57}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                                          (FPCore (d h l M D)
                                                                                                           :precision binary64
                                                                                                           (if (<= l -1.3e-57)
                                                                                                             (-
                                                                                                              (* (sqrt (/ h (* l (* l l)))) (* (* D (* D (* M M))) (/ 0.125 d)))
                                                                                                              (* d (sqrt (/ 1.0 (* h l)))))
                                                                                                             (if (<= l -4.3e-290)
                                                                                                               (* (/ (sqrt (/ h l)) (sqrt (* l l))) (* (* M (* M (* D D))) (/ 0.125 d)))
                                                                                                               (if (<= l 1.2e+207)
                                                                                                                 (/
                                                                                                                  (* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
                                                                                                                  (sqrt (* h l)))
                                                                                                                 (/ d (* (sqrt h) (sqrt l)))))))
                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                          	double tmp;
                                                                                                          	if (l <= -1.3e-57) {
                                                                                                          		tmp = (sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (0.125 / d))) - (d * sqrt((1.0 / (h * l))));
                                                                                                          	} else if (l <= -4.3e-290) {
                                                                                                          		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
                                                                                                          	} else if (l <= 1.2e+207) {
                                                                                                          		tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
                                                                                                          	} else {
                                                                                                          		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          function code(d, h, l, M, D)
                                                                                                          	tmp = 0.0
                                                                                                          	if (l <= -1.3e-57)
                                                                                                          		tmp = Float64(Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d))) - Float64(d * sqrt(Float64(1.0 / Float64(h * l)))));
                                                                                                          	elseif (l <= -4.3e-290)
                                                                                                          		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d)));
                                                                                                          	elseif (l <= 1.2e+207)
                                                                                                          		tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l)));
                                                                                                          	else
                                                                                                          		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.3e-57], N[(N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.3e-290], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+207], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          \mathbf{if}\;\ell \leq -1.3 \cdot 10^{-57}:\\
                                                                                                          \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                          
                                                                                                          \mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\
                                                                                                          \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
                                                                                                          
                                                                                                          \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\
                                                                                                          \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 4 regimes
                                                                                                          2. if l < -1.29999999999999993e-57

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

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

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

                                                                                                            if -1.29999999999999993e-57 < l < -4.3000000000000002e-290

                                                                                                            1. Initial program 76.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 rewrites17.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                              if -4.3000000000000002e-290 < l < 1.2e207

                                                                                                              1. Initial program 77.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 rewrites79.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{\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. 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 - \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. lower-sqrt.f6479.1

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

                                                                                                                \[\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. Applied rewrites67.0%

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

                                                                                                              if 1.2e207 < l

                                                                                                              1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

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

                                                                                                                Alternative 24: 58.1% accurate, 3.9× speedup?

                                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -4.5 \cdot 10^{+38}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5.1 \cdot 10^{-133}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                (FPCore (d h l M D)
                                                                                                                 :precision binary64
                                                                                                                 (if (<= d -4.5e+38)
                                                                                                                   (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                   (if (<= d -5.1e-133)
                                                                                                                     (*
                                                                                                                      (fma (/ (* M (* D (* M D))) (* 4.0 (* d d))) (* (/ h l) -0.5) 1.0)
                                                                                                                      (sqrt (/ (* d d) (* h l))))
                                                                                                                     (if (<= d -5e-310)
                                                                                                                       (*
                                                                                                                        (/ (sqrt (/ h l)) (sqrt (* l l)))
                                                                                                                        (* (* M (* M (* D D))) (/ 0.125 d)))
                                                                                                                       (/
                                                                                                                        (* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
                                                                                                                        (sqrt (* h l)))))))
                                                                                                                double code(double d, double h, double l, double M, double D) {
                                                                                                                	double tmp;
                                                                                                                	if (d <= -4.5e+38) {
                                                                                                                		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                	} else if (d <= -5.1e-133) {
                                                                                                                		tmp = fma(((M * (D * (M * D))) / (4.0 * (d * d))), ((h / l) * -0.5), 1.0) * sqrt(((d * d) / (h * l)));
                                                                                                                	} else if (d <= -5e-310) {
                                                                                                                		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
                                                                                                                	} else {
                                                                                                                		tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
                                                                                                                	}
                                                                                                                	return tmp;
                                                                                                                }
                                                                                                                
                                                                                                                function code(d, h, l, M, D)
                                                                                                                	tmp = 0.0
                                                                                                                	if (d <= -4.5e+38)
                                                                                                                		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                	elseif (d <= -5.1e-133)
                                                                                                                		tmp = Float64(fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(4.0 * Float64(d * d))), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(Float64(Float64(d * d) / Float64(h * l))));
                                                                                                                	elseif (d <= -5e-310)
                                                                                                                		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d)));
                                                                                                                	else
                                                                                                                		tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l)));
                                                                                                                	end
                                                                                                                	return tmp
                                                                                                                end
                                                                                                                
                                                                                                                code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.5e+38], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5.1e-133], N[(N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                                                                                                                
                                                                                                                \begin{array}{l}
                                                                                                                
                                                                                                                \\
                                                                                                                \begin{array}{l}
                                                                                                                \mathbf{if}\;d \leq -4.5 \cdot 10^{+38}:\\
                                                                                                                \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                
                                                                                                                \mathbf{elif}\;d \leq -5.1 \cdot 10^{-133}:\\
                                                                                                                \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\
                                                                                                                
                                                                                                                \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
                                                                                                                \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
                                                                                                                
                                                                                                                \mathbf{else}:\\
                                                                                                                \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
                                                                                                                
                                                                                                                
                                                                                                                \end{array}
                                                                                                                \end{array}
                                                                                                                
                                                                                                                Derivation
                                                                                                                1. Split input into 4 regimes
                                                                                                                2. if d < -4.4999999999999998e38

                                                                                                                  1. Initial program 76.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 l around -inf

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                  if -4.4999999999999998e38 < d < -5.0999999999999999e-133

                                                                                                                  1. Initial program 83.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. Applied rewrites63.0%

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

                                                                                                                  if -5.0999999999999999e-133 < d < -4.999999999999985e-310

                                                                                                                  1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    if -4.999999999999985e-310 < d

                                                                                                                    1. Initial program 72.1%

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

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

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

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

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

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

                                                                                                                  Alternative 25: 55.6% accurate, 3.9× speedup?

                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                  (FPCore (d h l M D)
                                                                                                                   :precision binary64
                                                                                                                   (if (<= d -1.02e-71)
                                                                                                                     (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                     (if (<= d -5e-310)
                                                                                                                       (* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
                                                                                                                       (if (<= d 2.55e-172)
                                                                                                                         (* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                                                         (*
                                                                                                                          (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0)
                                                                                                                          (/ d (sqrt (* h l))))))))
                                                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                                                  	double tmp;
                                                                                                                  	if (d <= -1.02e-71) {
                                                                                                                  		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                  	} else if (d <= -5e-310) {
                                                                                                                  		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
                                                                                                                  	} else if (d <= 2.55e-172) {
                                                                                                                  		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                  	} else {
                                                                                                                  		tmp = fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0) * (d / sqrt((h * l)));
                                                                                                                  	}
                                                                                                                  	return tmp;
                                                                                                                  }
                                                                                                                  
                                                                                                                  function code(d, h, l, M, D)
                                                                                                                  	tmp = 0.0
                                                                                                                  	if (d <= -1.02e-71)
                                                                                                                  		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                  	elseif (d <= -5e-310)
                                                                                                                  		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0)));
                                                                                                                  	elseif (d <= 2.55e-172)
                                                                                                                  		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                                                  	else
                                                                                                                  		tmp = Float64(fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0) * Float64(d / sqrt(Float64(h * l))));
                                                                                                                  	end
                                                                                                                  	return tmp
                                                                                                                  end
                                                                                                                  
                                                                                                                  code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.55e-172], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                                  
                                                                                                                  \begin{array}{l}
                                                                                                                  
                                                                                                                  \\
                                                                                                                  \begin{array}{l}
                                                                                                                  \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
                                                                                                                  \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                  
                                                                                                                  \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
                                                                                                                  \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
                                                                                                                  
                                                                                                                  \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\
                                                                                                                  \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                                                  
                                                                                                                  \mathbf{else}:\\
                                                                                                                  \;\;\;\;\mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                                                  
                                                                                                                  
                                                                                                                  \end{array}
                                                                                                                  \end{array}
                                                                                                                  
                                                                                                                  Derivation
                                                                                                                  1. Split input into 4 regimes
                                                                                                                  2. if d < -1.0200000000000001e-71

                                                                                                                    1. Initial program 78.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 l around -inf

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    if -1.0200000000000001e-71 < d < -4.999999999999985e-310

                                                                                                                    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)}\right)\right) \]
                                                                                                                      14. associate-*r*N/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
                                                                                                                      15. distribute-rgt-neg-inN/A

                                                                                                                        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)} \]
                                                                                                                    6. Applied rewrites40.8%

                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
                                                                                                                    7. Step-by-step derivation
                                                                                                                      1. Applied rewrites49.2%

                                                                                                                        \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}} \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites57.2%

                                                                                                                          \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \frac{\sqrt{\frac{h}{\ell}}}{\color{blue}{\sqrt{\ell \cdot \ell}}} \]

                                                                                                                        if -4.999999999999985e-310 < d < 2.5499999999999999e-172

                                                                                                                        1. Initial program 46.1%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in d around 0

                                                                                                                          \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. associate-*r*N/A

                                                                                                                            \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                          2. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                          3. lower-*.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                          4. lower-sqrt.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          5. lower-/.f64N/A

                                                                                                                            \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          6. cube-multN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          7. unpow2N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          8. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          9. unpow2N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          10. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                          11. associate-*r/N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d}} \]
                                                                                                                          12. *-commutativeN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left({M}^{2} \cdot {D}^{2}\right)}}{d} \]
                                                                                                                          13. associate-*r*N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}}{d} \]
                                                                                                                          14. *-commutativeN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}}{d} \]
                                                                                                                          15. associate-*r/N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \frac{\frac{-1}{8} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                          16. associate-*r/N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right) \]
                                                                                                                          17. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right)} \]
                                                                                                                          18. unpow2N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                          19. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                          20. associate-*r/N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                          21. lower-/.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                        5. Applied rewrites43.7%

                                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)} \]

                                                                                                                        if 2.5499999999999999e-172 < d

                                                                                                                        1. Initial program 84.5%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. lift-*.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 rewrites86.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{\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. 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 - \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. lower-sqrt.f6486.8

                                                                                                                            \[\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 rewrites86.8%

                                                                                                                          \[\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. Applied rewrites74.8%

                                                                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot \left(M \cdot \left(\left(D \cdot \frac{M}{d \cdot d}\right) \cdot 0.125\right)\right), \frac{-h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                      3. Recombined 4 regimes into one program.
                                                                                                                      4. Final simplification61.9%

                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                      5. Add Preprocessing

                                                                                                                      Alternative 26: 55.5% accurate, 3.9× speedup?

                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                      (FPCore (d h l M D)
                                                                                                                       :precision binary64
                                                                                                                       (if (<= d -1.02e-71)
                                                                                                                         (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                         (if (<= d -5e-310)
                                                                                                                           (* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
                                                                                                                           (if (<= d 2.55e-172)
                                                                                                                             (* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
                                                                                                                             (*
                                                                                                                              (- 1.0 (* (/ h l) (* (* M D) (* 0.125 (* M (/ D (* d d)))))))
                                                                                                                              (/ d (sqrt (* h l))))))))
                                                                                                                      double code(double d, double h, double l, double M, double D) {
                                                                                                                      	double tmp;
                                                                                                                      	if (d <= -1.02e-71) {
                                                                                                                      		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                      	} else if (d <= -5e-310) {
                                                                                                                      		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
                                                                                                                      	} else if (d <= 2.55e-172) {
                                                                                                                      		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                      	} else {
                                                                                                                      		tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / sqrt((h * l)));
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      real(8) function code(d, h, l, m, d_1)
                                                                                                                          real(8), intent (in) :: d
                                                                                                                          real(8), intent (in) :: h
                                                                                                                          real(8), intent (in) :: l
                                                                                                                          real(8), intent (in) :: m
                                                                                                                          real(8), intent (in) :: d_1
                                                                                                                          real(8) :: tmp
                                                                                                                          if (d <= (-1.02d-71)) then
                                                                                                                              tmp = -d * sqrt((1.0d0 / (h * l)))
                                                                                                                          else if (d <= (-5d-310)) then
                                                                                                                              tmp = (sqrt((h / l)) / sqrt((l * l))) * ((d_1 * (m * (m * d_1))) / (d * 8.0d0))
                                                                                                                          else if (d <= 2.55d-172) then
                                                                                                                              tmp = sqrt((h / (l * (l * l)))) * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
                                                                                                                          else
                                                                                                                              tmp = (1.0d0 - ((h / l) * ((m * d_1) * (0.125d0 * (m * (d_1 / (d * d))))))) * (d / sqrt((h * l)))
                                                                                                                          end if
                                                                                                                          code = tmp
                                                                                                                      end function
                                                                                                                      
                                                                                                                      public static double code(double d, double h, double l, double M, double D) {
                                                                                                                      	double tmp;
                                                                                                                      	if (d <= -1.02e-71) {
                                                                                                                      		tmp = -d * Math.sqrt((1.0 / (h * l)));
                                                                                                                      	} else if (d <= -5e-310) {
                                                                                                                      		tmp = (Math.sqrt((h / l)) / Math.sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
                                                                                                                      	} else if (d <= 2.55e-172) {
                                                                                                                      		tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                      	} else {
                                                                                                                      		tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / Math.sqrt((h * l)));
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      def code(d, h, l, M, D):
                                                                                                                      	tmp = 0
                                                                                                                      	if d <= -1.02e-71:
                                                                                                                      		tmp = -d * math.sqrt((1.0 / (h * l)))
                                                                                                                      	elif d <= -5e-310:
                                                                                                                      		tmp = (math.sqrt((h / l)) / math.sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0))
                                                                                                                      	elif d <= 2.55e-172:
                                                                                                                      		tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d))
                                                                                                                      	else:
                                                                                                                      		tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / math.sqrt((h * l)))
                                                                                                                      	return tmp
                                                                                                                      
                                                                                                                      function code(d, h, l, M, D)
                                                                                                                      	tmp = 0.0
                                                                                                                      	if (d <= -1.02e-71)
                                                                                                                      		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                      	elseif (d <= -5e-310)
                                                                                                                      		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0)));
                                                                                                                      	elseif (d <= 2.55e-172)
                                                                                                                      		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d)));
                                                                                                                      	else
                                                                                                                      		tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(M * D) * Float64(0.125 * Float64(M * Float64(D / Float64(d * d))))))) * Float64(d / sqrt(Float64(h * l))));
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      function tmp_2 = code(d, h, l, M, D)
                                                                                                                      	tmp = 0.0;
                                                                                                                      	if (d <= -1.02e-71)
                                                                                                                      		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                      	elseif (d <= -5e-310)
                                                                                                                      		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
                                                                                                                      	elseif (d <= 2.55e-172)
                                                                                                                      		tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
                                                                                                                      	else
                                                                                                                      		tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / sqrt((h * l)));
                                                                                                                      	end
                                                                                                                      	tmp_2 = tmp;
                                                                                                                      end
                                                                                                                      
                                                                                                                      code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.55e-172], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(0.125 * N[(M * N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      
                                                                                                                      \\
                                                                                                                      \begin{array}{l}
                                                                                                                      \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
                                                                                                                      \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                      
                                                                                                                      \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
                                                                                                                      \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
                                                                                                                      
                                                                                                                      \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\
                                                                                                                      \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 4 regimes
                                                                                                                      2. if d < -1.0200000000000001e-71

                                                                                                                        1. Initial program 78.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 l around -inf

                                                                                                                          \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                          2. unpow2N/A

                                                                                                                            \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                          3. rem-square-sqrtN/A

                                                                                                                            \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                          4. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                          5. lower-*.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                          6. lower-sqrt.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          7. lower-/.f64N/A

                                                                                                                            \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          8. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                          9. mul-1-negN/A

                                                                                                                            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                          10. lower-neg.f6460.2

                                                                                                                            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                        5. Applied rewrites60.2%

                                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                        if -1.0200000000000001e-71 < d < -4.999999999999985e-310

                                                                                                                        1. Initial program 65.5%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Applied rewrites20.5%

                                                                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot d\right) \cdot 4}, \left(-\frac{h}{\ell}\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
                                                                                                                        4. Taylor expanded in h around -inf

                                                                                                                          \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                        5. Step-by-step derivation
                                                                                                                          1. associate-*r*N/A

                                                                                                                            \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                          2. *-commutativeN/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                                          3. lower-*.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                                          4. lower-sqrt.f64N/A

                                                                                                                            \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          5. lower-/.f64N/A

                                                                                                                            \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          6. cube-multN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          7. unpow2N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          8. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          9. unpow2N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          10. lower-*.f64N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          11. metadata-evalN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                          12. distribute-lft-neg-inN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)} \]
                                                                                                                          13. associate-/l*N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)}\right)\right) \]
                                                                                                                          14. associate-*r*N/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
                                                                                                                          15. distribute-rgt-neg-inN/A

                                                                                                                            \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)} \]
                                                                                                                        6. Applied rewrites40.8%

                                                                                                                          \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
                                                                                                                        7. Step-by-step derivation
                                                                                                                          1. Applied rewrites49.2%

                                                                                                                            \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}} \]
                                                                                                                          2. Step-by-step derivation
                                                                                                                            1. Applied rewrites57.2%

                                                                                                                              \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \frac{\sqrt{\frac{h}{\ell}}}{\color{blue}{\sqrt{\ell \cdot \ell}}} \]

                                                                                                                            if -4.999999999999985e-310 < d < 2.5499999999999999e-172

                                                                                                                            1. Initial program 46.1%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Taylor expanded in d around 0

                                                                                                                              \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. associate-*r*N/A

                                                                                                                                \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                              2. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                              3. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                              4. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              5. lower-/.f64N/A

                                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              6. cube-multN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              7. unpow2N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              8. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              9. unpow2N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              10. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
                                                                                                                              11. associate-*r/N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d}} \]
                                                                                                                              12. *-commutativeN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left({M}^{2} \cdot {D}^{2}\right)}}{d} \]
                                                                                                                              13. associate-*r*N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}}{d} \]
                                                                                                                              14. *-commutativeN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}}{d} \]
                                                                                                                              15. associate-*r/N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \frac{\frac{-1}{8} \cdot {M}^{2}}{d}\right)} \]
                                                                                                                              16. associate-*r/N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right) \]
                                                                                                                              17. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right)} \]
                                                                                                                              18. unpow2N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                              19. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
                                                                                                                              20. associate-*r/N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                              21. lower-/.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
                                                                                                                            5. Applied rewrites43.7%

                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)} \]

                                                                                                                            if 2.5499999999999999e-172 < d

                                                                                                                            1. Initial program 84.5%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Applied rewrites31.9%

                                                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot d\right) \cdot 4}, \left(-\frac{h}{\ell}\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
                                                                                                                            4. Applied rewrites75.8%

                                                                                                                              \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(M \cdot D\right) \cdot \left(\left(M \cdot \frac{D}{d \cdot d}\right) \cdot 0.125\right)\right) \cdot \frac{h}{\ell}\right)} \]
                                                                                                                          3. Recombined 4 regimes into one program.
                                                                                                                          4. Final simplification62.3%

                                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                          5. Add Preprocessing

                                                                                                                          Alternative 27: 55.7% accurate, 4.2× speedup?

                                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                          (FPCore (d h l M D)
                                                                                                                           :precision binary64
                                                                                                                           (if (<= d -1.02e-71)
                                                                                                                             (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                             (if (<= d -5e-310)
                                                                                                                               (* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
                                                                                                                               (/
                                                                                                                                (* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
                                                                                                                                (sqrt (* h l))))))
                                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                                          	double tmp;
                                                                                                                          	if (d <= -1.02e-71) {
                                                                                                                          		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                          	} else if (d <= -5e-310) {
                                                                                                                          		tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
                                                                                                                          	} else {
                                                                                                                          		tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
                                                                                                                          	}
                                                                                                                          	return tmp;
                                                                                                                          }
                                                                                                                          
                                                                                                                          function code(d, h, l, M, D)
                                                                                                                          	tmp = 0.0
                                                                                                                          	if (d <= -1.02e-71)
                                                                                                                          		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                          	elseif (d <= -5e-310)
                                                                                                                          		tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0)));
                                                                                                                          	else
                                                                                                                          		tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l)));
                                                                                                                          	end
                                                                                                                          	return tmp
                                                                                                                          end
                                                                                                                          
                                                                                                                          code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                                                                                                          
                                                                                                                          \begin{array}{l}
                                                                                                                          
                                                                                                                          \\
                                                                                                                          \begin{array}{l}
                                                                                                                          \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
                                                                                                                          \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                          
                                                                                                                          \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
                                                                                                                          \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
                                                                                                                          
                                                                                                                          \mathbf{else}:\\
                                                                                                                          \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
                                                                                                                          
                                                                                                                          
                                                                                                                          \end{array}
                                                                                                                          \end{array}
                                                                                                                          
                                                                                                                          Derivation
                                                                                                                          1. Split input into 3 regimes
                                                                                                                          2. if d < -1.0200000000000001e-71

                                                                                                                            1. Initial program 78.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 l around -inf

                                                                                                                              \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                              2. unpow2N/A

                                                                                                                                \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                              3. rem-square-sqrtN/A

                                                                                                                                \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                                                                                                                              4. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                              5. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                              6. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              7. lower-/.f64N/A

                                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              8. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                              9. mul-1-negN/A

                                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                              10. lower-neg.f6460.2

                                                                                                                                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                            5. Applied rewrites60.2%

                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                            if -1.0200000000000001e-71 < d < -4.999999999999985e-310

                                                                                                                            1. Initial program 65.5%

                                                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Applied rewrites20.5%

                                                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot d\right) \cdot 4}, \left(-\frac{h}{\ell}\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
                                                                                                                            4. Taylor expanded in h around -inf

                                                                                                                              \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
                                                                                                                            5. Step-by-step derivation
                                                                                                                              1. associate-*r*N/A

                                                                                                                                \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                                                                                                                              2. *-commutativeN/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                                              3. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)} \]
                                                                                                                              4. lower-sqrt.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              5. lower-/.f64N/A

                                                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              6. cube-multN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              7. unpow2N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              8. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              9. unpow2N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              10. lower-*.f64N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              11. metadata-evalN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
                                                                                                                              12. distribute-lft-neg-inN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)} \]
                                                                                                                              13. associate-/l*N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\frac{1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)}\right)\right) \]
                                                                                                                              14. associate-*r*N/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}}\right)\right) \]
                                                                                                                              15. distribute-rgt-neg-inN/A

                                                                                                                                \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\left(\frac{1}{8} \cdot {D}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{{M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}}{d}\right)\right)\right)} \]
                                                                                                                            6. Applied rewrites40.8%

                                                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)} \]
                                                                                                                            7. Step-by-step derivation
                                                                                                                              1. Applied rewrites49.2%

                                                                                                                                \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}} \]
                                                                                                                              2. Step-by-step derivation
                                                                                                                                1. Applied rewrites57.2%

                                                                                                                                  \[\leadsto \frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d \cdot 8} \cdot \frac{\sqrt{\frac{h}{\ell}}}{\color{blue}{\sqrt{\ell \cdot \ell}}} \]

                                                                                                                                if -4.999999999999985e-310 < d

                                                                                                                                1. Initial program 72.1%

                                                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                2. Add Preprocessing
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. lift-*.f64N/A

                                                                                                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \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.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{\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. 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 - \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. lower-sqrt.f6473.8

                                                                                                                                    \[\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.8%

                                                                                                                                  \[\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. Applied rewrites61.8%

                                                                                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(D \cdot \left(M \cdot \left(\left(D \cdot \frac{M}{d \cdot d}\right) \cdot 0.125\right)\right), \frac{-h}{\ell}, 1\right) \cdot d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                              3. Recombined 3 regimes into one program.
                                                                                                                              4. Final simplification60.4%

                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                              5. Add Preprocessing

                                                                                                                              Alternative 28: 45.7% accurate, 9.6× speedup?

                                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                                                                              (FPCore (d h l M D)
                                                                                                                               :precision binary64
                                                                                                                               (if (<= l 6.7e-249)
                                                                                                                                 (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                                 (/ d (* (sqrt h) (sqrt l)))))
                                                                                                                              double code(double d, double h, double l, double M, double D) {
                                                                                                                              	double tmp;
                                                                                                                              	if (l <= 6.7e-249) {
                                                                                                                              		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                              	} else {
                                                                                                                              		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                              	}
                                                                                                                              	return tmp;
                                                                                                                              }
                                                                                                                              
                                                                                                                              real(8) function code(d, h, l, m, d_1)
                                                                                                                                  real(8), intent (in) :: d
                                                                                                                                  real(8), intent (in) :: h
                                                                                                                                  real(8), intent (in) :: l
                                                                                                                                  real(8), intent (in) :: m
                                                                                                                                  real(8), intent (in) :: d_1
                                                                                                                                  real(8) :: tmp
                                                                                                                                  if (l <= 6.7d-249) then
                                                                                                                                      tmp = -d * sqrt((1.0d0 / (h * l)))
                                                                                                                                  else
                                                                                                                                      tmp = d / (sqrt(h) * sqrt(l))
                                                                                                                                  end if
                                                                                                                                  code = tmp
                                                                                                                              end function
                                                                                                                              
                                                                                                                              public static double code(double d, double h, double l, double M, double D) {
                                                                                                                              	double tmp;
                                                                                                                              	if (l <= 6.7e-249) {
                                                                                                                              		tmp = -d * Math.sqrt((1.0 / (h * l)));
                                                                                                                              	} else {
                                                                                                                              		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                                                                              	}
                                                                                                                              	return tmp;
                                                                                                                              }
                                                                                                                              
                                                                                                                              def code(d, h, l, M, D):
                                                                                                                              	tmp = 0
                                                                                                                              	if l <= 6.7e-249:
                                                                                                                              		tmp = -d * math.sqrt((1.0 / (h * l)))
                                                                                                                              	else:
                                                                                                                              		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                                                                              	return tmp
                                                                                                                              
                                                                                                                              function code(d, h, l, M, D)
                                                                                                                              	tmp = 0.0
                                                                                                                              	if (l <= 6.7e-249)
                                                                                                                              		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                              	else
                                                                                                                              		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                                                                              	end
                                                                                                                              	return tmp
                                                                                                                              end
                                                                                                                              
                                                                                                                              function tmp_2 = code(d, h, l, M, D)
                                                                                                                              	tmp = 0.0;
                                                                                                                              	if (l <= 6.7e-249)
                                                                                                                              		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                              	else
                                                                                                                              		tmp = d / (sqrt(h) * sqrt(l));
                                                                                                                              	end
                                                                                                                              	tmp_2 = tmp;
                                                                                                                              end
                                                                                                                              
                                                                                                                              code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6.7e-249], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                              
                                                                                                                              \begin{array}{l}
                                                                                                                              
                                                                                                                              \\
                                                                                                                              \begin{array}{l}
                                                                                                                              \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\
                                                                                                                              \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                              
                                                                                                                              \mathbf{else}:\\
                                                                                                                              \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                                                                              
                                                                                                                              
                                                                                                                              \end{array}
                                                                                                                              \end{array}
                                                                                                                              
                                                                                                                              Derivation
                                                                                                                              1. Split input into 2 regimes
                                                                                                                              2. if l < 6.6999999999999998e-249

                                                                                                                                1. Initial program 75.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. *-commutativeN/A

                                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                                  5. lower-*.f64N/A

                                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                                  6. lower-sqrt.f64N/A

                                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                  7. lower-/.f64N/A

                                                                                                                                    \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                  8. lower-*.f64N/A

                                                                                                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                  9. mul-1-negN/A

                                                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                                  10. lower-neg.f6446.4

                                                                                                                                    \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                                5. Applied rewrites46.4%

                                                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                                if 6.6999999999999998e-249 < l

                                                                                                                                1. Initial program 70.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. 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-*.f6443.5

                                                                                                                                    \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                5. Applied rewrites43.5%

                                                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                6. Step-by-step derivation
                                                                                                                                  1. Applied rewrites43.6%

                                                                                                                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                  2. Step-by-step derivation
                                                                                                                                    1. Applied rewrites47.7%

                                                                                                                                      \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                                                  3. Recombined 2 regimes into one program.
                                                                                                                                  4. Final simplification47.0%

                                                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
                                                                                                                                  5. Add Preprocessing

                                                                                                                                  Alternative 29: 42.6% accurate, 10.3× speedup?

                                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                                  (FPCore (d h l M D)
                                                                                                                                   :precision binary64
                                                                                                                                   (if (<= l 6.7e-249) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (sqrt (* h l)))))
                                                                                                                                  double code(double d, double h, double l, double M, double D) {
                                                                                                                                  	double tmp;
                                                                                                                                  	if (l <= 6.7e-249) {
                                                                                                                                  		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                                  	} else {
                                                                                                                                  		tmp = d / sqrt((h * l));
                                                                                                                                  	}
                                                                                                                                  	return tmp;
                                                                                                                                  }
                                                                                                                                  
                                                                                                                                  real(8) function code(d, h, l, m, d_1)
                                                                                                                                      real(8), intent (in) :: d
                                                                                                                                      real(8), intent (in) :: h
                                                                                                                                      real(8), intent (in) :: l
                                                                                                                                      real(8), intent (in) :: m
                                                                                                                                      real(8), intent (in) :: d_1
                                                                                                                                      real(8) :: tmp
                                                                                                                                      if (l <= 6.7d-249) then
                                                                                                                                          tmp = -d * sqrt((1.0d0 / (h * l)))
                                                                                                                                      else
                                                                                                                                          tmp = d / sqrt((h * l))
                                                                                                                                      end if
                                                                                                                                      code = tmp
                                                                                                                                  end function
                                                                                                                                  
                                                                                                                                  public static double code(double d, double h, double l, double M, double D) {
                                                                                                                                  	double tmp;
                                                                                                                                  	if (l <= 6.7e-249) {
                                                                                                                                  		tmp = -d * Math.sqrt((1.0 / (h * l)));
                                                                                                                                  	} else {
                                                                                                                                  		tmp = d / Math.sqrt((h * l));
                                                                                                                                  	}
                                                                                                                                  	return tmp;
                                                                                                                                  }
                                                                                                                                  
                                                                                                                                  def code(d, h, l, M, D):
                                                                                                                                  	tmp = 0
                                                                                                                                  	if l <= 6.7e-249:
                                                                                                                                  		tmp = -d * math.sqrt((1.0 / (h * l)))
                                                                                                                                  	else:
                                                                                                                                  		tmp = d / math.sqrt((h * l))
                                                                                                                                  	return tmp
                                                                                                                                  
                                                                                                                                  function code(d, h, l, M, D)
                                                                                                                                  	tmp = 0.0
                                                                                                                                  	if (l <= 6.7e-249)
                                                                                                                                  		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                                                  	else
                                                                                                                                  		tmp = Float64(d / sqrt(Float64(h * l)));
                                                                                                                                  	end
                                                                                                                                  	return tmp
                                                                                                                                  end
                                                                                                                                  
                                                                                                                                  function tmp_2 = code(d, h, l, M, D)
                                                                                                                                  	tmp = 0.0;
                                                                                                                                  	if (l <= 6.7e-249)
                                                                                                                                  		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                                                  	else
                                                                                                                                  		tmp = d / sqrt((h * l));
                                                                                                                                  	end
                                                                                                                                  	tmp_2 = tmp;
                                                                                                                                  end
                                                                                                                                  
                                                                                                                                  code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6.7e-249], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                                                                  
                                                                                                                                  \begin{array}{l}
                                                                                                                                  
                                                                                                                                  \\
                                                                                                                                  \begin{array}{l}
                                                                                                                                  \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\
                                                                                                                                  \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                                                  
                                                                                                                                  \mathbf{else}:\\
                                                                                                                                  \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                                                                  
                                                                                                                                  
                                                                                                                                  \end{array}
                                                                                                                                  \end{array}
                                                                                                                                  
                                                                                                                                  Derivation
                                                                                                                                  1. Split input into 2 regimes
                                                                                                                                  2. if l < 6.6999999999999998e-249

                                                                                                                                    1. Initial program 75.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. *-commutativeN/A

                                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                                      5. lower-*.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
                                                                                                                                      6. lower-sqrt.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                      7. lower-/.f64N/A

                                                                                                                                        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                      8. lower-*.f64N/A

                                                                                                                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
                                                                                                                                      9. mul-1-negN/A

                                                                                                                                        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
                                                                                                                                      10. lower-neg.f6446.4

                                                                                                                                        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
                                                                                                                                    5. Applied rewrites46.4%

                                                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

                                                                                                                                    if 6.6999999999999998e-249 < l

                                                                                                                                    1. Initial program 70.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. 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-*.f6443.5

                                                                                                                                        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                    5. Applied rewrites43.5%

                                                                                                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                    6. Step-by-step derivation
                                                                                                                                      1. Applied rewrites43.6%

                                                                                                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                    7. Recombined 2 regimes into one program.
                                                                                                                                    8. Final simplification45.1%

                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                                    9. Add Preprocessing

                                                                                                                                    Alternative 30: 36.6% accurate, 10.9× speedup?

                                                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.65 \cdot 10^{-193}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                                    (FPCore (d h l M D)
                                                                                                                                     :precision binary64
                                                                                                                                     (if (<= d -1.65e-193) (sqrt (* d (/ d (* h l)))) (/ d (sqrt (* h l)))))
                                                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                                                    	double tmp;
                                                                                                                                    	if (d <= -1.65e-193) {
                                                                                                                                    		tmp = sqrt((d * (d / (h * l))));
                                                                                                                                    	} else {
                                                                                                                                    		tmp = d / sqrt((h * l));
                                                                                                                                    	}
                                                                                                                                    	return tmp;
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    real(8) function code(d, h, l, m, d_1)
                                                                                                                                        real(8), intent (in) :: d
                                                                                                                                        real(8), intent (in) :: h
                                                                                                                                        real(8), intent (in) :: l
                                                                                                                                        real(8), intent (in) :: m
                                                                                                                                        real(8), intent (in) :: d_1
                                                                                                                                        real(8) :: tmp
                                                                                                                                        if (d <= (-1.65d-193)) then
                                                                                                                                            tmp = sqrt((d * (d / (h * l))))
                                                                                                                                        else
                                                                                                                                            tmp = d / sqrt((h * l))
                                                                                                                                        end if
                                                                                                                                        code = tmp
                                                                                                                                    end function
                                                                                                                                    
                                                                                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                                                                                    	double tmp;
                                                                                                                                    	if (d <= -1.65e-193) {
                                                                                                                                    		tmp = Math.sqrt((d * (d / (h * l))));
                                                                                                                                    	} else {
                                                                                                                                    		tmp = d / Math.sqrt((h * l));
                                                                                                                                    	}
                                                                                                                                    	return tmp;
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    def code(d, h, l, M, D):
                                                                                                                                    	tmp = 0
                                                                                                                                    	if d <= -1.65e-193:
                                                                                                                                    		tmp = math.sqrt((d * (d / (h * l))))
                                                                                                                                    	else:
                                                                                                                                    		tmp = d / math.sqrt((h * l))
                                                                                                                                    	return tmp
                                                                                                                                    
                                                                                                                                    function code(d, h, l, M, D)
                                                                                                                                    	tmp = 0.0
                                                                                                                                    	if (d <= -1.65e-193)
                                                                                                                                    		tmp = sqrt(Float64(d * Float64(d / Float64(h * l))));
                                                                                                                                    	else
                                                                                                                                    		tmp = Float64(d / sqrt(Float64(h * l)));
                                                                                                                                    	end
                                                                                                                                    	return tmp
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    function tmp_2 = code(d, h, l, M, D)
                                                                                                                                    	tmp = 0.0;
                                                                                                                                    	if (d <= -1.65e-193)
                                                                                                                                    		tmp = sqrt((d * (d / (h * l))));
                                                                                                                                    	else
                                                                                                                                    		tmp = d / sqrt((h * l));
                                                                                                                                    	end
                                                                                                                                    	tmp_2 = tmp;
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.65e-193], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                                                                                                    
                                                                                                                                    \begin{array}{l}
                                                                                                                                    
                                                                                                                                    \\
                                                                                                                                    \begin{array}{l}
                                                                                                                                    \mathbf{if}\;d \leq -1.65 \cdot 10^{-193}:\\
                                                                                                                                    \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
                                                                                                                                    
                                                                                                                                    \mathbf{else}:\\
                                                                                                                                    \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    \end{array}
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    1. Split input into 2 regimes
                                                                                                                                    2. if d < -1.6499999999999999e-193

                                                                                                                                      1. Initial program 79.3%

                                                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                      2. Add Preprocessing
                                                                                                                                      3. Taylor expanded in d around inf

                                                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      4. Step-by-step derivation
                                                                                                                                        1. lower-*.f64N/A

                                                                                                                                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                        2. lower-sqrt.f64N/A

                                                                                                                                          \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                        3. lower-/.f64N/A

                                                                                                                                          \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                        4. lower-*.f645.2

                                                                                                                                          \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                      5. Applied rewrites5.2%

                                                                                                                                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                      6. Step-by-step derivation
                                                                                                                                        1. Applied rewrites34.4%

                                                                                                                                          \[\leadsto \sqrt{\frac{d \cdot d}{h \cdot \ell}} \]
                                                                                                                                        2. Step-by-step derivation
                                                                                                                                          1. Applied rewrites40.2%

                                                                                                                                            \[\leadsto \sqrt{\frac{d}{h \cdot \ell} \cdot d} \]

                                                                                                                                          if -1.6499999999999999e-193 < d

                                                                                                                                          1. Initial program 68.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-*.f6437.1

                                                                                                                                              \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                          5. Applied rewrites37.1%

                                                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                          6. Step-by-step derivation
                                                                                                                                            1. Applied rewrites37.1%

                                                                                                                                              \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                          7. Recombined 2 regimes into one program.
                                                                                                                                          8. Final simplification38.3%

                                                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.65 \cdot 10^{-193}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                                          9. Add Preprocessing

                                                                                                                                          Alternative 31: 26.8% accurate, 15.3× speedup?

                                                                                                                                          \[\begin{array}{l} \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
                                                                                                                                          (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
                                                                                                                                          double code(double d, double h, double l, double M, double D) {
                                                                                                                                          	return d / sqrt((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 / sqrt((h * l))
                                                                                                                                          end function
                                                                                                                                          
                                                                                                                                          public static double code(double d, double h, double l, double M, double D) {
                                                                                                                                          	return d / Math.sqrt((h * l));
                                                                                                                                          }
                                                                                                                                          
                                                                                                                                          def code(d, h, l, M, D):
                                                                                                                                          	return d / math.sqrt((h * l))
                                                                                                                                          
                                                                                                                                          function code(d, h, l, M, D)
                                                                                                                                          	return Float64(d / sqrt(Float64(h * l)))
                                                                                                                                          end
                                                                                                                                          
                                                                                                                                          function tmp = code(d, h, l, M, D)
                                                                                                                                          	tmp = d / sqrt((h * l));
                                                                                                                                          end
                                                                                                                                          
                                                                                                                                          code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                                                                                          
                                                                                                                                          \begin{array}{l}
                                                                                                                                          
                                                                                                                                          \\
                                                                                                                                          \frac{d}{\sqrt{h \cdot \ell}}
                                                                                                                                          \end{array}
                                                                                                                                          
                                                                                                                                          Derivation
                                                                                                                                          1. Initial program 72.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-*.f6424.8

                                                                                                                                              \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
                                                                                                                                          5. Applied rewrites24.8%

                                                                                                                                            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                                                          6. Step-by-step derivation
                                                                                                                                            1. Applied rewrites24.8%

                                                                                                                                              \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                            2. Add Preprocessing

                                                                                                                                            Reproduce

                                                                                                                                            ?
                                                                                                                                            herbie shell --seed 2024232 
                                                                                                                                            (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)))))