Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.6% → 78.1%
Time: 22.5s
Alternatives: 27
Speedup: 2.5×

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 27 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 78.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{-d}\\
t_2 := \frac{M \cdot D}{d \cdot 2}\\
t_3 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{t\_2}{\frac{-1}{h}}\\
\mathbf{if}\;d \leq -9.5 \cdot 10^{+74}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_2}^{2} \cdot \frac{-1}{2}\right)\right)\\

\mathbf{elif}\;d \leq -1.95 \cdot 10^{-237}:\\
\;\;\;\;\left(t\_0 \cdot \frac{t\_1}{\sqrt{-\ell}}\right) \cdot t\_3\\

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

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


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

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000006e74 < d < -1.9499999999999999e-237

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9499999999999999e-237 < d < 4.80000000000000028e-224

    1. Initial program 23.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.80000000000000028e-224 < d

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.4% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+221}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6443.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6482.5

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr82.5%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 73.5% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq 10^{+221}:\\
\;\;\;\;t\_1 \cdot t\_2\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 82.5%

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

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

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

    1. Initial program 42.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr40.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6442.5

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6480.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr80.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.6% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 10^{+221}:\\
\;\;\;\;t\_1 \cdot t\_0\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 82.5%

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

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

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

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

    1. Initial program 42.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr40.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6442.5

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6480.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr80.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 71.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 10^{+221}:\\
\;\;\;\;t\_1 \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


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

    1. Initial program 82.5%

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

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

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

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

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6424.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6453.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr53.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

Alternative 6: 71.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
t_1 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
t_2 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-102}:\\
\;\;\;\;t\_1 \cdot \left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(h \cdot -0.125\right)\right)\\

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_2 \leq 10^{+221}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6424.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6453.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr53.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

Alternative 7: 63.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-102}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


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

    1. Initial program 82.5%

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

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

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

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6424.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6453.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr53.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

Alternative 8: 59.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
t_1 := \sqrt{h \cdot \ell}\\
t_2 := \left|\frac{d}{t\_1}\right|\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-102}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d}, 1\right)}{t\_1}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_2\\

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

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 82.5%

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

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

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

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

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6424.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6453.9

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr53.9%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

Alternative 9: 59.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6424.4

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6454.4

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr54.4%

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

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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

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

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

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

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

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

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

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

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

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

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

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

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

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

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

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

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

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

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

Alternative 10: 80.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr34.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6444.9

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6491.3

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr91.3%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 80.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 41.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr34.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6444.9

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6491.3

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr91.3%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6441.2

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified41.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 80.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M \cdot D}{d \cdot 2}\\ t_1 := \left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_1 \leq 10^{+221}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \left(h \cdot t\_0\right)\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ (* M D) (* d 2.0)))
        (t_1
         (*
          (+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_1 1e+221)
     (*
      (* (sqrt (/ d h)) (sqrt (/ d l)))
      (- 1.0 (* (/ (/ (* M (* D 0.5)) (* d 2.0)) l) (* h t_0))))
     (if (<= t_1 INFINITY)
       (fabs (/ d (sqrt (* h l))))
       (fma
        (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) / (d * 2.0);
	double t_1 = (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_1 <= 1e+221) {
		tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((((M * (D * 0.5)) / (d * 2.0)) / l) * (h * t_0)));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = fabs((d / sqrt((h * l))));
	} else {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) / Float64(d * 2.0))
	t_1 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_0 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_1 <= 1e+221)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(h * t_0))));
	elseif (t_1 <= Inf)
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	else
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+221], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d \cdot 2}\\
t_1 := \left(1 + \frac{h}{\ell} \cdot \left({t\_0}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_1 \leq 10^{+221}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \left(h \cdot t\_0\right)\right)\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e221

    1. Initial program 85.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr86.4%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6486.4

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr86.4%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6486.4

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr86.4%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{d \cdot 2}}}{\frac{1}{h}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{d \cdot 2}}}{\frac{1}{h}}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\color{blue}{\frac{1}{h}}}\right) \]
      5. div-invN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{1}{\frac{1}{h}}\right)}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{1}{\color{blue}{\frac{1}{h}}}\right)\right) \]
      7. remove-double-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \left(\frac{M \cdot D}{d \cdot 2} \cdot \color{blue}{h}\right)\right) \]
      8. lower-*.f6486.3

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]
    10. Applied egg-rr86.3%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]

    if 1e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

    1. Initial program 41.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6434.5

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified34.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6434.5

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr34.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6444.9

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6491.3

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr91.3%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 0.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr13.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6441.2

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified41.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \left(h \cdot \frac{M \cdot D}{d \cdot 2}\right)\right)\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 77.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_0 \leq 10^{+221}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\frac{M}{d} \cdot \left(D \cdot \frac{M \cdot D}{d}\right)\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_0 1e+221)
     (/
      (*
       (sqrt (/ d h))
       (fma (/ h l) (* -0.125 (* (/ M d) (* D (/ (* M D) d)))) 1.0))
      (sqrt (/ l d)))
     (if (<= t_0 INFINITY)
       (fabs (/ d (sqrt (* h l))))
       (fma
        (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 1e+221) {
		tmp = (sqrt((d / h)) * fma((h / l), (-0.125 * ((M / d) * (D * ((M * D) / d)))), 1.0)) / sqrt((l / d));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = fabs((d / sqrt((h * l))));
	} else {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_0 <= 1e+221)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(h / l), Float64(-0.125 * Float64(Float64(M / d) * Float64(D * Float64(Float64(M * D) / d)))), 1.0)) / sqrt(Float64(l / d)));
	elseif (t_0 <= Inf)
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	else
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+221], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(-0.125 * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_0 \leq 10^{+221}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\frac{M}{d} \cdot \left(D \cdot \frac{M \cdot D}{d}\right)\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e221

    1. Initial program 85.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d} \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \left(D \cdot \color{blue}{\left(M \cdot D\right)}\right)}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \color{blue}{\left(D \cdot \left(M \cdot D\right)\right)}}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      3. times-fracN/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\frac{M}{d} \cdot \frac{D \cdot \left(M \cdot D\right)}{d}\right)} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\frac{M}{d} \cdot \frac{D \cdot \left(M \cdot D\right)}{d}\right)} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\color{blue}{\frac{M}{d}} \cdot \frac{D \cdot \left(M \cdot D\right)}{d}\right) \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\frac{M}{d} \cdot \frac{\color{blue}{D \cdot \left(M \cdot D\right)}}{d}\right) \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      7. associate-/l*N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\frac{M}{d} \cdot \color{blue}{\left(D \cdot \frac{M \cdot D}{d}\right)}\right) \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\frac{M}{d} \cdot \color{blue}{\left(D \cdot \frac{M \cdot D}{d}\right)}\right) \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      9. lower-/.f6483.3

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\frac{M}{d} \cdot \left(D \cdot \color{blue}{\frac{M \cdot D}{d}}\right)\right) \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr83.3%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\frac{M}{d} \cdot \left(D \cdot \frac{M \cdot D}{d}\right)\right)} \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]

    if 1e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

    1. Initial program 41.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6434.5

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified34.5%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6434.5

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr34.5%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6444.9

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6491.3

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr91.3%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 0.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr13.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6441.2

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified41.2%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\frac{M}{d} \cdot \left(D \cdot \frac{M \cdot D}{d}\right)\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 52.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;t\_0 \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_0 2e-157)
     (* d (sqrt (/ 1.0 (sqrt (* h (* h (* l l)))))))
     (if (<= t_0 1e+221)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (fabs (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = d * sqrt((1.0 / sqrt((h * (h * (l * l))))));
	} else if (t_0 <= 1e+221) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = fabs((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) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
    if (t_0 <= 2d-157) then
        tmp = d * sqrt((1.0d0 / sqrt((h * (h * (l * l))))))
    else if (t_0 <= 1d+221) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = abs((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 t_0 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = d * Math.sqrt((1.0 / Math.sqrt((h * (h * (l * l))))));
	} else if (t_0 <= 1e+221) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
	tmp = 0
	if t_0 <= 2e-157:
		tmp = d * math.sqrt((1.0 / math.sqrt((h * (h * (l * l))))))
	elif t_0 <= 1e+221:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = math.fabs((d / math.sqrt((h * l))))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_0 <= 2e-157)
		tmp = Float64(d * sqrt(Float64(1.0 / sqrt(Float64(h * Float64(h * Float64(l * l)))))));
	elseif (t_0 <= 1e+221)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
	tmp = 0.0;
	if (t_0 <= 2e-157)
		tmp = d * sqrt((1.0 / sqrt((h * (h * (l * l))))));
	elseif (t_0 <= 1e+221)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = abs((d / sqrt((h * l))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(d * N[Sqrt[N[(1.0 / N[Sqrt[N[(h * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+221], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}}\\

\mathbf{elif}\;t\_0 \leq 10^{+221}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999989e-157

    1. Initial program 75.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified18.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. /-rgt-identityN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\frac{h \cdot \ell}{1}}}} \]
      3. clear-numN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\frac{1}{\frac{1}{h \cdot \ell}}}}} \]
      4. inv-powN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}}} \]
      5. pow-flipN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(-1\right)\right)}}}} \]
      6. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{1}}}} \]
      7. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2} + \frac{1}{2}\right)}}}} \]
      8. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\color{blue}{\frac{1}{2}} + \frac{1}{2}\right)}}} \]
      9. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\color{blue}{\frac{1}{2}} + \frac{1}{2}\right)}}} \]
      10. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right)}}} \]
      11. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right)}}} \]
      12. pow-prod-upN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}}} \]
      13. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      14. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      15. pow1/2N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      16. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}}} \]
      17. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      18. pow1/2N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \color{blue}{\sqrt{h \cdot \ell}}}} \]
      19. lower-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
      20. lower-sqrt.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell}} \cdot \sqrt{h \cdot \ell}}} \]
      21. lower-sqrt.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \color{blue}{\sqrt{h \cdot \ell}}}} \]
    7. Applied egg-rr18.3%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \ell}} \cdot \sqrt{h \cdot \ell}}} \]
      2. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \sqrt{\color{blue}{h \cdot \ell}}}} \]
      3. sqrt-unprodN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      5. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \ell\right)} \cdot \left(h \cdot \ell\right)}}} \]
      6. associate-*l*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      7. lower-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      8. lower-*.f6422.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
    9. Applied egg-rr22.3%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(\ell \cdot \color{blue}{\left(h \cdot \ell\right)}\right)}}} \]
      2. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      3. *-commutativeN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right) \cdot h}}}} \]
      4. lower-*.f6422.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right) \cdot h}}}} \]
      5. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)} \cdot h}}} \]
      6. *-commutativeN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(\left(h \cdot \ell\right) \cdot \ell\right)} \cdot h}}} \]
      7. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\left(\color{blue}{\left(h \cdot \ell\right)} \cdot \ell\right) \cdot h}}} \]
      8. associate-*l*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \left(\ell \cdot \ell\right)\right)} \cdot h}}} \]
      9. lower-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \left(\ell \cdot \ell\right)\right)} \cdot h}}} \]
      10. lower-*.f6423.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\left(h \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right) \cdot h}}} \]
    11. Applied egg-rr23.3%

      \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \left(\ell \cdot \ell\right)\right) \cdot h}}}} \]

    if 1.99999999999999989e-157 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e221

    1. Initial program 98.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6432.7

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified32.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. unpow1N/A

        \[\leadsto \color{blue}{{d}^{1}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. metadata-evalN/A

        \[\leadsto {d}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-pow1N/A

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      5. lift-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      7. lift-/.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \]
      13. *-commutativeN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{h}} \]
      19. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      20. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      21. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      22. lift-sqrt.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{h}}} \]
    7. Applied egg-rr97.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]

    if 1e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 14.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6429.1

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified29.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6429.0

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr29.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6421.7

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6452.5

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr52.5%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 2 \cdot 10^{-157}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 51.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;t\_0 \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_0 2e-157)
     (* d (sqrt (/ 1.0 (sqrt (* h (* l (* h l)))))))
     (if (<= t_0 1e+221)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (fabs (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = d * sqrt((1.0 / sqrt((h * (l * (h * l))))));
	} else if (t_0 <= 1e+221) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = fabs((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) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
    if (t_0 <= 2d-157) then
        tmp = d * sqrt((1.0d0 / sqrt((h * (l * (h * l))))))
    else if (t_0 <= 1d+221) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = abs((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 t_0 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 2e-157) {
		tmp = d * Math.sqrt((1.0 / Math.sqrt((h * (l * (h * l))))));
	} else if (t_0 <= 1e+221) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
	tmp = 0
	if t_0 <= 2e-157:
		tmp = d * math.sqrt((1.0 / math.sqrt((h * (l * (h * l))))))
	elif t_0 <= 1e+221:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = math.fabs((d / math.sqrt((h * l))))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_0 <= 2e-157)
		tmp = Float64(d * sqrt(Float64(1.0 / sqrt(Float64(h * Float64(l * Float64(h * l)))))));
	elseif (t_0 <= 1e+221)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
	tmp = 0.0;
	if (t_0 <= 2e-157)
		tmp = d * sqrt((1.0 / sqrt((h * (l * (h * l))))));
	elseif (t_0 <= 1e+221)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = abs((d / sqrt((h * l))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-157], N[(d * N[Sqrt[N[(1.0 / N[Sqrt[N[(h * N[(l * N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+221], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-157}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\

\mathbf{elif}\;t\_0 \leq 10^{+221}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.99999999999999989e-157

    1. Initial program 75.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified18.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. /-rgt-identityN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\frac{h \cdot \ell}{1}}}} \]
      3. clear-numN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\frac{1}{\frac{1}{h \cdot \ell}}}}} \]
      4. inv-powN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}}}} \]
      5. pow-flipN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\mathsf{neg}\left(-1\right)\right)}}}} \]
      6. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{1}}}} \]
      7. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2} + \frac{1}{2}\right)}}}} \]
      8. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\color{blue}{\frac{1}{2}} + \frac{1}{2}\right)}}} \]
      9. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\color{blue}{\frac{1}{2}} + \frac{1}{2}\right)}}} \]
      10. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right)}}} \]
      11. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2} + \color{blue}{\frac{1}{2}}\right)}}} \]
      12. pow-prod-upN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}}} \]
      13. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      14. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{{\left(h \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      15. pow1/2N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell}} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{1}{2}\right)}}} \]
      16. lift-/.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}}} \]
      17. metadata-evalN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot {\left(h \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}}} \]
      18. pow1/2N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \color{blue}{\sqrt{h \cdot \ell}}}} \]
      19. lower-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
      20. lower-sqrt.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell}} \cdot \sqrt{h \cdot \ell}}} \]
      21. lower-sqrt.f6418.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \color{blue}{\sqrt{h \cdot \ell}}}} \]
    7. Applied egg-rr18.3%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \ell}} \cdot \sqrt{h \cdot \ell}}} \]
      2. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \ell} \cdot \sqrt{\color{blue}{h \cdot \ell}}}} \]
      3. sqrt-unprodN/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      5. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \ell\right)} \cdot \left(h \cdot \ell\right)}}} \]
      6. associate-*l*N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      7. lower-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      8. lower-*.f6422.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
    9. Applied egg-rr22.3%

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]

    if 1.99999999999999989e-157 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e221

    1. Initial program 98.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6432.7

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified32.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. unpow1N/A

        \[\leadsto \color{blue}{{d}^{1}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. metadata-evalN/A

        \[\leadsto {d}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-pow1N/A

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      5. lift-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      7. lift-/.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \]
      13. *-commutativeN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{h}} \]
      19. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      20. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      21. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      22. lift-sqrt.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{h}}} \]
    7. Applied egg-rr97.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]

    if 1e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 14.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6429.1

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified29.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6429.0

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr29.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6421.7

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6452.5

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr52.5%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 2 \cdot 10^{-157}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 53.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;t\_0 \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
   (if (<= t_0 0.0)
     (/ d (sqrt (sqrt (* h (* l (* h l))))))
     (if (<= t_0 1e+221)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (fabs (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = d / sqrt(sqrt((h * (l * (h * l)))));
	} else if (t_0 <= 1e+221) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = fabs((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) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
    if (t_0 <= 0.0d0) then
        tmp = d / sqrt(sqrt((h * (l * (h * l)))))
    else if (t_0 <= 1d+221) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = abs((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 t_0 = (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = d / Math.sqrt(Math.sqrt((h * (l * (h * l)))));
	} else if (t_0 <= 1e+221) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = d / math.sqrt(math.sqrt((h * (l * (h * l)))))
	elif t_0 <= 1e+221:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = math.fabs((d / math.sqrt((h * l))))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(d / sqrt(sqrt(Float64(h * Float64(l * Float64(h * l))))));
	elseif (t_0 <= 1e+221)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = d / sqrt(sqrt((h * (l * (h * l)))));
	elseif (t_0 <= 1e+221)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = abs((d / sqrt((h * l))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(d / N[Sqrt[N[Sqrt[N[(h * N[(l * N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+221], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\

\mathbf{elif}\;t\_0 \leq 10^{+221}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0

    1. Initial program 75.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6417.4

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified17.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6416.4

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr16.4%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. lift-*.f6416.4

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
      3. sqrt-unprodN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{\left(h \cdot \ell\right)} \cdot \left(h \cdot \ell\right)}}} \]
      6. associate-*l*N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      8. lower-*.f6421.4

        \[\leadsto \frac{d}{\sqrt{\sqrt{h \cdot \color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
    9. Applied egg-rr21.4%

      \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1e221

    1. Initial program 98.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6433.6

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified33.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. unpow1N/A

        \[\leadsto \color{blue}{{d}^{1}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. metadata-evalN/A

        \[\leadsto {d}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-pow1N/A

        \[\leadsto \color{blue}{\sqrt{{d}^{2}}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. pow2N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      5. lift-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      7. lift-/.f64N/A

        \[\leadsto \sqrt{d \cdot d} \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      8. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\left(d \cdot d\right) \cdot \color{blue}{\frac{1}{h \cdot \ell}}} \]
      10. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \]
      13. *-commutativeN/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{\ell \cdot h}}} \]
      14. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell} \cdot \frac{d}{h}}} \]
      15. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}} \cdot \frac{d}{h}} \]
      16. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{\ell} \cdot \color{blue}{\frac{d}{h}}} \]
      17. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
      18. unpow1/2N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\frac{1}{2}}} \cdot \sqrt{\frac{d}{h}} \]
      19. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      20. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      21. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{h}} \]
      22. lift-sqrt.f64N/A

        \[\leadsto {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      23. lower-*.f6497.8

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{h}}} \]
    7. Applied egg-rr97.8%

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]

    if 1e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 14.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6429.1

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified29.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6429.0

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr29.0%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6421.7

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6452.5

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr52.5%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 0:\\ \;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\ \mathbf{elif}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 10^{+221}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 46.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -2 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
       (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
      -2e-93)
   (* d (sqrt (/ 1.0 (* h l))))
   (fabs (/ d (sqrt (* h l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -2e-93) {
		tmp = d * sqrt((1.0 / (h * l)));
	} else {
		tmp = fabs((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 (((1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-2d-93)) then
        tmp = d * sqrt((1.0d0 / (h * l)))
    else
        tmp = abs((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 (((1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -2e-93) {
		tmp = d * Math.sqrt((1.0 / (h * l)));
	} else {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if ((1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -2e-93:
		tmp = d * math.sqrt((1.0 / (h * l)))
	else:
		tmp = math.fabs((d / math.sqrt((h * l))))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -2e-93)
		tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l))));
	else
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (((1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -2e-93)
		tmp = d * sqrt((1.0 / (h * l)));
	else
		tmp = abs((d / sqrt((h * l))));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-93], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -2 \cdot 10^{-93}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999998e-93

    1. Initial program 82.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6410.1

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified10.1%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]

    if -1.9999999999999998e-93 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 50.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6432.7

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified32.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6432.7

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr32.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6433.2

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6459.8

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr59.8%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -2 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 46.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-102}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|t\_0\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ d (sqrt (* h l)))))
   (if (<=
        (*
         (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
         (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
        -5e-102)
     t_0
     (fabs t_0))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = d / sqrt((h * l));
	double tmp;
	if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -5e-102) {
		tmp = t_0;
	} else {
		tmp = fabs(t_0);
	}
	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 / sqrt((h * l))
    if (((1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-5d-102)) then
        tmp = t_0
    else
        tmp = abs(t_0)
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = d / Math.sqrt((h * l));
	double tmp;
	if (((1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -5e-102) {
		tmp = t_0;
	} else {
		tmp = Math.abs(t_0);
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = d / math.sqrt((h * l))
	tmp = 0
	if ((1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -5e-102:
		tmp = t_0
	else:
		tmp = math.fabs(t_0)
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(d / sqrt(Float64(h * l)))
	tmp = 0.0
	if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -5e-102)
		tmp = t_0;
	else
		tmp = abs(t_0);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = d / sqrt((h * l));
	tmp = 0.0;
	if (((1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -5e-102)
		tmp = t_0;
	else
		tmp = abs(t_0);
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-102], t$95$0, N[Abs[t$95$0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-102}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left|t\_0\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.00000000000000026e-102

    1. Initial program 82.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6410.0

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified10.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f648.7

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr8.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]

    if -5.00000000000000026e-102 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 50.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6432.9

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified32.9%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6432.9

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr32.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6433.4

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6460.2

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr60.2%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -5 \cdot 10^{-102}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 77.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -4.4 \cdot 10^{-234}:\\ \;\;\;\;\left(t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq 1.22 \cdot 10^{-223}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+
          1.0
          (*
           (/ (/ (* M (* D 0.5)) (* d 2.0)) l)
           (/ (/ (* M D) (* d 2.0)) (/ -1.0 h)))))
        (t_1 (sqrt (/ d h))))
   (if (<= d -4.4e-234)
     (* (* t_1 (/ (sqrt (- d)) (sqrt (- l)))) t_0)
     (if (<= d 1.22e-223)
       (fma
        (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))
       (* t_0 (* t_1 (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
	double t_1 = sqrt((d / h));
	double tmp;
	if (d <= -4.4e-234) {
		tmp = (t_1 * (sqrt(-d) / sqrt(-l))) * t_0;
	} else if (d <= 1.22e-223) {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else {
		tmp = t_0 * (t_1 * (sqrt(d) / sqrt(l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
	t_1 = sqrt(Float64(d / h))
	tmp = 0.0
	if (d <= -4.4e-234)
		tmp = Float64(Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0);
	elseif (d <= 1.22e-223)
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	else
		tmp = Float64(t_0 * Float64(t_1 * Float64(sqrt(d) / sqrt(l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -4.4e-234], N[(N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.22e-223], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -4.4 \cdot 10^{-234}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\

\mathbf{elif}\;d \leq 1.22 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -4.3999999999999998e-234

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr70.1%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6470.1

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr70.1%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6470.1

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr70.1%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. sqrt-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. lower-neg.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      6. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{\mathsf{neg}\left(d\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. lower-neg.f6475.9

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{\color{blue}{-\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    10. Applied egg-rr75.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]

    if -4.3999999999999998e-234 < d < 1.21999999999999998e-223

    1. Initial program 23.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr0.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6467.0

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified67.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 1.21999999999999998e-223 < d

    1. Initial program 68.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6471.2

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6471.2

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr71.2%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6486.5

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    10. Applied egg-rr86.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4.4 \cdot 10^{-234}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \mathbf{elif}\;d \leq 1.22 \cdot 10^{-223}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 73.6% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\ \mathbf{if}\;d \leq -2.6 \cdot 10^{-126}:\\ \;\;\;\;t\_0 \cdot \left(\frac{1}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;d \leq 3.7 \cdot 10^{-224}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (+
          1.0
          (*
           (/ (/ (* M (* D 0.5)) (* d 2.0)) l)
           (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
   (if (<= d -2.6e-126)
     (* t_0 (* (/ 1.0 (sqrt (/ h d))) (sqrt (/ d l))))
     (if (<= d 3.7e-224)
       (fma
        (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))
       (* t_0 (* (sqrt (/ d h)) (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
	double tmp;
	if (d <= -2.6e-126) {
		tmp = t_0 * ((1.0 / sqrt((h / d))) * sqrt((d / l)));
	} else if (d <= 3.7e-224) {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else {
		tmp = t_0 * (sqrt((d / h)) * (sqrt(d) / sqrt(l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
	tmp = 0.0
	if (d <= -2.6e-126)
		tmp = Float64(t_0 * Float64(Float64(1.0 / sqrt(Float64(h / d))) * sqrt(Float64(d / l))));
	elseif (d <= 3.7e-224)
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	else
		tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(sqrt(d) / sqrt(l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.6e-126], N[(t$95$0 * N[(N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.7e-224], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;d \leq -2.6 \cdot 10^{-126}:\\
\;\;\;\;t\_0 \cdot \left(\frac{1}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right)\\

\mathbf{elif}\;d \leq 3.7 \cdot 10^{-224}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -2.59999999999999999e-126

    1. Initial program 68.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr75.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6475.9

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr75.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. clear-numN/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      6. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. metadata-evalN/A

        \[\leadsto \left(\frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      9. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{\color{blue}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. lower-/.f6476.5

        \[\leadsto \left(\frac{1}{\sqrt{\color{blue}{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr76.5%

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]

    if -2.59999999999999999e-126 < d < 3.7000000000000002e-224

    1. Initial program 27.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr7.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6461.9

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified61.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 3.7000000000000002e-224 < d

    1. Initial program 68.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6471.2

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6471.2

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr71.2%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6486.5

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    10. Applied egg-rr86.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.6 \cdot 10^{-126}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(\frac{1}{\sqrt{\frac{h}{d}}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;d \leq 3.7 \cdot 10^{-224}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 73.6% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \frac{M \cdot D}{d \cdot 2}\\ \mathbf{if}\;d \leq -7 \cdot 10^{-126}:\\ \;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - t\_0 \cdot \left(h \cdot t\_2\right)\right)\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{-222}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + t\_0 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ (/ (* M (* D 0.5)) (* d 2.0)) l))
        (t_1 (sqrt (/ d h)))
        (t_2 (/ (* M D) (* d 2.0))))
   (if (<= d -7e-126)
     (* (* t_1 (sqrt (/ d l))) (- 1.0 (* t_0 (* h t_2))))
     (if (<= d 1.7e-222)
       (fma
        (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))
       (* (+ 1.0 (* t_0 (/ t_2 (/ -1.0 h)))) (* t_1 (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
	double t_1 = sqrt((d / h));
	double t_2 = (M * D) / (d * 2.0);
	double tmp;
	if (d <= -7e-126) {
		tmp = (t_1 * sqrt((d / l))) * (1.0 - (t_0 * (h * t_2)));
	} else if (d <= 1.7e-222) {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else {
		tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * (t_1 * (sqrt(d) / sqrt(l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l)
	t_1 = sqrt(Float64(d / h))
	t_2 = Float64(Float64(M * D) / Float64(d * 2.0))
	tmp = 0.0
	if (d <= -7e-126)
		tmp = Float64(Float64(t_1 * sqrt(Float64(d / l))) * Float64(1.0 - Float64(t_0 * Float64(h * t_2))));
	elseif (d <= 1.7e-222)
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	else
		tmp = Float64(Float64(1.0 + Float64(t_0 * Float64(t_2 / Float64(-1.0 / h)))) * Float64(t_1 * Float64(sqrt(d) / sqrt(l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -7e-126], N[(N[(t$95$1 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(h * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.7e-222], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$0 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;d \leq -7 \cdot 10^{-126}:\\
\;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - t\_0 \cdot \left(h \cdot t\_2\right)\right)\\

\mathbf{elif}\;d \leq 1.7 \cdot 10^{-222}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -7e-126

    1. Initial program 68.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr75.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6475.9

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr75.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6475.9

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr75.9%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{d \cdot 2}}}{\frac{1}{h}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{d \cdot 2}}}{\frac{1}{h}}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\color{blue}{\frac{1}{h}}}\right) \]
      5. div-invN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{1}{\frac{1}{h}}\right)}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{1}{\color{blue}{\frac{1}{h}}}\right)\right) \]
      7. remove-double-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \left(\frac{M \cdot D}{d \cdot 2} \cdot \color{blue}{h}\right)\right) \]
      8. lower-*.f6475.9

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]
    10. Applied egg-rr75.9%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \color{blue}{\left(\frac{M \cdot D}{d \cdot 2} \cdot h\right)}\right) \]

    if -7e-126 < d < 1.7000000000000001e-222

    1. Initial program 27.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr7.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6461.9

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified61.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 1.7000000000000001e-222 < d

    1. Initial program 68.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6471.2

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr71.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. pow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lift-sqrt.f6471.2

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    8. Applied egg-rr71.2%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    9. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. lower-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6486.5

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    10. Applied egg-rr86.5%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -7 \cdot 10^{-126}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \left(h \cdot \frac{M \cdot D}{d \cdot 2}\right)\right)\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{-222}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 65.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{if}\;d \leq -2.6 \cdot 10^{+97}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -3 \cdot 10^{-120}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{elif}\;d \leq 2.3 \cdot 10^{+148}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (/
          (*
           (sqrt (/ d h))
           (fma (/ h l) (* -0.125 (* (* M D) (/ (* M D) (* d d)))) 1.0))
          (sqrt (/ l d)))))
   (if (<= d -2.6e+97)
     (* (- d) (sqrt (/ 1.0 (* h l))))
     (if (<= d -3e-120)
       t_0
       (if (<= d 2.6e-125)
         (fma
          (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
          (/ 1.0 l)
          (sqrt (/ (* d d) (* h l))))
         (if (<= d 2.3e+148) t_0 (/ d (* (sqrt l) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (sqrt((d / h)) * fma((h / l), (-0.125 * ((M * D) * ((M * D) / (d * d)))), 1.0)) / sqrt((l / d));
	double tmp;
	if (d <= -2.6e+97) {
		tmp = -d * sqrt((1.0 / (h * l)));
	} else if (d <= -3e-120) {
		tmp = t_0;
	} else if (d <= 2.6e-125) {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else if (d <= 2.3e+148) {
		tmp = t_0;
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(h / l), Float64(-0.125 * Float64(Float64(M * D) * Float64(Float64(M * D) / Float64(d * d)))), 1.0)) / sqrt(Float64(l / d)))
	tmp = 0.0
	if (d <= -2.6e+97)
		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (d <= -3e-120)
		tmp = t_0;
	elseif (d <= 2.6e-125)
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	elseif (d <= 2.3e+148)
		tmp = t_0;
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(-0.125 * N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.6e+97], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3e-120], t$95$0, If[LessEqual[d, 2.6e-125], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.3e+148], t$95$0, N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{if}\;d \leq -2.6 \cdot 10^{+97}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -3 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{elif}\;d \leq 2.3 \cdot 10^{+148}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.6e97

    1. Initial program 66.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow2N/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrtN/A

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      7. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      9. mul-1-negN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
      10. lower-neg.f6472.2

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
    5. Simplified72.2%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

    if -2.6e97 < d < -3.00000000000000011e-120 or 2.60000000000000006e-125 < d < 2.3000000000000001e148

    1. Initial program 79.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr76.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr76.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d} \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \left(D \cdot \color{blue}{\left(M \cdot D\right)}\right)}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \color{blue}{\left(D \cdot \left(M \cdot D\right)\right)}}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \color{blue}{\left(D \cdot \left(M \cdot D\right)\right)}}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      4. associate-*r*N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{\color{blue}{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{\color{blue}{\left(M \cdot D\right)} \cdot \left(M \cdot D\right)}{d \cdot d} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\color{blue}{d \cdot d}} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      7. associate-/l*N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right)} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right)} \cdot \frac{-1}{8}, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
      9. lower-/.f6479.4

        \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \left(\left(M \cdot D\right) \cdot \color{blue}{\frac{M \cdot D}{d \cdot d}}\right) \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr79.4%

      \[\leadsto \frac{\mathsf{fma}\left(\frac{h}{\ell}, \color{blue}{\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right)} \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}} \]

    if -3.00000000000000011e-120 < d < 2.60000000000000006e-125

    1. Initial program 32.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr10.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6456.9

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified56.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 2.3000000000000001e148 < d

    1. Initial program 51.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6478.4

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified78.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6478.3

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr78.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. lower-sqrt.f6490.3

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr90.3%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification72.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.6 \cdot 10^{+97}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -3 \cdot 10^{-120}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{elif}\;d \leq 2.3 \cdot 10^{+148}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot d}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 63.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -8.2 \cdot 10^{+96}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -3.85 \cdot 10^{-122}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d}, 1\right)\right)\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+148}:\\ \;\;\;\;\frac{t\_0 \cdot \frac{\mathsf{fma}\left(-0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ d h))))
   (if (<= d -8.2e+96)
     (* (- d) (sqrt (/ 1.0 (* h l))))
     (if (<= d -3.85e-122)
       (*
        (sqrt (/ d l))
        (* t_0 (fma (/ h l) (* -0.125 (/ (* M (* D (* M D))) (* d d))) 1.0)))
       (if (<= d 2.6e-125)
         (fma
          (* (* (* M M) (* (* D D) (sqrt (/ h l)))) (/ -0.125 d))
          (/ 1.0 l)
          (sqrt (/ (* d d) (* h l))))
         (if (<= d 1.5e+148)
           (/
            (* t_0 (/ (fma -0.125 (/ (* D (* D (* h (* M M)))) (* d d)) l) l))
            (sqrt (/ l d)))
           (/ d (* (sqrt l) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((d / h));
	double tmp;
	if (d <= -8.2e+96) {
		tmp = -d * sqrt((1.0 / (h * l)));
	} else if (d <= -3.85e-122) {
		tmp = sqrt((d / l)) * (t_0 * fma((h / l), (-0.125 * ((M * (D * (M * D))) / (d * d))), 1.0));
	} else if (d <= 2.6e-125) {
		tmp = fma((((M * M) * ((D * D) * sqrt((h / l)))) * (-0.125 / d)), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else if (d <= 1.5e+148) {
		tmp = (t_0 * (fma(-0.125, ((D * (D * (h * (M * M)))) / (d * d)), l) / l)) / sqrt((l / d));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(d / h))
	tmp = 0.0
	if (d <= -8.2e+96)
		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (d <= -3.85e-122)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(t_0 * fma(Float64(h / l), Float64(-0.125 * Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(d * d))), 1.0)));
	elseif (d <= 2.6e-125)
		tmp = fma(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * sqrt(Float64(h / l)))) * Float64(-0.125 / d)), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	elseif (d <= 1.5e+148)
		tmp = Float64(Float64(t_0 * Float64(fma(-0.125, Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) / Float64(d * d)), l) / l)) / sqrt(Float64(l / d)));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -8.2e+96], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.85e-122], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * N[(-0.125 * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.6e-125], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e+148], N[(N[(t$95$0 * N[(N[(-0.125 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] + l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -8.2 \cdot 10^{+96}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -3.85 \cdot 10^{-122}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d}, 1\right)\right)\\

\mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{elif}\;d \leq 1.5 \cdot 10^{+148}:\\
\;\;\;\;\frac{t\_0 \cdot \frac{\mathsf{fma}\left(-0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -8.19999999999999996e96

    1. Initial program 66.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow2N/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrtN/A

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      7. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      9. mul-1-negN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
      10. lower-neg.f6472.2

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
    5. Simplified72.2%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

    if -8.19999999999999996e96 < d < -3.8500000000000003e-122

    1. Initial program 70.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr66.2%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr66.7%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\frac{h}{\ell}, \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d} \cdot -0.125, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]

    if -3.8500000000000003e-122 < d < 2.60000000000000006e-125

    1. Initial program 32.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr10.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{d}} \cdot \frac{-1}{8}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left({M}^{2} \cdot {D}^{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left({M}^{2} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left({D}^{2} \cdot \sqrt{\frac{h}{\ell}}\right)}\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      14. lower-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\color{blue}{\frac{h}{\ell}}}\right)\right) \cdot \frac{\frac{-1}{8}}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      16. lower-/.f6456.9

        \[\leadsto \mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \color{blue}{\frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified56.9%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 2.60000000000000006e-125 < d < 1.50000000000000007e148

    1. Initial program 87.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in l around 0

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\ell + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\ell + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
      2. +-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} + \ell}}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      3. lower-fma.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{8}, \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}, \ell\right)}}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      6. associate-*l*N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{\color{blue}{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \color{blue}{\left(D \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \left(D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      11. unpow2N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \left(D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      13. unpow2N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(\frac{-1}{8}, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{d \cdot d}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
      14. lower-*.f6478.4

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(-0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\color{blue}{d \cdot d}}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified78.4%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\mathsf{fma}\left(-0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}, \ell\right)}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]

    if 1.50000000000000007e148 < d

    1. Initial program 51.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6478.4

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified78.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6478.3

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr78.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. lower-sqrt.f6490.3

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr90.3%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification70.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.2 \cdot 10^{+96}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -3.85 \cdot 10^{-122}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{d \cdot d}, 1\right)\right)\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right) \cdot \frac{-0.125}{d}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+148}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \frac{\mathsf{fma}\left(-0.125, \frac{D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot d}, \ell\right)}{\ell}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 58.5% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{if}\;d \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(t\_0 \cdot 0.125\right)\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{-223}:\\ \;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+210}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ h (* l (* l l))))))
   (if (<= d -4.6e+152)
     (* (- d) (sqrt (/ 1.0 (* h l))))
     (if (<= d -2.4e-53)
       (/ (sqrt (- (* d (/ d l)))) (sqrt (- h)))
       (if (<= d -4e-310)
         (* (* D (* D (/ (* M M) d))) (* t_0 0.125))
         (if (<= d 3.5e-223)
           (* t_0 (* (* D D) (/ (* (* M M) -0.125) d)))
           (if (<= d 4.6e+210)
             (*
              (/ d (sqrt (* h l)))
              (-
               1.0
               (*
                h
                (/
                 (* (* M D) (* M (* D 0.5)))
                 (* (* d 2.0) (* l (* d 2.0)))))))
             (/ d (* (sqrt l) (sqrt h))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h / (l * (l * l))));
	double tmp;
	if (d <= -4.6e+152) {
		tmp = -d * sqrt((1.0 / (h * l)));
	} else if (d <= -2.4e-53) {
		tmp = sqrt(-(d * (d / l))) / sqrt(-h);
	} else if (d <= -4e-310) {
		tmp = (D * (D * ((M * M) / d))) * (t_0 * 0.125);
	} else if (d <= 3.5e-223) {
		tmp = t_0 * ((D * D) * (((M * M) * -0.125) / d));
	} else if (d <= 4.6e+210) {
		tmp = (d / sqrt((h * l))) * (1.0 - (h * (((M * D) * (M * (D * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((h / (l * (l * l))))
    if (d <= (-4.6d+152)) then
        tmp = -d * sqrt((1.0d0 / (h * l)))
    else if (d <= (-2.4d-53)) then
        tmp = sqrt(-(d * (d / l))) / sqrt(-h)
    else if (d <= (-4d-310)) then
        tmp = (d_1 * (d_1 * ((m * m) / d))) * (t_0 * 0.125d0)
    else if (d <= 3.5d-223) then
        tmp = t_0 * ((d_1 * d_1) * (((m * m) * (-0.125d0)) / d))
    else if (d <= 4.6d+210) then
        tmp = (d / sqrt((h * l))) * (1.0d0 - (h * (((m * d_1) * (m * (d_1 * 0.5d0))) / ((d * 2.0d0) * (l * (d * 2.0d0))))))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h / (l * (l * l))));
	double tmp;
	if (d <= -4.6e+152) {
		tmp = -d * Math.sqrt((1.0 / (h * l)));
	} else if (d <= -2.4e-53) {
		tmp = Math.sqrt(-(d * (d / l))) / Math.sqrt(-h);
	} else if (d <= -4e-310) {
		tmp = (D * (D * ((M * M) / d))) * (t_0 * 0.125);
	} else if (d <= 3.5e-223) {
		tmp = t_0 * ((D * D) * (((M * M) * -0.125) / d));
	} else if (d <= 4.6e+210) {
		tmp = (d / Math.sqrt((h * l))) * (1.0 - (h * (((M * D) * (M * (D * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((h / (l * (l * l))))
	tmp = 0
	if d <= -4.6e+152:
		tmp = -d * math.sqrt((1.0 / (h * l)))
	elif d <= -2.4e-53:
		tmp = math.sqrt(-(d * (d / l))) / math.sqrt(-h)
	elif d <= -4e-310:
		tmp = (D * (D * ((M * M) / d))) * (t_0 * 0.125)
	elif d <= 3.5e-223:
		tmp = t_0 * ((D * D) * (((M * M) * -0.125) / d))
	elif d <= 4.6e+210:
		tmp = (d / math.sqrt((h * l))) * (1.0 - (h * (((M * D) * (M * (D * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h / Float64(l * Float64(l * l))))
	tmp = 0.0
	if (d <= -4.6e+152)
		tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l))));
	elseif (d <= -2.4e-53)
		tmp = Float64(sqrt(Float64(-Float64(d * Float64(d / l)))) / sqrt(Float64(-h)));
	elseif (d <= -4e-310)
		tmp = Float64(Float64(D * Float64(D * Float64(Float64(M * M) / d))) * Float64(t_0 * 0.125));
	elseif (d <= 3.5e-223)
		tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(Float64(M * M) * -0.125) / d)));
	elseif (d <= 4.6e+210)
		tmp = Float64(Float64(d / sqrt(Float64(h * l))) * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(M * Float64(D * 0.5))) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h / (l * (l * l))));
	tmp = 0.0;
	if (d <= -4.6e+152)
		tmp = -d * sqrt((1.0 / (h * l)));
	elseif (d <= -2.4e-53)
		tmp = sqrt(-(d * (d / l))) / sqrt(-h);
	elseif (d <= -4e-310)
		tmp = (D * (D * ((M * M) / d))) * (t_0 * 0.125);
	elseif (d <= 3.5e-223)
		tmp = t_0 * ((D * D) * (((M * M) * -0.125) / d));
	elseif (d <= 4.6e+210)
		tmp = (d / sqrt((h * l))) * (1.0 - (h * (((M * D) * (M * (D * 0.5))) / ((d * 2.0) * (l * (d * 2.0))))));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -4.6e+152], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.4e-53], N[(N[Sqrt[(-N[(d * N[(d / l), $MachinePrecision]), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(N[(D * N[(D * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * 0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.5e-223], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.6e+210], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -4.6 \cdot 10^{+152}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -2.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{\ell}}}{\sqrt{-h}}\\

\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(t\_0 \cdot 0.125\right)\\

\mathbf{elif}\;d \leq 3.5 \cdot 10^{-223}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)\\

\mathbf{elif}\;d \leq 4.6 \cdot 10^{+210}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -4.5999999999999997e152

    1. Initial program 67.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      2. unpow2N/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. rem-square-sqrtN/A

        \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-1 \cdot d\right)} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      7. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-1 \cdot d\right) \]
      9. mul-1-negN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \]
      10. lower-neg.f6472.1

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(-d\right)} \]
    5. Simplified72.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)} \]

    if -4.5999999999999997e152 < d < -2.40000000000000007e-53

    1. Initial program 74.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f646.6

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified6.6%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f646.6

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr6.6%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{\color{blue}{d \cdot d}}{h \cdot \ell}} \]
      7. lift-*.f64N/A

        \[\leadsto \sqrt{\frac{d \cdot d}{\color{blue}{h \cdot \ell}}} \]
      8. times-fracN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h} \cdot \frac{d}{\ell}}} \]
      9. frac-2negN/A

        \[\leadsto \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}} \cdot \frac{d}{\ell}} \]
      10. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)} \cdot \color{blue}{\frac{d}{\ell}}} \]
      11. associate-*l/N/A

        \[\leadsto \sqrt{\color{blue}{\frac{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}{\mathsf{neg}\left(h\right)}}} \]
      12. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}}} \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}}} \]
      14. lower-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}}{\sqrt{\mathsf{neg}\left(h\right)}} \]
      15. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}}{\sqrt{\mathsf{neg}\left(h\right)}} \]
      16. lower-neg.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \frac{d}{\ell}}}{\sqrt{\mathsf{neg}\left(h\right)}} \]
      17. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{d}{\ell}}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \]
      18. lower-neg.f6469.1

        \[\leadsto \frac{\sqrt{\left(-d\right) \cdot \frac{d}{\ell}}}{\sqrt{\color{blue}{-h}}} \]
    9. Applied egg-rr69.1%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(-d\right) \cdot \frac{d}{\ell}}}{\sqrt{-h}}} \]

    if -2.40000000000000007e-53 < d < -3.999999999999988e-310

    1. Initial program 33.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr25.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in h around -inf

      \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{\ell} \cdot \sqrt{\frac{h}{{d}^{3}}}\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{\ell} \cdot \sqrt{\frac{h}{{d}^{3}}}\right) \cdot \frac{-1}{8}}}{\sqrt{\frac{\ell}{d}}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{h}{{d}^{3}}}}{\ell}} \cdot \frac{-1}{8}}{\sqrt{\frac{\ell}{d}}} \]
      3. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{\left(\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{h}{{d}^{3}}}\right) \cdot \frac{-1}{8}}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
      4. associate-/l*N/A

        \[\leadsto \frac{\color{blue}{\left(\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{h}{{d}^{3}}}\right) \cdot \frac{\frac{-1}{8}}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right) \cdot \sqrt{\frac{h}{{d}^{3}}}\right) \cdot \frac{\frac{-1}{8}}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified40.7%

      \[\leadsto \frac{\color{blue}{\left(\left(M \cdot \left(-M\right)\right) \cdot \left(\left(D \cdot D\right) \cdot \sqrt{\frac{h}{d \cdot \left(d \cdot d\right)}}\right)\right) \cdot \frac{-0.125}{\ell}}}{\sqrt{\frac{\ell}{d}}} \]
    7. Taylor expanded in M around 0

      \[\leadsto \color{blue}{\frac{1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{1}{8}} \]
      2. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right)} \]
      4. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(D \cdot D\right)} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      5. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{D \cdot \left(D \cdot {M}^{2}\right)}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{\left(D \cdot \frac{D \cdot {M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(D \cdot \frac{D \cdot {M}^{2}}{d}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      8. associate-*r/N/A

        \[\leadsto \left(D \cdot \color{blue}{\left(D \cdot \frac{{M}^{2}}{d}\right)}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(D \cdot \color{blue}{\left(D \cdot \frac{{M}^{2}}{d}\right)}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      10. lower-/.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \color{blue}{\frac{{M}^{2}}{d}}\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      11. unpow2N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{\color{blue}{M \cdot M}}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{\color{blue}{M \cdot M}}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \color{blue}{\left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{1}{8}\right)} \]
      14. lower-sqrt.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \frac{1}{8}\right) \]
      15. lower-/.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \frac{1}{8}\right) \]
      16. cube-multN/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \frac{1}{8}\right) \]
      17. unpow2N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \frac{1}{8}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \frac{1}{8}\right) \]
      19. unpow2N/A

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \frac{1}{8}\right) \]
      20. lower-*.f6438.1

        \[\leadsto \left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot 0.125\right) \]
    9. Simplified38.1%

      \[\leadsto \color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot 0.125\right)} \]

    if -3.999999999999988e-310 < d < 3.50000000000000009e-223

    1. Initial program 34.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around 0

      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right)} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      5. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{h}{{\ell}^{3}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      6. cube-multN/A

        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot \left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      7. unpow2N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{{\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{h}{\color{blue}{\ell \cdot {\ell}^{2}}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      9. unpow2N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \]
      11. associate-*r/N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot {M}^{2}\right)}{d}} \]
      12. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left({M}^{2} \cdot {D}^{2}\right)}}{d} \]
      13. associate-*r*N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot {M}^{2}\right) \cdot {D}^{2}}}{d} \]
      14. *-commutativeN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{\color{blue}{{D}^{2} \cdot \left(\frac{-1}{8} \cdot {M}^{2}\right)}}{d} \]
      15. associate-*r/N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \frac{\frac{-1}{8} \cdot {M}^{2}}{d}\right)} \]
      16. associate-*r/N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right)} \]
      18. unpow2N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
      19. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left(\frac{-1}{8} \cdot \frac{{M}^{2}}{d}\right)\right) \]
      20. associate-*r/N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
      21. lower-/.f64N/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-1}{8} \cdot {M}^{2}}{d}}\right) \]
    5. Simplified57.7%

      \[\leadsto \color{blue}{\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)} \]

    if 3.50000000000000009e-223 < d < 4.5999999999999998e210

    1. Initial program 69.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\color{blue}{\frac{1}{2}} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\color{blue}{M \cdot D}}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{\color{blue}{2 \cdot d}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \frac{h}{\ell}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
      7. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      8. un-div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. lift-pow.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell \cdot \frac{1}{h}}\right) \]
      12. unpow2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{1}{2} \cdot \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)}}{\ell \cdot \frac{1}{h}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\ell \cdot \frac{1}{h}}\right) \]
      14. times-fracN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr71.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\color{blue}{\left(\frac{d}{\ell}\right)}}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      2. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      3. unpow1/2N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot \frac{1}{2}\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. lower-sqrt.f6471.9

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr71.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    7. Applied egg-rr73.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 - \frac{\left(M \cdot \left(D \cdot 0.5\right)\right) \cdot \left(M \cdot D\right)}{\left(\left(d \cdot 2\right) \cdot \ell\right) \cdot \left(d \cdot 2\right)} \cdot h\right)} \]

    if 4.5999999999999998e210 < d

    1. Initial program 65.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6465.4

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified65.4%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6465.3

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr65.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. lower-sqrt.f6488.0

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr88.0%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification65.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{\ell}}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot 0.125\right)\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{-223}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot -0.125}{d}\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+210}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(D \cdot 0.5\right)\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 48.9% accurate, 7.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-201}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -5.2e-201)
   (fabs (/ d (sqrt (* h l))))
   (if (<= l -2e-310)
     (/ d (sqrt (sqrt (* h (* l (* h l))))))
     (/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -5.2e-201) {
		tmp = fabs((d / sqrt((h * l))));
	} else if (l <= -2e-310) {
		tmp = d / sqrt(sqrt((h * (l * (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 <= (-5.2d-201)) then
        tmp = abs((d / sqrt((h * l))))
    else if (l <= (-2d-310)) then
        tmp = d / sqrt(sqrt((h * (l * (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 <= -5.2e-201) {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	} else if (l <= -2e-310) {
		tmp = d / Math.sqrt(Math.sqrt((h * (l * (h * l)))));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -5.2e-201:
		tmp = math.fabs((d / math.sqrt((h * l))))
	elif l <= -2e-310:
		tmp = d / math.sqrt(math.sqrt((h * (l * (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 <= -5.2e-201)
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	elseif (l <= -2e-310)
		tmp = Float64(d / sqrt(sqrt(Float64(h * Float64(l * 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 <= -5.2e-201)
		tmp = abs((d / sqrt((h * l))));
	elseif (l <= -2e-310)
		tmp = d / sqrt(sqrt((h * (l * (h * l)))));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-201], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -2e-310], N[(d / N[Sqrt[N[Sqrt[N[(h * N[(l * N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-201}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

\mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -5.19999999999999965e-201

    1. Initial program 54.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f643.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified3.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f643.3

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr3.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6427.7

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6449.0

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr49.0%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if -5.19999999999999965e-201 < l < -1.999999999999994e-310

    1. Initial program 65.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6428.0

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified28.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6423.8

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr23.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. lift-*.f6423.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}} \]
      3. sqrt-unprodN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{\left(h \cdot \ell\right)} \cdot \left(h \cdot \ell\right)}}} \]
      6. associate-*l*N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{d}{\sqrt{\sqrt{\color{blue}{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
      8. lower-*.f6448.7

        \[\leadsto \frac{d}{\sqrt{\sqrt{h \cdot \color{blue}{\left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]
    9. Applied egg-rr48.7%

      \[\leadsto \frac{d}{\sqrt{\color{blue}{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}}} \]

    if -1.999999999999994e-310 < l

    1. Initial program 62.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6443.7

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified43.7%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6443.7

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr43.7%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. lower-sqrt.f6453.1

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr53.1%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 26: 46.9% accurate, 8.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{-201}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-308}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -4.8e-201)
   (fabs (/ d (sqrt (* h l))))
   (if (<= l 1.8e-308)
     (* d (sqrt (/ 1.0 (* h l))))
     (/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -4.8e-201) {
		tmp = fabs((d / sqrt((h * l))));
	} else if (l <= 1.8e-308) {
		tmp = d * sqrt((1.0 / (h * l)));
	} else {
		tmp = d / (sqrt(l) * sqrt(h));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-4.8d-201)) then
        tmp = abs((d / sqrt((h * l))))
    else if (l <= 1.8d-308) then
        tmp = d * sqrt((1.0d0 / (h * l)))
    else
        tmp = d / (sqrt(l) * sqrt(h))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -4.8e-201) {
		tmp = Math.abs((d / Math.sqrt((h * l))));
	} else if (l <= 1.8e-308) {
		tmp = d * Math.sqrt((1.0 / (h * l)));
	} else {
		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -4.8e-201:
		tmp = math.fabs((d / math.sqrt((h * l))))
	elif l <= 1.8e-308:
		tmp = d * math.sqrt((1.0 / (h * l)))
	else:
		tmp = d / (math.sqrt(l) * math.sqrt(h))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -4.8e-201)
		tmp = abs(Float64(d / sqrt(Float64(h * l))));
	elseif (l <= 1.8e-308)
		tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -4.8e-201)
		tmp = abs((d / sqrt((h * l))));
	elseif (l <= 1.8e-308)
		tmp = d * sqrt((1.0 / (h * l)));
	else
		tmp = d / (sqrt(l) * sqrt(h));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.8e-201], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.8e-308], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{-201}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

\mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-308}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -4.80000000000000018e-201

    1. Initial program 54.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f643.3

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified3.3%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f643.3

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr3.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \]
      5. sqrt-divN/A

        \[\leadsto \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      7. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      8. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]
      9. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      10. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      11. lower-fabs.f6427.7

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      12. lift-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      13. lift-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}\right| \]
      14. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      15. lift-sqrt.f64N/A

        \[\leadsto \left|\frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      16. lift-*.f64N/A

        \[\leadsto \left|\frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}}\right| \]
      17. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      18. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      19. lift-/.f6449.0

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
    9. Applied egg-rr49.0%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if -4.80000000000000018e-201 < l < 1.7999999999999999e-308

    1. Initial program 62.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6431.0

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified31.0%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]

    if 1.7999999999999999e-308 < l

    1. Initial program 63.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
      3. lower-/.f64N/A

        \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
      4. lower-*.f6443.2

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    5. Simplified43.2%

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. lower-sqrt.f6443.2

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. Applied egg-rr43.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. lower-sqrt.f6452.8

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr52.8%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 27: 27.2% accurate, 15.3× speedup?

\[\begin{array}{l} \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
	return d / sqrt((h * l));
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D):
	return d / math.sqrt((h * l))
function code(d, h, l, M, D)
	return Float64(d / sqrt(Float64(h * l)))
end
function tmp = code(d, h, l, M, D)
	tmp = d / sqrt((h * l));
end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Derivation
  1. Initial program 59.5%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto d \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
    3. lower-/.f64N/A

      \[\leadsto d \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
    4. lower-*.f6426.2

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
  5. Simplified26.2%

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto d \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \]
    2. sqrt-divN/A

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
    3. metadata-evalN/A

      \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
    4. un-div-invN/A

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    5. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    6. lower-sqrt.f6425.8

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
  7. Applied egg-rr25.8%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024200 
(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)))))