Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.7% → 75.3%
Time: 21.1s
Alternatives: 20
Speedup: 2.9×

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

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

Initial Program: 66.7% accurate, 1.0× speedup?

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

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

Alternative 1: 75.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right)\\
t_1 := \sqrt{-d}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -1.04 \cdot 10^{+158}:\\
\;\;\;\;\frac{t\_1 \cdot \left(t\_2 \cdot \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)\right)}{\sqrt{-h}}\\

\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\

\mathbf{elif}\;h \leq 8.5 \cdot 10^{+116}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -1.04000000000000004e158

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

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

    if -1.04000000000000004e158 < h < -9.999999999999969e-311

    1. Initial program 67.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 rewrites48.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < h < 8.5000000000000002e116

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000002e116 < h

    1. Initial program 62.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 rewrites47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 69.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{h \cdot \ell}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\ \;\;\;\;t\_0 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot 4\right)}, \frac{M \cdot D}{d}, 1\right)\right)\\ \mathbf{elif}\;t\_3 \leq 10^{-291}:\\ \;\;\;\;\frac{1}{\frac{t\_1}{d}}\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\ \;\;\;\;t\_0 \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d \cdot d}}{t\_1}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ d h)))
        (t_1 (sqrt (* h l)))
        (t_2 (sqrt (/ d l)))
        (t_3
         (*
          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_3 -2e-167)
     (*
      t_0
      (*
       t_2
       (fma (/ (* (* M D) (* h -0.5)) (* l (* d 4.0))) (/ (* M D) d) 1.0)))
     (if (<= t_3 1e-291)
       (/ 1.0 (/ t_1 d))
       (if (<= t_3 4e+234) (* t_0 t_2) (/ (sqrt (* d d)) t_1))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((d / h));
	double t_1 = sqrt((h * l));
	double t_2 = sqrt((d / l));
	double t_3 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_3 <= -2e-167) {
		tmp = t_0 * (t_2 * fma((((M * D) * (h * -0.5)) / (l * (d * 4.0))), ((M * D) / d), 1.0));
	} else if (t_3 <= 1e-291) {
		tmp = 1.0 / (t_1 / d);
	} else if (t_3 <= 4e+234) {
		tmp = t_0 * t_2;
	} else {
		tmp = sqrt((d * d)) / t_1;
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(d / h))
	t_1 = sqrt(Float64(h * l))
	t_2 = sqrt(Float64(d / l))
	t_3 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_3 <= -2e-167)
		tmp = Float64(t_0 * Float64(t_2 * fma(Float64(Float64(Float64(M * D) * Float64(h * -0.5)) / Float64(l * Float64(d * 4.0))), Float64(Float64(M * D) / d), 1.0)));
	elseif (t_3 <= 1e-291)
		tmp = Float64(1.0 / Float64(t_1 / d));
	elseif (t_3 <= 4e+234)
		tmp = Float64(t_0 * t_2);
	else
		tmp = Float64(sqrt(Float64(d * d)) / t_1);
	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[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(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] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-167], N[(t$95$0 * N[(t$95$2 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$1 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$0 * t$95$2), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{h \cdot \ell}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot 4\right)}, \frac{M \cdot D}{d}, 1\right)\right)\\

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

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

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


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

    1. Initial program 91.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 rewrites60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.7%

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

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

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

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

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

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

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

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

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

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

        1. Initial program 98.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 rewrites83.7%

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

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

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

            \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
          2. lower-/.f6498.3

            \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
        7. Applied rewrites98.3%

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

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

        1. Initial program 19.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-*.f6425.6

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

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

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

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

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

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

            Alternative 3: 67.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 := \sqrt{h \cdot \ell}\\ t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M}{d}, \left(D \cdot 0.25\right) \cdot \frac{M \cdot \left(D \cdot \left(h \cdot -0.5\right)\right)}{d \cdot \ell}, 1\right)\right)\\ \mathbf{elif}\;t\_3 \leq 10^{-291}:\\ \;\;\;\;\frac{1}{\frac{t\_2}{d}}\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\ \end{array} \end{array} \]
            (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
                     (*
                      (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
                      (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
               (if (<= t_3 -2e-167)
                 (*
                  t_0
                  (*
                   t_1
                   (fma (/ M d) (* (* D 0.25) (/ (* M (* D (* h -0.5))) (* d l))) 1.0)))
                 (if (<= t_3 1e-291)
                   (/ 1.0 (/ t_2 d))
                   (if (<= t_3 4e+234) (* t_0 t_1) (/ (sqrt (* d d)) t_2))))))
            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 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
            	double tmp;
            	if (t_3 <= -2e-167) {
            		tmp = t_0 * (t_1 * fma((M / d), ((D * 0.25) * ((M * (D * (h * -0.5))) / (d * l))), 1.0));
            	} else if (t_3 <= 1e-291) {
            		tmp = 1.0 / (t_2 / d);
            	} else if (t_3 <= 4e+234) {
            		tmp = t_0 * t_1;
            	} else {
            		tmp = sqrt((d * d)) / t_2;
            	}
            	return tmp;
            }
            
            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(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
            	tmp = 0.0
            	if (t_3 <= -2e-167)
            		tmp = Float64(t_0 * Float64(t_1 * fma(Float64(M / d), Float64(Float64(D * 0.25) * Float64(Float64(M * Float64(D * Float64(h * -0.5))) / Float64(d * l))), 1.0)));
            	elseif (t_3 <= 1e-291)
            		tmp = Float64(1.0 / Float64(t_2 / d));
            	elseif (t_3 <= 4e+234)
            		tmp = Float64(t_0 * t_1);
            	else
            		tmp = Float64(sqrt(Float64(d * d)) / t_2);
            	end
            	return tmp
            end
            
            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[(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] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-167], N[(t$95$0 * N[(t$95$1 * N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.25), $MachinePrecision] * N[(N[(M * N[(D * N[(h * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$2 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sqrt{\frac{d}{h}}\\
            t_1 := \sqrt{\frac{d}{\ell}}\\
            t_2 := \sqrt{h \cdot \ell}\\
            t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
            \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\
            \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M}{d}, \left(D \cdot 0.25\right) \cdot \frac{M \cdot \left(D \cdot \left(h \cdot -0.5\right)\right)}{d \cdot \ell}, 1\right)\right)\\
            
            \mathbf{elif}\;t\_3 \leq 10^{-291}:\\
            \;\;\;\;\frac{1}{\frac{t\_2}{d}}\\
            
            \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
            \;\;\;\;t\_0 \cdot t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e-167

              1. Initial program 91.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 rewrites60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 41.7%

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 98.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 rewrites83.7%

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

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

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

                      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                    2. lower-/.f6498.3

                      \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                  7. Applied rewrites98.3%

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

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

                  1. Initial program 19.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-*.f6425.6

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

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

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

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

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

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

                      Alternative 4: 64.6% accurate, 0.3× speedup?

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

                        1. Initial program 91.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 rewrites61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        1. Initial program 45.7%

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

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

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

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

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

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

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

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

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

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

                            1. Initial program 98.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 rewrites83.7%

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

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

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

                                \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                              2. lower-/.f6498.3

                                \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                            7. Applied rewrites98.3%

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

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

                            1. Initial program 19.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-*.f6425.6

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

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

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

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

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

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

                                Alternative 5: 63.1% 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{h \cdot \ell}\\ t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-151}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right)\right)\\ \mathbf{elif}\;t\_3 \leq 10^{-291}:\\ \;\;\;\;\frac{1}{\frac{t\_2}{d}}\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\ \;\;\;\;t\_1 \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\ \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
                                         (*
                                          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
                                          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
                                   (if (<= t_3 -2e-151)
                                     (*
                                      t_0
                                      (*
                                       t_1
                                       (fma (* h -0.5) (/ (* M (* M (* D D))) (* (* d 4.0) (* d l))) 1.0)))
                                     (if (<= t_3 1e-291)
                                       (/ 1.0 (/ t_2 d))
                                       (if (<= t_3 4e+234) (* t_1 t_0) (/ (sqrt (* d d)) t_2))))))
                                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 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
                                	double tmp;
                                	if (t_3 <= -2e-151) {
                                		tmp = t_0 * (t_1 * fma((h * -0.5), ((M * (M * (D * D))) / ((d * 4.0) * (d * l))), 1.0));
                                	} else if (t_3 <= 1e-291) {
                                		tmp = 1.0 / (t_2 / d);
                                	} else if (t_3 <= 4e+234) {
                                		tmp = t_1 * t_0;
                                	} else {
                                		tmp = sqrt((d * d)) / t_2;
                                	}
                                	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(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
                                	tmp = 0.0
                                	if (t_3 <= -2e-151)
                                		tmp = Float64(t_0 * Float64(t_1 * fma(Float64(h * -0.5), Float64(Float64(M * Float64(M * Float64(D * D))) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0)));
                                	elseif (t_3 <= 1e-291)
                                		tmp = Float64(1.0 / Float64(t_2 / d));
                                	elseif (t_3 <= 4e+234)
                                		tmp = Float64(t_1 * t_0);
                                	else
                                		tmp = Float64(sqrt(Float64(d * d)) / t_2);
                                	end
                                	return 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[(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] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-151], N[(t$95$0 * N[(t$95$1 * N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$2 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$1 * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := \sqrt{\frac{d}{\ell}}\\
                                t_1 := \sqrt{\frac{d}{h}}\\
                                t_2 := \sqrt{h \cdot \ell}\\
                                t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
                                \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-151}:\\
                                \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right)\right)\\
                                
                                \mathbf{elif}\;t\_3 \leq 10^{-291}:\\
                                \;\;\;\;\frac{1}{\frac{t\_2}{d}}\\
                                
                                \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
                                \;\;\;\;t\_1 \cdot t\_0\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\
                                
                                
                                \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)))) < -1.9999999999999999e-151

                                  1. Initial program 91.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 rewrites61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  1. Initial program 45.7%

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

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

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

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

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

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

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

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

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

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

                                      1. Initial program 98.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 rewrites83.7%

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

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

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

                                          \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                                        2. lower-/.f6498.3

                                          \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                                      7. Applied rewrites98.3%

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

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

                                      1. Initial program 19.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-*.f6425.6

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

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

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

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

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

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

                                          Alternative 6: 71.2% accurate, 0.8× speedup?

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

                                            1. Initial program 83.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 rewrites61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 7: 71.5% accurate, 0.8× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 4 \cdot 10^{+234}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
                                          (FPCore (d h l M D)
                                           :precision binary64
                                           (if (<=
                                                (*
                                                 (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
                                                 (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
                                                4e+234)
                                             (*
                                              (sqrt (/ d h))
                                              (*
                                               (fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0)
                                               (sqrt (/ d l))))
                                             (/ (sqrt (* d d)) (sqrt (* h l)))))
                                          double code(double d, double h, double l, double M, double D) {
                                          	double tmp;
                                          	if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= 4e+234) {
                                          		tmp = sqrt((d / h)) * (fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0) * sqrt((d / l)));
                                          	} else {
                                          		tmp = sqrt((d * d)) / sqrt((h * l));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(d, h, l, M, D)
                                          	tmp = 0.0
                                          	if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= 4e+234)
                                          		tmp = Float64(sqrt(Float64(d / h)) * Float64(fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0) * sqrt(Float64(d / l))));
                                          	else
                                          		tmp = Float64(sqrt(Float64(d * d)) / sqrt(Float64(h * l)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[d_, h_, l_, M_, D_] := If[LessEqual[N[(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] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+234], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 4 \cdot 10^{+234}:\\
                                          \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000007e234

                                            1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            1. Initial program 19.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-*.f6425.6

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

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

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

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

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

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

                                                Alternative 8: 73.5% accurate, 1.2× speedup?

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

                                                  1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if -1.9500000000000001e-150 < d < -1.999999999999994e-310

                                                  1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if -1.999999999999994e-310 < d

                                                  1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 9: 77.2% accurate, 2.9× speedup?

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

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

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

                                                  if -1.04000000000000004e158 < h < -9.999999999999969e-311

                                                  1. Initial program 67.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 rewrites48.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if -9.999999999999969e-311 < h

                                                  1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 10: 57.9% accurate, 3.3× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ t_1 := M \cdot \left(D \cdot D\right)\\ \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;t\_0 \cdot \left(\left(t\_1 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-26}:\\ \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_1}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(-0.125, \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{t\_0}{d}, d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                (FPCore (d h l M D)
                                                 :precision binary64
                                                 (let* ((t_0 (sqrt (/ h (* l (* l l))))) (t_1 (* M (* D D))))
                                                   (if (<= l -3.15e-40)
                                                     (/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
                                                     (if (<= l 3.8e-305)
                                                       (* t_0 (* (* t_1 (- M)) (/ -0.125 d)))
                                                       (if (<= l 1.6e-26)
                                                         (*
                                                          (fma (* h -0.5) (/ (* M t_1) (* (* d 4.0) (* d l))) 1.0)
                                                          (/ d (sqrt (* h l))))
                                                         (if (<= l 1.2e+115)
                                                           (fma
                                                            -0.125
                                                            (* (* D (* D (* M M))) (/ t_0 d))
                                                            (* d (sqrt (/ 1.0 (* h l)))))
                                                           (/ d (* (sqrt l) (sqrt h)))))))))
                                                double code(double d, double h, double l, double M, double D) {
                                                	double t_0 = sqrt((h / (l * (l * l))));
                                                	double t_1 = M * (D * D);
                                                	double tmp;
                                                	if (l <= -3.15e-40) {
                                                		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                	} else if (l <= 3.8e-305) {
                                                		tmp = t_0 * ((t_1 * -M) * (-0.125 / d));
                                                	} else if (l <= 1.6e-26) {
                                                		tmp = fma((h * -0.5), ((M * t_1) / ((d * 4.0) * (d * l))), 1.0) * (d / sqrt((h * l)));
                                                	} else if (l <= 1.2e+115) {
                                                		tmp = fma(-0.125, ((D * (D * (M * M))) * (t_0 / d)), (d * sqrt((1.0 / (h * l)))));
                                                	} else {
                                                		tmp = d / (sqrt(l) * sqrt(h));
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(d, h, l, M, D)
                                                	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
                                                	t_1 = Float64(M * Float64(D * D))
                                                	tmp = 0.0
                                                	if (l <= -3.15e-40)
                                                		tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h)));
                                                	elseif (l <= 3.8e-305)
                                                		tmp = Float64(t_0 * Float64(Float64(t_1 * Float64(-M)) * Float64(-0.125 / d)));
                                                	elseif (l <= 1.6e-26)
                                                		tmp = Float64(fma(Float64(h * -0.5), Float64(Float64(M * t_1) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0) * Float64(d / sqrt(Float64(h * l))));
                                                	elseif (l <= 1.2e+115)
                                                		tmp = fma(-0.125, Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(t_0 / d)), Float64(d * sqrt(Float64(1.0 / Float64(h * l)))));
                                                	else
                                                		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                	end
                                                	return 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[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-305], N[(t$95$0 * N[(N[(t$95$1 * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e-26], N[(N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * t$95$1), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+115], N[(-0.125 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
                                                t_1 := M \cdot \left(D \cdot D\right)\\
                                                \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
                                                \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
                                                
                                                \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\
                                                \;\;\;\;t\_0 \cdot \left(\left(t\_1 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
                                                
                                                \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-26}:\\
                                                \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_1}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                
                                                \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+115}:\\
                                                \;\;\;\;\mathsf{fma}\left(-0.125, \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{t\_0}{d}, d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 5 regimes
                                                2. if l < -3.1500000000000001e-40

                                                  1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

                                                        if -3.1500000000000001e-40 < l < 3.8e-305

                                                        1. Initial program 62.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 rewrites45.6%

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

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

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

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

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

                                                        if 3.8e-305 < l < 1.6000000000000001e-26

                                                        1. Initial program 78.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 rewrites60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 1.6000000000000001e-26 < l < 1.2e115

                                                        1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 1.2e115 < l

                                                        1. Initial program 52.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-*.f6445.4

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

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

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

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

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-26}:\\ \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(-0.125, \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}}{d}, d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                          5. Add Preprocessing

                                                          Alternative 11: 55.0% accurate, 4.1× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := M \cdot \left(D \cdot D\right)\\ \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(t\_0 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 9.8 \cdot 10^{-95}:\\ \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_0}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
                                                          (FPCore (d h l M D)
                                                           :precision binary64
                                                           (let* ((t_0 (* M (* D D))))
                                                             (if (<= l -3.15e-40)
                                                               (/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
                                                               (if (<= l 3.8e-305)
                                                                 (* (sqrt (/ h (* l (* l l)))) (* (* t_0 (- M)) (/ -0.125 d)))
                                                                 (if (<= l 9.8e-95)
                                                                   (*
                                                                    (fma (* h -0.5) (/ (* M t_0) (* (* d 4.0) (* d l))) 1.0)
                                                                    (/ d (sqrt (* h l))))
                                                                   (* d (/ (/ 1.0 (sqrt h)) (sqrt l))))))))
                                                          double code(double d, double h, double l, double M, double D) {
                                                          	double t_0 = M * (D * D);
                                                          	double tmp;
                                                          	if (l <= -3.15e-40) {
                                                          		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                          	} else if (l <= 3.8e-305) {
                                                          		tmp = sqrt((h / (l * (l * l)))) * ((t_0 * -M) * (-0.125 / d));
                                                          	} else if (l <= 9.8e-95) {
                                                          		tmp = fma((h * -0.5), ((M * t_0) / ((d * 4.0) * (d * l))), 1.0) * (d / sqrt((h * l)));
                                                          	} else {
                                                          		tmp = d * ((1.0 / sqrt(h)) / sqrt(l));
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(d, h, l, M, D)
                                                          	t_0 = Float64(M * Float64(D * D))
                                                          	tmp = 0.0
                                                          	if (l <= -3.15e-40)
                                                          		tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h)));
                                                          	elseif (l <= 3.8e-305)
                                                          		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(t_0 * Float64(-M)) * Float64(-0.125 / d)));
                                                          	elseif (l <= 9.8e-95)
                                                          		tmp = Float64(fma(Float64(h * -0.5), Float64(Float64(M * t_0) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0) * Float64(d / sqrt(Float64(h * l))));
                                                          	else
                                                          		tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l)));
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-305], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.8e-95], N[(N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * t$95$0), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          t_0 := M \cdot \left(D \cdot D\right)\\
                                                          \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
                                                          \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
                                                          
                                                          \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\
                                                          \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(t\_0 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
                                                          
                                                          \mathbf{elif}\;\ell \leq 9.8 \cdot 10^{-95}:\\
                                                          \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_0}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 4 regimes
                                                          2. if l < -3.1500000000000001e-40

                                                            1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

                                                                  if -3.1500000000000001e-40 < l < 3.8e-305

                                                                  1. Initial program 62.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 rewrites45.6%

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

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

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

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

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

                                                                  if 3.8e-305 < l < 9.8e-95

                                                                  1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  if 9.8e-95 < l

                                                                  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. 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-*.f6453.6

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

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

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

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{elif}\;\ell \leq 9.8 \cdot 10^{-95}:\\ \;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
                                                                  9. Add Preprocessing

                                                                  Alternative 12: 49.9% accurate, 5.0× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                  (FPCore (d h l M D)
                                                                   :precision binary64
                                                                   (if (<= l -3.15e-40)
                                                                     (/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
                                                                     (if (<= l -5e-310)
                                                                       (* (sqrt (/ h (* l (* l l)))) (* (* (* M (* D D)) (- M)) (/ -0.125 d)))
                                                                       (/ d (* (sqrt l) (sqrt h))))))
                                                                  double code(double d, double h, double l, double M, double D) {
                                                                  	double tmp;
                                                                  	if (l <= -3.15e-40) {
                                                                  		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                                  	} else if (l <= -5e-310) {
                                                                  		tmp = sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d));
                                                                  	} else {
                                                                  		tmp = d / (sqrt(l) * sqrt(h));
                                                                  	}
                                                                  	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 <= (-3.15d-40)) then
                                                                          tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
                                                                      else if (l <= (-5d-310)) then
                                                                          tmp = sqrt((h / (l * (l * l)))) * (((m * (d_1 * d_1)) * -m) * ((-0.125d0) / d))
                                                                      else
                                                                          tmp = d / (sqrt(l) * sqrt(h))
                                                                      end if
                                                                      code = tmp
                                                                  end function
                                                                  
                                                                  public static double code(double d, double h, double l, double M, double D) {
                                                                  	double tmp;
                                                                  	if (l <= -3.15e-40) {
                                                                  		tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
                                                                  	} else if (l <= -5e-310) {
                                                                  		tmp = Math.sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d));
                                                                  	} else {
                                                                  		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(d, h, l, M, D):
                                                                  	tmp = 0
                                                                  	if l <= -3.15e-40:
                                                                  		tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h)
                                                                  	elif l <= -5e-310:
                                                                  		tmp = math.sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d))
                                                                  	else:
                                                                  		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                  	return tmp
                                                                  
                                                                  function code(d, h, l, M, D)
                                                                  	tmp = 0.0
                                                                  	if (l <= -3.15e-40)
                                                                  		tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h)));
                                                                  	elseif (l <= -5e-310)
                                                                  		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * Float64(D * D)) * Float64(-M)) * Float64(-0.125 / d)));
                                                                  	else
                                                                  		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(d, h, l, M, D)
                                                                  	tmp = 0.0;
                                                                  	if (l <= -3.15e-40)
                                                                  		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                                  	elseif (l <= -5e-310)
                                                                  		tmp = sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d));
                                                                  	else
                                                                  		tmp = d / (sqrt(l) * sqrt(h));
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
                                                                  \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
                                                                  
                                                                  \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
                                                                  \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if l < -3.1500000000000001e-40

                                                                    1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

                                                                          if -3.1500000000000001e-40 < l < -4.999999999999985e-310

                                                                          1. Initial program 63.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 rewrites46.4%

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

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

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

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

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

                                                                          if -4.999999999999985e-310 < l

                                                                          1. Initial program 70.7%

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

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

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

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

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

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

                                                                            Alternative 13: 50.3% accurate, 5.2× speedup?

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

                                                                              1. Initial program 61.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-*.f646.8

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

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

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

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

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

                                                                                    if -5.2000000000000002e-8 < l < -4.999999999999985e-310

                                                                                    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      if -4.999999999999985e-310 < l

                                                                                      1. Initial program 70.7%

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

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

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

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

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

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

                                                                                        Alternative 14: 48.0% accurate, 5.5× speedup?

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

                                                                                          1. Initial program 59.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-*.f646.1

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

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

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

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

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

                                                                                                if -5e-239 < l < -4.999999999999985e-310

                                                                                                1. Initial program 74.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-*.f6431.6

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

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

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

                                                                                                  if -4.999999999999985e-310 < l

                                                                                                  1. Initial program 70.7%

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

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

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

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

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

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-239}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                                    5. Add Preprocessing

                                                                                                    Alternative 15: 46.8% accurate, 6.1× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                    (FPCore (d h l M D)
                                                                                                     :precision binary64
                                                                                                     (if (<= h -1.56e+193)
                                                                                                       (/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
                                                                                                       (if (<= h 4.6e-293)
                                                                                                         (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                         (/ d (* (sqrt l) (sqrt h))))))
                                                                                                    double code(double d, double h, double l, double M, double D) {
                                                                                                    	double tmp;
                                                                                                    	if (h <= -1.56e+193) {
                                                                                                    		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                                                                    	} else if (h <= 4.6e-293) {
                                                                                                    		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                    	} else {
                                                                                                    		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                    	}
                                                                                                    	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 (h <= (-1.56d+193)) then
                                                                                                            tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
                                                                                                        else if (h <= 4.6d-293) then
                                                                                                            tmp = -d * sqrt((1.0d0 / (h * l)))
                                                                                                        else
                                                                                                            tmp = d / (sqrt(l) * sqrt(h))
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                                                    	double tmp;
                                                                                                    	if (h <= -1.56e+193) {
                                                                                                    		tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
                                                                                                    	} else if (h <= 4.6e-293) {
                                                                                                    		tmp = -d * Math.sqrt((1.0 / (h * l)));
                                                                                                    	} else {
                                                                                                    		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(d, h, l, M, D):
                                                                                                    	tmp = 0
                                                                                                    	if h <= -1.56e+193:
                                                                                                    		tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h)
                                                                                                    	elif h <= 4.6e-293:
                                                                                                    		tmp = -d * math.sqrt((1.0 / (h * l)))
                                                                                                    	else:
                                                                                                    		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(d, h, l, M, D)
                                                                                                    	tmp = 0.0
                                                                                                    	if (h <= -1.56e+193)
                                                                                                    		tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h)));
                                                                                                    	elseif (h <= 4.6e-293)
                                                                                                    		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                    	else
                                                                                                    		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(d, h, l, M, D)
                                                                                                    	tmp = 0.0;
                                                                                                    	if (h <= -1.56e+193)
                                                                                                    		tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
                                                                                                    	elseif (h <= 4.6e-293)
                                                                                                    		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                    	else
                                                                                                    		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.56e+193], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.6e-293], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\
                                                                                                    \;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
                                                                                                    
                                                                                                    \mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\
                                                                                                    \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 3 regimes
                                                                                                    2. if h < -1.5599999999999999e193

                                                                                                      1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

                                                                                                            if -1.5599999999999999e193 < h < 4.5999999999999999e-293

                                                                                                            1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            if 4.5999999999999999e-293 < h

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

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

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

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

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

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

                                                                                                              Alternative 16: 46.6% accurate, 7.7× speedup?

                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                              (FPCore (d h l M D)
                                                                                                               :precision binary64
                                                                                                               (if (<= h -1.56e+193)
                                                                                                                 (* (sqrt (/ d h)) (sqrt (/ d l)))
                                                                                                                 (if (<= h 4.6e-293)
                                                                                                                   (* (- d) (sqrt (/ 1.0 (* h l))))
                                                                                                                   (/ d (* (sqrt l) (sqrt h))))))
                                                                                                              double code(double d, double h, double l, double M, double D) {
                                                                                                              	double tmp;
                                                                                                              	if (h <= -1.56e+193) {
                                                                                                              		tmp = sqrt((d / h)) * sqrt((d / l));
                                                                                                              	} else if (h <= 4.6e-293) {
                                                                                                              		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                              	} else {
                                                                                                              		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                              	}
                                                                                                              	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 (h <= (-1.56d+193)) then
                                                                                                                      tmp = sqrt((d / h)) * sqrt((d / l))
                                                                                                                  else if (h <= 4.6d-293) then
                                                                                                                      tmp = -d * sqrt((1.0d0 / (h * l)))
                                                                                                                  else
                                                                                                                      tmp = d / (sqrt(l) * sqrt(h))
                                                                                                                  end if
                                                                                                                  code = tmp
                                                                                                              end function
                                                                                                              
                                                                                                              public static double code(double d, double h, double l, double M, double D) {
                                                                                                              	double tmp;
                                                                                                              	if (h <= -1.56e+193) {
                                                                                                              		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
                                                                                                              	} else if (h <= 4.6e-293) {
                                                                                                              		tmp = -d * Math.sqrt((1.0 / (h * l)));
                                                                                                              	} else {
                                                                                                              		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                                                                                                              	}
                                                                                                              	return tmp;
                                                                                                              }
                                                                                                              
                                                                                                              def code(d, h, l, M, D):
                                                                                                              	tmp = 0
                                                                                                              	if h <= -1.56e+193:
                                                                                                              		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
                                                                                                              	elif h <= 4.6e-293:
                                                                                                              		tmp = -d * math.sqrt((1.0 / (h * l)))
                                                                                                              	else:
                                                                                                              		tmp = d / (math.sqrt(l) * math.sqrt(h))
                                                                                                              	return tmp
                                                                                                              
                                                                                                              function code(d, h, l, M, D)
                                                                                                              	tmp = 0.0
                                                                                                              	if (h <= -1.56e+193)
                                                                                                              		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
                                                                                                              	elseif (h <= 4.6e-293)
                                                                                                              		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
                                                                                                              	else
                                                                                                              		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                              	end
                                                                                                              	return tmp
                                                                                                              end
                                                                                                              
                                                                                                              function tmp_2 = code(d, h, l, M, D)
                                                                                                              	tmp = 0.0;
                                                                                                              	if (h <= -1.56e+193)
                                                                                                              		tmp = sqrt((d / h)) * sqrt((d / l));
                                                                                                              	elseif (h <= 4.6e-293)
                                                                                                              		tmp = -d * sqrt((1.0 / (h * l)));
                                                                                                              	else
                                                                                                              		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                              	end
                                                                                                              	tmp_2 = tmp;
                                                                                                              end
                                                                                                              
                                                                                                              code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.56e+193], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.6e-293], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                                              
                                                                                                              \begin{array}{l}
                                                                                                              
                                                                                                              \\
                                                                                                              \begin{array}{l}
                                                                                                              \mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\
                                                                                                              \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                                              
                                                                                                              \mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\
                                                                                                              \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
                                                                                                              
                                                                                                              \mathbf{else}:\\
                                                                                                              \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                              
                                                                                                              
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              
                                                                                                              Derivation
                                                                                                              1. Split input into 3 regimes
                                                                                                              2. if h < -1.5599999999999999e193

                                                                                                                1. Initial program 55.2%

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

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

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

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

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

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

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

                                                                                                                if -1.5599999999999999e193 < h < 4.5999999999999999e-293

                                                                                                                1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                if 4.5999999999999999e-293 < h

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

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

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

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

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

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

                                                                                                                  Alternative 17: 46.3% accurate, 9.6× speedup?

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

                                                                                                                    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                    if 8.6000000000000002e-262 < d

                                                                                                                    1. Initial program 71.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-*.f6448.7

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

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

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

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

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

                                                                                                                      Alternative 18: 42.6% accurate, 10.3× speedup?

                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7.8 \cdot 10^{-240}:\\ \;\;\;\;\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 -7.8e-240) (* (- 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 <= -7.8e-240) {
                                                                                                                      		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 <= (-7.8d-240)) 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 <= -7.8e-240) {
                                                                                                                      		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 <= -7.8e-240:
                                                                                                                      		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 <= -7.8e-240)
                                                                                                                      		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 <= -7.8e-240)
                                                                                                                      		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, -7.8e-240], 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 -7.8 \cdot 10^{-240}:\\
                                                                                                                      \;\;\;\;\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 < -7.80000000000000029e-240

                                                                                                                        1. Initial program 59.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.f6446.2

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

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

                                                                                                                        if -7.80000000000000029e-240 < l

                                                                                                                        1. Initial program 71.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-*.f6443.8

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

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

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

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

                                                                                                                        Alternative 19: 36.4% accurate, 10.9× speedup?

                                                                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.1 \cdot 10^{-201}:\\ \;\;\;\;\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.1e-201) (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.1e-201) {
                                                                                                                        		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.1d-201)) 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.1e-201) {
                                                                                                                        		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.1e-201:
                                                                                                                        		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.1e-201)
                                                                                                                        		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.1e-201)
                                                                                                                        		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.1e-201], 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.1 \cdot 10^{-201}:\\
                                                                                                                        \;\;\;\;\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.1e-201

                                                                                                                          1. Initial program 68.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-*.f647.0

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

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

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

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

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

                                                                                                                                if -1.1e-201 < d

                                                                                                                                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. 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 rewrites44.1%

                                                                                                                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                7. Recombined 2 regimes into one program.
                                                                                                                                8. Final simplification38.0%

                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.1 \cdot 10^{-201}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
                                                                                                                                9. Add Preprocessing

                                                                                                                                Alternative 20: 26.3% 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 66.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-*.f6428.3

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

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

                                                                                                                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
                                                                                                                                  2. Add Preprocessing

                                                                                                                                  Reproduce

                                                                                                                                  ?
                                                                                                                                  herbie shell --seed 2024223 
                                                                                                                                  (FPCore (d h l M D)
                                                                                                                                    :name "Henrywood and Agarwal, Equation (12)"
                                                                                                                                    :precision binary64
                                                                                                                                    (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))