Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.0% → 83.1%
Time: 28.6s
Alternatives: 22
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 66.0% accurate, 1.0× speedup?

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

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

Alternative 1: 83.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{-135}:\\
\;\;\;\;\left(\frac{t\_0}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\

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

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


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

    1. Initial program 63.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified63.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. frac-2neg63.0%

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

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

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

    if -2.69999999999999999e-135 < l < -4.999999999999985e-310

    1. Initial program 55.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. Simplified52.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity65.9%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt65.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/65.9%

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 67.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. Simplified67.2%

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

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

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

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

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

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

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

Alternative 2: 83.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -2e-310)
   (*
    (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
    (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l))))
   (*
    d
    (/
     (fma h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l)) 1.0)
     (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -2e-310) {
		tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l)));
	} else {
		tmp = d * (fma(h, (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -2e-310)
		tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))));
	else
		tmp = Float64(d * Float64(fma(h, Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2e-310], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -1.999999999999994e-310

    1. Initial program 61.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. Simplified61.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt63.8%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/63.8%

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

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

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

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

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

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

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

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

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

Alternative 3: 82.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -4.2 \cdot 10^{-159}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq -1.55 \cdot 10^{-307}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\mathsf{fma}\left(h, {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}, 1\right)}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -4.2e-159)
   (*
    (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
    (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))))
   (if (<= d -1.55e-307)
     (*
      (* d (sqrt (/ 1.0 (* h l))))
      (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
     (*
      d
      (/
       (fma h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l)) 1.0)
       (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -4.2e-159) {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (sqrt((d / h)) * (sqrt(-d) / sqrt(-l)));
	} else if (d <= -1.55e-307) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = d * (fma(h, (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)), 1.0) / (sqrt(l) * sqrt(h)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -4.2e-159)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))));
	elseif (d <= -1.55e-307)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	else
		tmp = Float64(d * Float64(fma(h, Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l)), 1.0) / Float64(sqrt(l) * sqrt(h))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.2e-159], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-307], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.2 \cdot 10^{-159}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\

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

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


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

    1. Initial program 70.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified69.5%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity73.9%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt73.0%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/73.0%

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

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

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

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

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

    if -4.1999999999999998e-159 < d < -1.5499999999999999e-307

    1. Initial program 39.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. Simplified39.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative39.0%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 62.5%

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

    if -1.5499999999999999e-307 < d

    1. Initial program 66.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.7%

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

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

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

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

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

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

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

Alternative 4: 79.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\\
\mathbf{if}\;h \leq -4.3 \cdot 10^{+250}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot t\_0\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -4.3e250

    1. Initial program 56.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. Simplified56.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num56.4%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*l/75.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \frac{\color{blue}{M \cdot 1}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. associate-/l*75.5%

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

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

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

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

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

    if -4.3e250 < h < -1.999999999999994e-310

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative61.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 73.4%

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

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

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

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

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

Alternative 5: 76.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.4 \cdot 10^{+143}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;d \leq -1.36 \cdot 10^{-45}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{\frac{D \cdot M}{d}}{2}\right)}^{2}\right)\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-305}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.4e+143)
   (* (- d) (pow (* h l) -0.5))
   (if (<= d -1.36e-45)
     (*
      (sqrt (/ d l))
      (*
       (sqrt (/ d h))
       (+ 1.0 (* (/ h l) (* -0.5 (pow (/ (/ (* D M) d) 2.0) 2.0))))))
     (if (<= d 1.5e-305)
       (*
        (* d (sqrt (/ 1.0 (* h l))))
        (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
       (*
        (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
        (* d (/ (pow l -0.5) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.4e+143) {
		tmp = -d * pow((h * l), -0.5);
	} else if (d <= -1.36e-45) {
		tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * pow((((D * M) / d) / 2.0), 2.0)))));
	} else if (d <= 1.5e-305) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (pow(l, -0.5) / 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 <= (-2.4d+143)) then
        tmp = -d * ((h * l) ** (-0.5d0))
    else if (d <= (-1.36d-45)) then
        tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0d0 + ((h / l) * ((-0.5d0) * ((((d_1 * m) / d) / 2.0d0) ** 2.0d0)))))
    else if (d <= 1.5d-305) then
        tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else
        tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d * ((l ** (-0.5d0)) / 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 <= -2.4e+143) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else if (d <= -1.36e-45) {
		tmp = Math.sqrt((d / l)) * (Math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * Math.pow((((D * M) / d) / 2.0), 2.0)))));
	} else if (d <= 1.5e-305) {
		tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -2.4e+143:
		tmp = -d * math.pow((h * l), -0.5)
	elif d <= -1.36e-45:
		tmp = math.sqrt((d / l)) * (math.sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * math.pow((((D * M) / d) / 2.0), 2.0)))))
	elif d <= 1.5e-305:
		tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	else:
		tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (math.pow(l, -0.5) / math.sqrt(h)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.4e+143)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (d <= -1.36e-45)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(Float64(D * M) / d) / 2.0) ^ 2.0))))));
	elseif (d <= 1.5e-305)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	else
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d * Float64((l ^ -0.5) / sqrt(h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -2.4e+143)
		tmp = -d * ((h * l) ^ -0.5);
	elseif (d <= -1.36e-45)
		tmp = sqrt((d / l)) * (sqrt((d / h)) * (1.0 + ((h / l) * (-0.5 * ((((D * M) / d) / 2.0) ^ 2.0)))));
	elseif (d <= 1.5e-305)
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	else
		tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d * ((l ^ -0.5) / sqrt(h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.4e+143], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.36e-45], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision] / 2.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e-305], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.4 \cdot 10^{+143}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.3999999999999998e143

    1. Initial program 58.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified58.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt58.7%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity58.7%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/58.7%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity58.7%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/58.7%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*58.7%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

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

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

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt78.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-178.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified78.1%

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

    if -2.3999999999999998e143 < d < -1.35999999999999998e-45

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/81.5%

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{\color{blue}{M \cdot D}}{1 \cdot \left(2 \cdot d\right)}\right)}^{2} \cdot -0.5\right)\right)\right) \]
      8. *-un-lft-identity81.5%

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot -0.5\right)\right)\right) \]
      10. associate-*l/79.2%

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

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

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

    if -1.35999999999999998e-45 < d < 1.5000000000000001e-305

    1. Initial program 50.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. Simplified50.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative50.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 68.4%

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

    if 1.5000000000000001e-305 < d

    1. Initial program 67.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified66.9%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity68.8%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/69.5%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative69.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. div-inv83.5%

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h}} \cdot {\ell}^{-0.5}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    12. Step-by-step derivation
      1. associate-*l/84.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.4 \cdot 10^{+143}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;d \leq -1.36 \cdot 10^{-45}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{\frac{D \cdot M}{d}}{2}\right)}^{2}\right)\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{-305}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 76.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -6.2 \cdot 10^{+216}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\ \mathbf{elif}\;d \leq -1.55 \cdot 10^{-307}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;d \leq 1.65 \cdot 10^{-130}:\\ \;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -6.2e+216)
   (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l))))
   (if (<= d -1.55e-307)
     (*
      (* d (sqrt (/ 1.0 (* h l))))
      (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
     (if (<= d 1.65e-130)
       (*
        d
        (/
         (fma -0.5 (* h (/ (pow (/ (* D M) (* d 2.0)) 2.0) l)) 1.0)
         (sqrt (* h l))))
       (*
        (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
        (/ (/ d (sqrt h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -6.2e+216) {
		tmp = sqrt((d / h)) * (sqrt(-d) / sqrt(-l));
	} else if (d <= -1.55e-307) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (d <= 1.65e-130) {
		tmp = d * (fma(-0.5, (h * (pow(((D * M) / (d * 2.0)), 2.0) / l)), 1.0) / sqrt((h * l)));
	} else {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * ((d / sqrt(h)) / sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -6.2e+216)
		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))));
	elseif (d <= -1.55e-307)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	elseif (d <= 1.65e-130)
		tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) / l)), 1.0) / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(Float64(d / sqrt(h)) / sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.2e+216], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.55e-307], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.65e-130], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.2 \cdot 10^{+216}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -6.20000000000000007e216

    1. Initial program 56.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. Simplified56.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt56.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/56.6%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity56.6%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/56.6%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*56.6%

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

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

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

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

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

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

    if -6.20000000000000007e216 < d < -1.5499999999999999e-307

    1. Initial program 63.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. Simplified62.6%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative62.6%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 68.7%

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

    if -1.5499999999999999e-307 < d < 1.6499999999999999e-130

    1. Initial program 48.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. Simplified46.3%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity46.4%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt46.4%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/46.4%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative46.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/72.9%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. cancel-sign-sub-inv72.9%

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

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

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

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}}\right)}^{2}}\right)\right) \]
      6. unpow-prod-down73.0%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
      7. associate-*r*70.3%

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

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

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

      \[\leadsto \color{blue}{\frac{d \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}{\sqrt{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/l*78.7%

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

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

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

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

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

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

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

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

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

    if 1.6499999999999999e-130 < d

    1. Initial program 74.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. Simplified75.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity76.7%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/77.7%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative77.7%

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

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

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

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

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

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

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

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

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

Alternative 7: 77.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -4 \cdot 10^{+250}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right)\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \left(d \cdot \frac{{\ell}^{-0.5}}{\sqrt{h}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -4e+250)
   (*
    (/ 1.0 (sqrt (/ l d)))
    (*
     (sqrt (/ d h))
     (+ 1.0 (* h (* (pow (* D (* M (/ 0.5 d))) 2.0) (/ -0.5 l))))))
   (if (<= h -2e-310)
     (*
      (* d (sqrt (/ 1.0 (* h l))))
      (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
     (*
      (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
      (* d (/ (pow l -0.5) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -4e+250) {
		tmp = (1.0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0 + (h * (pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)))));
	} else if (h <= -2e-310) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (pow(l, -0.5) / 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 <= (-4d+250)) then
        tmp = (1.0d0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0d0 + (h * (((d_1 * (m * (0.5d0 / d))) ** 2.0d0) * ((-0.5d0) / l)))))
    else if (h <= (-2d-310)) then
        tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else
        tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d * ((l ** (-0.5d0)) / 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 <= -4e+250) {
		tmp = (1.0 / Math.sqrt((l / d))) * (Math.sqrt((d / h)) * (1.0 + (h * (Math.pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)))));
	} else if (h <= -2e-310) {
		tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else {
		tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (Math.pow(l, -0.5) / Math.sqrt(h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if h <= -4e+250:
		tmp = (1.0 / math.sqrt((l / d))) * (math.sqrt((d / h)) * (1.0 + (h * (math.pow((D * (M * (0.5 / d))), 2.0) * (-0.5 / l)))))
	elif h <= -2e-310:
		tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	else:
		tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d * (math.pow(l, -0.5) / math.sqrt(h)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -4e+250)
		tmp = Float64(Float64(1.0 / sqrt(Float64(l / d))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(h * Float64((Float64(D * Float64(M * Float64(0.5 / d))) ^ 2.0) * Float64(-0.5 / l))))));
	elseif (h <= -2e-310)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	else
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d * Float64((l ^ -0.5) / sqrt(h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (h <= -4e+250)
		tmp = (1.0 / sqrt((l / d))) * (sqrt((d / h)) * (1.0 + (h * (((D * (M * (0.5 / d))) ^ 2.0) * (-0.5 / l)))));
	elseif (h <= -2e-310)
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	else
		tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d * ((l ^ -0.5) / sqrt(h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4e+250], N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(h * N[(N[Power[N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -4 \cdot 10^{+250}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -3.9999999999999997e250

    1. Initial program 56.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. Simplified56.3%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num56.4%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot -0.5\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*l/75.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + h \cdot \left({\left(D \cdot \frac{\color{blue}{M \cdot 1}}{d \cdot 2}\right)}^{2} \cdot \frac{-0.5}{\ell}\right)\right)\right) \]
      5. associate-/l*75.5%

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

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

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

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

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

    if -3.9999999999999997e250 < h < -1.999999999999994e-310

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative61.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 73.4%

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity68.2%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity68.2%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt68.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h}} \cdot {\ell}^{-0.5}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    12. Step-by-step derivation
      1. associate-*l/83.9%

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

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

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

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

Alternative 8: 77.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;h \leq -4.5 \cdot 10^{+251}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -4.4999999999999998e251

    1. Initial program 56.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. Simplified56.3%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity75.4%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt75.4%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/75.4%

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

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

    if -4.4999999999999998e251 < h < -1.999999999999994e-310

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative61.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 73.4%

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity68.2%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity68.2%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt68.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h}} \cdot {\ell}^{-0.5}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    12. Step-by-step derivation
      1. associate-*l/83.9%

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

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

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

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

Alternative 9: 77.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+252}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -3.2000000000000002e252

    1. Initial program 56.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. Simplified56.3%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity75.4%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt75.4%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/75.4%

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

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

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

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

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

    if -3.2000000000000002e252 < h < -1.999999999999994e-310

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative61.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 73.4%

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity68.2%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity68.2%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt68.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{d}{\sqrt{h}} \cdot {\ell}^{-0.5}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    12. Step-by-step derivation
      1. associate-*l/83.9%

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

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

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

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

Alternative 10: 74.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\\
\mathbf{if}\;h \leq -7.8 \cdot 10^{+251}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t\_0}{\ell}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -7.79999999999999951e251

    1. Initial program 56.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. Simplified56.3%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity75.4%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt75.4%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/75.4%

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

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

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

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

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

    if -7.79999999999999951e251 < h < -1.999999999999994e-310

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified61.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative61.9%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 73.4%

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

    if -1.999999999999994e-310 < h

    1. Initial program 67.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. Simplified67.2%

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity68.2%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity68.2%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt68.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/68.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-*l/85.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}{\sqrt{\ell}}} \]
    12. Step-by-step derivation
      1. associate-/l*83.0%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h}} \cdot \frac{1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)}{\sqrt{\ell}}} \]
      2. associate-*r*83.0%

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

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

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

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

Alternative 11: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.45 \cdot 10^{-294}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+204}:\\ \;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}}{\ell}, 1\right)}{\sqrt{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 (<= l -1.45e-294)
   (*
    (* d (sqrt (/ 1.0 (* h l))))
    (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
   (if (<= l 3.2e+204)
     (*
      d
      (/
       (fma -0.5 (* h (/ (pow (/ (* D M) (* d 2.0)) 2.0) l)) 1.0)
       (sqrt (* h l))))
     (/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.45e-294) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (l <= 3.2e+204) {
		tmp = d * (fma(-0.5, (h * (pow(((D * M) / (d * 2.0)), 2.0) / l)), 1.0) / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.45e-294)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	elseif (l <= 3.2e+204)
		tmp = Float64(d * Float64(fma(-0.5, Float64(h * Float64((Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0) / l)), 1.0) / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.45e-294], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+204], N[(d * N[(N[(-0.5 * N[(h * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sqrt[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}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\

\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+204}:\\
\;\;\;\;d \cdot \frac{\mathsf{fma}\left(-0.5, h \cdot \frac{{\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}}{\ell}, 1\right)}{\sqrt{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 l < -1.45e-294

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative62.1%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 68.0%

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

    if -1.45e-294 < l < 3.2e204

    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. Simplified68.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity70.3%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/85.1%

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

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

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \color{blue}{\left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right) \]
      4. add-sqr-sqrt81.1%

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

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}}\right)}^{2}}\right)\right) \]
      6. unpow-prod-down82.9%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
      7. associate-*r*82.0%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. cancel-sign-sub-inv82.0%

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

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

      \[\leadsto \color{blue}{\frac{d \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}{\sqrt{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-/l*75.6%

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

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

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

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

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

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

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

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

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

    if 3.2e204 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

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

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

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

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

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

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

Alternative 12: 67.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\ \mathbf{if}\;\ell \leq -2.25 \cdot 10^{+26}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-290}:\\ \;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;\ell \leq 10^{+204}:\\ \;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \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 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))))
   (if (<= l -2.25e+26)
     (* (- d) (pow (* h l) -0.5))
     (if (<= l 5.8e-290)
       (* t_0 (sqrt (* (/ d l) (/ d h))))
       (if (<= l 1e+204)
         (* t_0 (/ d (sqrt (* h l))))
         (/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l));
	double tmp;
	if (l <= -2.25e+26) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= 5.8e-290) {
		tmp = t_0 * sqrt(((d / l) * (d / h)));
	} else if (l <= 1e+204) {
		tmp = t_0 * (d / sqrt((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) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))
    if (l <= (-2.25d+26)) then
        tmp = -d * ((h * l) ** (-0.5d0))
    else if (l <= 5.8d-290) then
        tmp = t_0 * sqrt(((d / l) * (d / h)))
    else if (l <= 1d+204) then
        tmp = t_0 * (d / sqrt((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 t_0 = 1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l));
	double tmp;
	if (l <= -2.25e+26) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else if (l <= 5.8e-290) {
		tmp = t_0 * Math.sqrt(((d / l) * (d / h)));
	} else if (l <= 1e+204) {
		tmp = t_0 * (d / Math.sqrt((h * l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = 1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))
	tmp = 0
	if l <= -2.25e+26:
		tmp = -d * math.pow((h * l), -0.5)
	elif l <= 5.8e-290:
		tmp = t_0 * math.sqrt(((d / l) * (d / h)))
	elif l <= 1e+204:
		tmp = t_0 * (d / math.sqrt((h * l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l)))
	tmp = 0.0
	if (l <= -2.25e+26)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= 5.8e-290)
		tmp = Float64(t_0 * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	elseif (l <= 1e+204)
		tmp = Float64(t_0 * Float64(d / sqrt(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)
	t_0 = 1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l));
	tmp = 0.0;
	if (l <= -2.25e+26)
		tmp = -d * ((h * l) ^ -0.5);
	elseif (l <= 5.8e-290)
		tmp = t_0 * sqrt(((d / l) * (d / h)));
	elseif (l <= 1e+204)
		tmp = t_0 * (d / sqrt((h * l)));
	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[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.25e+26], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.8e-290], N[(t$95$0 * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+204], N[(t$95$0 * N[(d / N[Sqrt[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}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\\
\mathbf{if}\;\ell \leq -2.25 \cdot 10^{+26}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-290}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

\mathbf{elif}\;\ell \leq 10^{+204}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -2.24999999999999989e26

    1. Initial program 59.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. Simplified59.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt59.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/63.0%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity64.6%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/63.0%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.5%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

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

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

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt53.3%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-153.3%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified53.3%

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

    if -2.24999999999999989e26 < l < 5.79999999999999989e-290

    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. Simplified63.4%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity70.8%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt69.4%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/69.4%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative63.4%

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

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

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

    if 5.79999999999999989e-290 < l < 9.99999999999999989e203

    1. Initial program 68.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified68.7%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity71.0%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt71.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/86.5%

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

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

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

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

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

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

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

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

    if 9.99999999999999989e203 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

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

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

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

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

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

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

Alternative 13: 66.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.4 \cdot 10^{+25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 5.1 \cdot 10^{-290}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+205}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{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 (<= l -1.4e+25)
   (* (- d) (pow (* h l) -0.5))
   (if (<= l 5.1e-290)
     (*
      (sqrt (* (/ d l) (/ d h)))
      (- 1.0 (* 0.5 (* (/ h l) (pow (/ (* D (* 0.5 M)) d) 2.0)))))
     (if (<= l 2.9e+205)
       (*
        (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
        (/ d (sqrt (* h l))))
       (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.4e+25) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= 5.1e-290) {
		tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * pow(((D * (0.5 * M)) / d), 2.0))));
	} else if (l <= 2.9e+205) {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((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 (l <= (-1.4d+25)) then
        tmp = -d * ((h * l) ** (-0.5d0))
    else if (l <= 5.1d-290) then
        tmp = sqrt(((d / l) * (d / h))) * (1.0d0 - (0.5d0 * ((h / l) * (((d_1 * (0.5d0 * m)) / d) ** 2.0d0))))
    else if (l <= 2.9d+205) then
        tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((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 (l <= -1.4e+25) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else if (l <= 5.1e-290) {
		tmp = Math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * Math.pow(((D * (0.5 * M)) / d), 2.0))));
	} else if (l <= 2.9e+205) {
		tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.4e+25:
		tmp = -d * math.pow((h * l), -0.5)
	elif l <= 5.1e-290:
		tmp = math.sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * math.pow(((D * (0.5 * M)) / d), 2.0))))
	elif l <= 2.9e+205:
		tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.4e+25)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= 5.1e-290)
		tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(D * Float64(0.5 * M)) / d) ^ 2.0)))));
	elseif (l <= 2.9e+205)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(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 (l <= -1.4e+25)
		tmp = -d * ((h * l) ^ -0.5);
	elseif (l <= 5.1e-290)
		tmp = sqrt(((d / l) * (d / h))) * (1.0 - (0.5 * ((h / l) * (((D * (0.5 * M)) / d) ^ 2.0))));
	elseif (l <= 2.9e+205)
		tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.4e+25], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.1e-290], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D * N[(0.5 * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+205], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[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}\;\ell \leq -1.4 \cdot 10^{+25}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.4000000000000001e25

    1. Initial program 59.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. Simplified59.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt59.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/63.0%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity64.6%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/63.0%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.5%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

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

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

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt53.3%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-153.3%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified53.3%

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

    if -1.4000000000000001e25 < l < 5.1e-290

    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. Simplified63.4%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative63.4%

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

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

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

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

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

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

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

    if 5.1e-290 < l < 2.9000000000000001e205

    1. Initial program 68.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified68.7%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity71.0%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt71.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/86.5%

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

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

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

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

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

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

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

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

    if 2.9000000000000001e205 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

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

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

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

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.4 \cdot 10^{+25}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 5.1 \cdot 10^{-290}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{D \cdot \left(0.5 \cdot M\right)}{d}\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+205}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 65.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -9 \cdot 10^{-89}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 5.1 \cdot 10^{-290}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;\ell \leq 2.35 \cdot 10^{+210}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{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 (<= l -9e-89)
   (* (- d) (pow (* h l) -0.5))
   (if (<= l 5.1e-290)
     (*
      (- 1.0 (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))))
      (sqrt (* (/ d l) (/ d h))))
     (if (<= l 2.35e+210)
       (*
        (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
        (/ d (sqrt (* h l))))
       (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -9e-89) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= 5.1e-290) {
		tmp = (1.0 - (0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * sqrt(((d / l) * (d / h)));
	} else if (l <= 2.35e+210) {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((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 (l <= (-9d-89)) then
        tmp = -d * ((h * l) ** (-0.5d0))
    else if (l <= 5.1d-290) then
        tmp = (1.0d0 - (0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l)))) * sqrt(((d / l) * (d / h)))
    else if (l <= 2.35d+210) then
        tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((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 (l <= -9e-89) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else if (l <= 5.1e-290) {
		tmp = (1.0 - (0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * Math.sqrt(((d / l) * (d / h)));
	} else if (l <= 2.35e+210) {
		tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -9e-89:
		tmp = -d * math.pow((h * l), -0.5)
	elif l <= 5.1e-290:
		tmp = (1.0 - (0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l)))) * math.sqrt(((d / l) * (d / h)))
	elif l <= 2.35e+210:
		tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -9e-89)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= 5.1e-290)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)))) * sqrt(Float64(Float64(d / l) * Float64(d / h))));
	elseif (l <= 2.35e+210)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(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 (l <= -9e-89)
		tmp = -d * ((h * l) ^ -0.5);
	elseif (l <= 5.1e-290)
		tmp = (1.0 - (0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l)))) * sqrt(((d / l) * (d / h)));
	elseif (l <= 2.35e+210)
		tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-89], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5.1e-290], N[(N[(1.0 - N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.35e+210], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[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}\;\ell \leq -9 \cdot 10^{-89}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -8.9999999999999998e-89

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/64.3%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity66.6%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/64.3%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*63.2%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

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

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

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt51.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-151.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified51.5%

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

    if -8.9999999999999998e-89 < l < 5.1e-290

    1. Initial program 61.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. Simplified59.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative59.3%

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

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

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

    if 5.1e-290 < l < 2.35e210

    1. Initial program 68.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified68.7%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity71.0%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt71.9%

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/86.5%

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

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

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

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

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

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

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

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

    if 2.35e210 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

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

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

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

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

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

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

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

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

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

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

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

Alternative 15: 60.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -3.1 \cdot 10^{-86}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1.45 \cdot 10^{-294}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+206}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{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 (<= l -3.1e-86)
   (* (- d) (pow (* h l) -0.5))
   (if (<= l -1.45e-294)
     (* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
     (if (<= l 3.05e+206)
       (*
        (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
        (/ d (sqrt (* h l))))
       (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -3.1e-86) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= -1.45e-294) {
		tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
	} else if (l <= 3.05e+206) {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -3.1e-86)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= -1.45e-294)
		tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5));
	elseif (l <= 3.05e+206)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.1e-86], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.45e-294], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.05e+206], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[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}\;\ell \leq -3.1 \cdot 10^{-86}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -3.09999999999999989e-86

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.4%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity67.0%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/64.7%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity67.0%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/64.7%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*63.5%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

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

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

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt51.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-151.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified51.5%

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

    if -3.09999999999999989e-86 < l < -1.45e-294

    1. Initial program 61.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. Simplified59.7%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt59.7%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity61.9%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/61.9%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity61.9%

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/61.9%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.8%

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

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 13.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow1/213.1%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \]
      2. rem-exp-log13.1%

        \[\leadsto d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \]
      3. exp-neg13.1%

        \[\leadsto d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \]
      4. exp-prod13.1%

        \[\leadsto d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \]
      5. distribute-lft-neg-out13.1%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      6. distribute-rgt-neg-in13.1%

        \[\leadsto d \cdot e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \]
      7. metadata-eval13.1%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \]
      8. exp-to-pow13.1%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified13.1%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u13.1%

        \[\leadsto d \cdot {\color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(h \cdot \ell\right)\right)\right)}}^{-0.5} \]
      2. expm1-undefine42.7%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    12. Applied egg-rr42.7%

      \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    13. Step-by-step derivation
      1. sub-neg42.7%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \left(-1\right)\right)}}^{-0.5} \]
      2. metadata-eval42.7%

        \[\leadsto d \cdot {\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \color{blue}{-1}\right)}^{-0.5} \]
      3. +-commutative42.7%

        \[\leadsto d \cdot {\color{blue}{\left(-1 + e^{\mathsf{log1p}\left(h \cdot \ell\right)}\right)}}^{-0.5} \]
      4. log1p-undefine42.7%

        \[\leadsto d \cdot {\left(-1 + e^{\color{blue}{\log \left(1 + h \cdot \ell\right)}}\right)}^{-0.5} \]
      5. rem-exp-log42.7%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(1 + h \cdot \ell\right)}\right)}^{-0.5} \]
      6. +-commutative42.7%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(h \cdot \ell + 1\right)}\right)}^{-0.5} \]
      7. fma-define42.7%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\mathsf{fma}\left(h, \ell, 1\right)}\right)}^{-0.5} \]
    14. Simplified42.7%

      \[\leadsto d \cdot {\color{blue}{\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}}^{-0.5} \]

    if -1.45e-294 < l < 3.04999999999999983e206

    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. Simplified68.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity70.3%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/85.1%

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

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

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

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

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

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

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

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

    if 3.04999999999999983e206 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutative49.6%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
    6. Simplified49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    7. Step-by-step derivation
      1. sqrt-div49.6%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
      3. *-commutative49.6%

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. un-div-inv49.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.1 \cdot 10^{-86}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -1.45 \cdot 10^{-294}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+206}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 58.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2.25 \cdot 10^{-82}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 7 \cdot 10^{+203}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{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 (<= l -2.25e-82)
   (* (- d) (pow (* h l) -0.5))
   (if (<= l -5e-310)
     (* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
     (if (<= l 7e+203)
       (*
        (+ 1.0 (* (/ h l) (* -0.5 (pow (* D (/ M (* d 2.0))) 2.0))))
        (/ d (sqrt (* h l))))
       (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -2.25e-82) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= -5e-310) {
		tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
	} else if (l <= 7e+203) {
		tmp = (1.0 + ((h / l) * (-0.5 * pow((D * (M / (d * 2.0))), 2.0)))) * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -2.25e-82)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= -5e-310)
		tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5));
	elseif (l <= 7e+203)
		tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)))) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.25e-82], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 7e+203], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[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}\;\ell \leq -2.25 \cdot 10^{-82}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq 7 \cdot 10^{+203}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -2.2499999999999999e-82

    1. Initial program 63.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. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow165.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow164.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr64.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*63.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified63.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow1/20.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt51.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-151.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified51.5%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -2.2499999999999999e-82 < l < -4.999999999999985e-310

    1. Initial program 59.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt57.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow257.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod57.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow157.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval57.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow159.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr59.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*59.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified59.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 12.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow1/212.8%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \]
      2. rem-exp-log12.8%

        \[\leadsto d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \]
      3. exp-neg12.8%

        \[\leadsto d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \]
      4. exp-prod12.8%

        \[\leadsto d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \]
      5. distribute-lft-neg-out12.8%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      6. distribute-rgt-neg-in12.8%

        \[\leadsto d \cdot e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \]
      7. metadata-eval12.8%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \]
      8. exp-to-pow12.8%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified12.8%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u12.8%

        \[\leadsto d \cdot {\color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(h \cdot \ell\right)\right)\right)}}^{-0.5} \]
      2. expm1-undefine41.1%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    12. Applied egg-rr41.1%

      \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    13. Step-by-step derivation
      1. sub-neg41.1%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \left(-1\right)\right)}}^{-0.5} \]
      2. metadata-eval41.1%

        \[\leadsto d \cdot {\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \color{blue}{-1}\right)}^{-0.5} \]
      3. +-commutative41.1%

        \[\leadsto d \cdot {\color{blue}{\left(-1 + e^{\mathsf{log1p}\left(h \cdot \ell\right)}\right)}}^{-0.5} \]
      4. log1p-undefine41.1%

        \[\leadsto d \cdot {\left(-1 + e^{\color{blue}{\log \left(1 + h \cdot \ell\right)}}\right)}^{-0.5} \]
      5. rem-exp-log41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(1 + h \cdot \ell\right)}\right)}^{-0.5} \]
      6. +-commutative41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(h \cdot \ell + 1\right)}\right)}^{-0.5} \]
      7. fma-define41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\mathsf{fma}\left(h, \ell, 1\right)}\right)}^{-0.5} \]
    14. Simplified41.1%

      \[\leadsto d \cdot {\color{blue}{\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}}^{-0.5} \]

    if -4.999999999999985e-310 < l < 7.00000000000000062e203

    1. Initial program 69.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. Simplified69.3%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/71.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times71.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. *-commutative71.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity71.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      6. *-commutative72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right) \]
      7. associate-/l/72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{2} \cdot h}{\ell}\right) \]
      8. times-frac71.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity71.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{2} \cdot h}{\ell}\right) \]
      10. associate-*r/72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{\left(\sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}} \cdot \sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}}\right)} \cdot h}{\ell}\right) \]
      12. pow272.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{{\left(\sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}}\right)}^{2}} \cdot h}{\ell}\right) \]
      13. sqrt-pow172.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{\left(\frac{2}{2}\right)}\right)}}^{2} \cdot h}{\ell}\right) \]
      14. metadata-eval72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{\color{blue}{1}}\right)}^{2} \cdot h}{\ell}\right) \]
      15. pow172.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/72.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right) \]
    5. Applied egg-rr72.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative72.5%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. sqrt-div77.1%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      3. sqrt-div86.7%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      4. frac-times86.6%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      5. add-sqr-sqrt86.8%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    7. Applied egg-rr86.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    8. Step-by-step derivation
      1. associate-/l/84.8%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    9. Simplified84.8%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/86.8%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. cancel-sign-sub-inv86.8%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \color{blue}{\left(1 + \left(-0.5\right) \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)} \]
      3. associate-/l*82.7%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \color{blue}{\left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right) \]
      4. add-sqr-sqrt82.7%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{h}{\ell}}\right)}\right)\right) \]
      5. pow282.7%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell}}\right)}^{2}}\right)\right) \]
      6. unpow-prod-down84.6%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
      7. associate-*r*83.7%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.5\right) \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
      8. cancel-sign-sub-inv83.7%

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \color{blue}{\left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)} \]
      9. associate-*l/88.0%

        \[\leadsto \color{blue}{\frac{d \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    11. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{d \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}{\sqrt{h \cdot \ell}}} \]
    12. Step-by-step derivation
      1. associate-*l/75.0%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + -0.5 \cdot \left({\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      2. associate-*r*75.0%

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + \color{blue}{\left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. *-commutative75.0%

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot {\left(D \cdot \frac{M}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    13. Simplified75.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 + \left(-0.5 \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]

    if 7.00000000000000062e203 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutative49.6%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
    6. Simplified49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    7. Step-by-step derivation
      1. sqrt-div49.6%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
      3. *-commutative49.6%

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. un-div-inv49.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.25 \cdot 10^{-82}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq 7 \cdot 10^{+203}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 72.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.45 \cdot 10^{-294}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+206}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{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 (<= l -1.45e-294)
   (*
    (* d (sqrt (/ 1.0 (* h l))))
    (+ (* 0.5 (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l))) -1.0))
   (if (<= l 2.9e+206)
     (*
      (- 1.0 (* 0.5 (/ (* h (pow (* D (/ M (* d 2.0))) 2.0)) l)))
      (/ d (sqrt (* h l))))
     (/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.45e-294) {
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * (pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (l <= 2.9e+206) {
		tmp = (1.0 - (0.5 * ((h * pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / sqrt((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 (l <= (-1.45d-294)) then
        tmp = (d * sqrt((1.0d0 / (h * l)))) * ((0.5d0 * ((((m / 2.0d0) * (d_1 / d)) ** 2.0d0) * (h / l))) + (-1.0d0))
    else if (l <= 2.9d+206) then
        tmp = (1.0d0 - (0.5d0 * ((h * ((d_1 * (m / (d * 2.0d0))) ** 2.0d0)) / l))) * (d / sqrt((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 (l <= -1.45e-294) {
		tmp = (d * Math.sqrt((1.0 / (h * l)))) * ((0.5 * (Math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0);
	} else if (l <= 2.9e+206) {
		tmp = (1.0 - (0.5 * ((h * Math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / Math.sqrt((h * l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -1.45e-294:
		tmp = (d * math.sqrt((1.0 / (h * l)))) * ((0.5 * (math.pow(((M / 2.0) * (D / d)), 2.0) * (h / l))) + -1.0)
	elif l <= 2.9e+206:
		tmp = (1.0 - (0.5 * ((h * math.pow((D * (M / (d * 2.0))), 2.0)) / l))) * (d / math.sqrt((h * l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.45e-294)
		tmp = Float64(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))) * Float64(Float64(0.5 * Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l))) + -1.0));
	elseif (l <= 2.9e+206)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h * (Float64(D * Float64(M / Float64(d * 2.0))) ^ 2.0)) / l))) * Float64(d / sqrt(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 (l <= -1.45e-294)
		tmp = (d * sqrt((1.0 / (h * l)))) * ((0.5 * ((((M / 2.0) * (D / d)) ^ 2.0) * (h / l))) + -1.0);
	elseif (l <= 2.9e+206)
		tmp = (1.0 - (0.5 * ((h * ((D * (M / (d * 2.0))) ^ 2.0)) / l))) * (d / sqrt((h * l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.45e-294], N[(N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+206], N[(N[(1.0 - N[(0.5 * N[(N[(h * N[Power[N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[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}\;\ell \leq -1.45 \cdot 10^{-294}:\\
\;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\

\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+206}:\\
\;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{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 l < -1.45e-294

    1. Initial program 62.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. Simplified62.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. *-commutative62.1%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
      2. sqrt-unprod47.1%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    5. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]
    6. Taylor expanded in d around -inf 68.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \]

    if -1.45e-294 < l < 2.9e206

    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. Simplified68.0%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/70.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right) \]
      2. frac-times70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      3. *-commutative70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-un-lft-identity70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{2} \cdot h}{\ell}\right) \]
      5. times-frac71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      6. *-commutative71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right) \]
      7. associate-/l/71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{2} \cdot h}{\ell}\right) \]
      8. times-frac70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{2} \cdot h}{\ell}\right) \]
      9. *-un-lft-identity70.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{2} \cdot h}{\ell}\right) \]
      10. associate-*r/71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      11. add-sqr-sqrt71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{\left(\sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}} \cdot \sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}}\right)} \cdot h}{\ell}\right) \]
      12. pow271.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{{\left(\sqrt{{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2}}\right)}^{2}} \cdot h}{\ell}\right) \]
      13. sqrt-pow171.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{\left(\frac{2}{2}\right)}\right)}}^{2} \cdot h}{\ell}\right) \]
      14. metadata-eval71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left({\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{\color{blue}{1}}\right)}^{2} \cdot h}{\ell}\right) \]
      15. pow171.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{2} \cdot h}{\ell}\right) \]
      16. associate-/l/71.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right) \]
    5. Applied egg-rr71.1%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}}\right) \]
    6. Step-by-step derivation
      1. *-commutative71.1%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. sqrt-div75.6%

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      3. sqrt-div85.0%

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      4. frac-times84.9%

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      5. add-sqr-sqrt85.1%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    7. Applied egg-rr85.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    8. Step-by-step derivation
      1. associate-/l/83.1%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    9. Simplified83.1%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    10. Step-by-step derivation
      1. associate-/l/85.1%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. div-inv85.1%

        \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{\ell} \cdot \sqrt{h}}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      3. sqrt-unprod78.4%

        \[\leadsto \left(d \cdot \frac{1}{\color{blue}{\sqrt{\ell \cdot h}}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      4. *-commutative78.4%

        \[\leadsto \left(d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    11. Applied egg-rr78.4%

      \[\leadsto \color{blue}{\left(d \cdot \frac{1}{\sqrt{h \cdot \ell}}\right)} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    12. Step-by-step derivation
      1. associate-*r/78.6%

        \[\leadsto \color{blue}{\frac{d \cdot 1}{\sqrt{h \cdot \ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
      2. *-rgt-identity78.6%

        \[\leadsto \frac{\color{blue}{d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]
    13. Simplified78.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right) \]

    if 2.9e206 < l

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutative49.6%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
    6. Simplified49.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    7. Step-by-step derivation
      1. sqrt-div49.6%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval49.6%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
      3. *-commutative49.6%

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr49.6%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. un-div-inv49.6%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod78.3%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*70.2%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr70.2%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/78.3%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified78.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.45 \cdot 10^{-294}:\\ \;\;\;\;\left(d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot \left(0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) + -1\right)\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+206}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \frac{M}{d \cdot 2}\right)}^{2}}{\ell}\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 47.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -4.8e-87)
   (* (- d) (pow (* h l) -0.5))
   (if (<= l -5e-310)
     (* d (pow (+ -1.0 (fma h l 1.0)) -0.5))
     (* d (* (pow l -0.5) (pow h -0.5))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -4.8e-87) {
		tmp = -d * pow((h * l), -0.5);
	} else if (l <= -5e-310) {
		tmp = d * pow((-1.0 + fma(h, l, 1.0)), -0.5);
	} else {
		tmp = d * (pow(l, -0.5) * pow(h, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -4.8e-87)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	elseif (l <= -5e-310)
		tmp = Float64(d * (Float64(-1.0 + fma(h, l, 1.0)) ^ -0.5));
	else
		tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-87], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Power[N[(-1.0 + N[(h * l + 1.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-87}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -4.7999999999999999e-87

    1. Initial program 63.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. Simplified63.5%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt63.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow263.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod63.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow165.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval65.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity67.0%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow164.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/64.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr64.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*63.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified63.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow1/20.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt51.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-151.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified51.5%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if -4.7999999999999999e-87 < l < -4.999999999999985e-310

    1. Initial program 59.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Simplified57.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt57.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow257.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod57.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow157.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval57.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow159.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/59.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr59.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*59.4%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified59.4%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 12.8%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow1/212.8%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \]
      2. rem-exp-log12.8%

        \[\leadsto d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \]
      3. exp-neg12.8%

        \[\leadsto d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \]
      4. exp-prod12.8%

        \[\leadsto d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \]
      5. distribute-lft-neg-out12.8%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      6. distribute-rgt-neg-in12.8%

        \[\leadsto d \cdot e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \]
      7. metadata-eval12.8%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \]
      8. exp-to-pow12.8%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified12.8%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u12.8%

        \[\leadsto d \cdot {\color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(h \cdot \ell\right)\right)\right)}}^{-0.5} \]
      2. expm1-undefine41.1%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    12. Applied egg-rr41.1%

      \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} - 1\right)}}^{-0.5} \]
    13. Step-by-step derivation
      1. sub-neg41.1%

        \[\leadsto d \cdot {\color{blue}{\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \left(-1\right)\right)}}^{-0.5} \]
      2. metadata-eval41.1%

        \[\leadsto d \cdot {\left(e^{\mathsf{log1p}\left(h \cdot \ell\right)} + \color{blue}{-1}\right)}^{-0.5} \]
      3. +-commutative41.1%

        \[\leadsto d \cdot {\color{blue}{\left(-1 + e^{\mathsf{log1p}\left(h \cdot \ell\right)}\right)}}^{-0.5} \]
      4. log1p-undefine41.1%

        \[\leadsto d \cdot {\left(-1 + e^{\color{blue}{\log \left(1 + h \cdot \ell\right)}}\right)}^{-0.5} \]
      5. rem-exp-log41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(1 + h \cdot \ell\right)}\right)}^{-0.5} \]
      6. +-commutative41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\left(h \cdot \ell + 1\right)}\right)}^{-0.5} \]
      7. fma-define41.1%

        \[\leadsto d \cdot {\left(-1 + \color{blue}{\mathsf{fma}\left(h, \ell, 1\right)}\right)}^{-0.5} \]
    14. Simplified41.1%

      \[\leadsto d \cdot {\color{blue}{\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}}^{-0.5} \]

    if -4.999999999999985e-310 < l

    1. Initial program 67.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. Simplified67.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt67.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow267.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod67.2%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow168.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval68.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times68.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative68.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity68.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac69.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative69.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/69.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac68.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity68.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/69.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow169.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/69.5%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr69.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*68.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified68.7%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 40.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow1/240.0%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \]
      2. rem-exp-log37.8%

        \[\leadsto d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \]
      3. exp-neg37.8%

        \[\leadsto d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \]
      4. exp-prod38.4%

        \[\leadsto d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \]
      5. distribute-lft-neg-out38.4%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      6. distribute-rgt-neg-in38.4%

        \[\leadsto d \cdot e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \]
      7. metadata-eval38.4%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \]
      8. exp-to-pow40.6%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified40.6%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative40.6%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down49.1%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr49.1%

      \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot {\left(-1 + \mathsf{fma}\left(h, \ell, 1\right)\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 47.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 8 \cdot 10^{-279}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d 8e-279)
   (* (- d) (pow (* h l) -0.5))
   (* d (* (pow l -0.5) (pow h -0.5)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 8e-279) {
		tmp = -d * pow((h * l), -0.5);
	} else {
		tmp = d * (pow(l, -0.5) * pow(h, -0.5));
	}
	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 <= 8d-279) then
        tmp = -d * ((h * l) ** (-0.5d0))
    else
        tmp = d * ((l ** (-0.5d0)) * (h ** (-0.5d0)))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 8e-279) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else {
		tmp = d * (Math.pow(l, -0.5) * Math.pow(h, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= 8e-279:
		tmp = -d * math.pow((h * l), -0.5)
	else:
		tmp = d * (math.pow(l, -0.5) * math.pow(h, -0.5))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= 8e-279)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	else
		tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= 8e-279)
		tmp = -d * ((h * l) ^ -0.5);
	else
		tmp = d * ((l ^ -0.5) * (h ^ -0.5));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 8e-279], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq 8 \cdot 10^{-279}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 8.00000000000000044e-279

    1. Initial program 61.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. Simplified60.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified61.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow1/20.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt42.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-142.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified42.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if 8.00000000000000044e-279 < d

    1. Initial program 68.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. Simplified68.1%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt68.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow268.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod68.1%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow169.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval69.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac70.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative70.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/70.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/70.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow170.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/70.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr70.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*69.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified69.8%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in d around inf 41.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. unpow1/241.4%

        \[\leadsto d \cdot \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \]
      2. rem-exp-log39.0%

        \[\leadsto d \cdot {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \]
      3. exp-neg39.0%

        \[\leadsto d \cdot {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \]
      4. exp-prod39.6%

        \[\leadsto d \cdot \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \]
      5. distribute-lft-neg-out39.6%

        \[\leadsto d \cdot e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \]
      6. distribute-rgt-neg-in39.6%

        \[\leadsto d \cdot e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \]
      7. metadata-eval39.6%

        \[\leadsto d \cdot e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \]
      8. exp-to-pow42.0%

        \[\leadsto d \cdot \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \]
    10. Simplified42.0%

      \[\leadsto \color{blue}{d \cdot {\left(h \cdot \ell\right)}^{-0.5}} \]
    11. Step-by-step derivation
      1. *-commutative42.0%

        \[\leadsto d \cdot {\color{blue}{\left(\ell \cdot h\right)}}^{-0.5} \]
      2. unpow-prod-down51.2%

        \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
    12. Applied egg-rr51.2%

      \[\leadsto d \cdot \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 8 \cdot 10^{-279}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 47.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 1.35 \cdot 10^{-278}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d 1.35e-278)
   (* (- d) (pow (* h l) -0.5))
   (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 1.35e-278) {
		tmp = -d * pow((h * l), -0.5);
	} 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 <= 1.35d-278) then
        tmp = -d * ((h * l) ** (-0.5d0))
    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 <= 1.35e-278) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= 1.35e-278:
		tmp = -d * math.pow((h * l), -0.5)
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= 1.35e-278)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	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 <= 1.35e-278)
		tmp = -d * ((h * l) ^ -0.5);
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.35e-278], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $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 1.35 \cdot 10^{-278}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 1.3500000000000001e-278

    1. Initial program 61.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. Simplified60.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified61.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow1/20.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt42.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-142.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified42.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if 1.3500000000000001e-278 < d

    1. Initial program 68.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. Simplified68.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 41.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutative41.4%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
    6. Simplified41.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    7. Step-by-step derivation
      1. sqrt-div41.9%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval41.9%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
      3. *-commutative41.9%

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr41.9%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. un-div-inv42.0%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. sqrt-prod51.2%

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h} \cdot \sqrt{\ell}}} \]
      3. associate-/r*49.5%

        \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    10. Applied egg-rr49.5%

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    11. Step-by-step derivation
      1. associate-/l/51.2%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
    12. Simplified51.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.35 \cdot 10^{-278}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 43.4% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 1.7 \cdot 10^{-278}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d 1.7e-278) (* (- d) (pow (* h l) -0.5)) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= 1.7e-278) {
		tmp = -d * pow((h * l), -0.5);
	} 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.7d-278) then
        tmp = -d * ((h * l) ** (-0.5d0))
    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.7e-278) {
		tmp = -d * Math.pow((h * l), -0.5);
	} else {
		tmp = d / Math.sqrt((h * l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= 1.7e-278:
		tmp = -d * math.pow((h * l), -0.5)
	else:
		tmp = d / math.sqrt((h * l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= 1.7e-278)
		tmp = Float64(Float64(-d) * (Float64(h * l) ^ -0.5));
	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.7e-278)
		tmp = -d * ((h * l) ^ -0.5);
	else
		tmp = d / sqrt((h * l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 1.7e-278], N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.7 \cdot 10^{-278}:\\
\;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 1.7e-278

    1. Initial program 61.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. Simplified60.8%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt60.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right) \]
      2. pow260.8%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right) \]
      3. sqrt-prod60.9%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right) \]
      4. sqrt-pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      5. metadata-eval62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{\color{blue}{1}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      6. frac-times63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      7. *-commutative63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      8. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot M}{\color{blue}{1 \cdot \left(2 \cdot d\right)}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      9. times-frac62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D}{1} \cdot \frac{M}{2 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      10. *-commutative62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      11. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D}{1} \cdot \color{blue}{\frac{\frac{M}{2}}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      12. times-frac63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(\frac{D \cdot \frac{M}{2}}{1 \cdot d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      13. *-un-lft-identity63.7%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\left(\frac{D \cdot \frac{M}{2}}{\color{blue}{d}}\right)}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      14. associate-*r/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left({\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)}}^{1} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      15. pow162.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{\frac{M}{2}}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
      16. associate-/l/62.3%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \color{blue}{\frac{M}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right) \]
    5. Applied egg-rr62.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}}\right) \]
    6. Step-by-step derivation
      1. associate-*l*61.6%

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right) \]
    7. Simplified61.6%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}}\right) \]
    8. Taylor expanded in l around -inf 0.0%

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. unpow1/20.0%

        \[\leadsto \color{blue}{{\left(\frac{1}{h \cdot \ell}\right)}^{0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      3. rem-exp-log0.0%

        \[\leadsto {\left(\frac{1}{\color{blue}{e^{\log \left(h \cdot \ell\right)}}}\right)}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      4. exp-neg0.0%

        \[\leadsto {\color{blue}{\left(e^{-\log \left(h \cdot \ell\right)}\right)}}^{0.5} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      5. exp-prod0.0%

        \[\leadsto \color{blue}{e^{\left(-\log \left(h \cdot \ell\right)\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      6. distribute-lft-neg-out0.0%

        \[\leadsto e^{\color{blue}{-\log \left(h \cdot \ell\right) \cdot 0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      7. distribute-rgt-neg-in0.0%

        \[\leadsto e^{\color{blue}{\log \left(h \cdot \ell\right) \cdot \left(-0.5\right)}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      8. metadata-eval0.0%

        \[\leadsto e^{\log \left(h \cdot \ell\right) \cdot \color{blue}{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      9. exp-to-pow0.0%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot \left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \]
      10. *-commutative0.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \]
      11. unpow20.0%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \]
      12. rem-square-sqrt42.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \left(\color{blue}{-1} \cdot d\right) \]
      13. neg-mul-142.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{-0.5} \cdot \color{blue}{\left(-d\right)} \]
    10. Simplified42.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5} \cdot \left(-d\right)} \]

    if 1.7e-278 < d

    1. Initial program 68.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. Simplified68.1%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in d around inf 41.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. *-commutative41.4%

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
    6. Simplified41.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
    7. Step-by-step derivation
      1. sqrt-div41.9%

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
      2. metadata-eval41.9%

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
      3. *-commutative41.9%

        \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied egg-rr41.9%

      \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. un-div-inv42.0%

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. *-commutative42.0%

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
    10. Applied egg-rr42.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.7 \cdot 10^{-278}:\\ \;\;\;\;\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 26.9% accurate, 3.2× 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 64.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. Simplified64.1%

    \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \left(M \cdot \frac{D}{d}\right)\right)}^{2}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in d around inf 22.8%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. *-commutative22.8%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
  6. Simplified22.8%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]
  7. Step-by-step derivation
    1. sqrt-div23.1%

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\ell \cdot h}}} \]
    2. metadata-eval23.1%

      \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{\ell \cdot h}} \]
    3. *-commutative23.1%

      \[\leadsto d \cdot \frac{1}{\sqrt{\color{blue}{h \cdot \ell}}} \]
  8. Applied egg-rr23.1%

    \[\leadsto d \cdot \color{blue}{\frac{1}{\sqrt{h \cdot \ell}}} \]
  9. Step-by-step derivation
    1. un-div-inv23.1%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    2. *-commutative23.1%

      \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
  10. Applied egg-rr23.1%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
  11. Final simplification23.1%

    \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024118 
(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)))))