Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.7% → 76.8%
Time: 27.4s
Alternatives: 22
Speedup: 0.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 22 alternatives:

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

Initial Program: 66.7% accurate, 1.0× speedup?

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

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

Alternative 1: 76.8% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 5.00000000000000016e285

    1. Initial program 86.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. Step-by-step derivation
      1. metadata-eval86.8%

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

        \[\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) \]
      3. metadata-eval86.8%

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000016e285 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l))))

    1. Initial program 22.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. Taylor expanded in d around inf 28.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity28.8%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative28.8%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    7. Step-by-step derivation
      1. add-sqr-sqrt28.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left|d \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right|} \]
      3. sqr-pow57.4%

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}}}\right| \]
      4. rem-sqrt-square57.4%

        \[\leadsto \left|d \cdot \color{blue}{\left|{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right|}\right| \]
      5. metadata-eval57.4%

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

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

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

Alternative 2: 66.0% accurate, 1.0× speedup?

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

\\
\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)
\end{array}
Derivation
  1. Initial program 67.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. Step-by-step derivation
    1. associate-*l*67.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 61.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \left(t_0 \cdot t_1\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{if}\;d \leq -2.1 \cdot 10^{+156}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{\frac{\ell}{h \cdot M}} \cdot 0.25\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{+70}:\\ \;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\ \mathbf{elif}\;d \leq -4.5 \cdot 10^{-155}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 5.7 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+178}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ d h)))
        (t_1 (sqrt (/ d l)))
        (t_2
         (*
          (* t_0 t_1)
          (- 1.0 (* 0.125 (/ (* (* h M) (* D (* M D))) (* l (* d d))))))))
   (if (<= d -2.1e+156)
     (*
      t_0
      (*
       t_1
       (- 1.0 (* 0.5 (* (* (/ D d) (/ D d)) (* (/ M (/ l (* h M))) 0.25))))))
     (if (<= d -6.5e+70)
       (* (fabs (pow (* h l) -0.5)) (fabs d))
       (if (<= d -4.5e-155)
         t_2
         (if (<= d -5e-310)
           (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
           (if (<= d 5.1e-163)
             (* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
             (if (<= d 5.7e+88)
               t_2
               (if (<= d 8e+178)
                 (*
                  (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
                  (sqrt (/ (* d (/ d h)) l)))
                 (* d (* (pow h -0.5) (pow l -0.5))))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((d / h));
	double t_1 = sqrt((d / l));
	double t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
	double tmp;
	if (d <= -2.1e+156) {
		tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25)))));
	} else if (d <= -6.5e+70) {
		tmp = fabs(pow((h * l), -0.5)) * fabs(d);
	} else if (d <= -4.5e-155) {
		tmp = t_2;
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 5.1e-163) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
	} else if (d <= 5.7e+88) {
		tmp = t_2;
	} else if (d <= 8e+178) {
		tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((d / h));
	double t_1 = Math.sqrt((d / l));
	double t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
	double tmp;
	if (d <= -2.1e+156) {
		tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25)))));
	} else if (d <= -6.5e+70) {
		tmp = Math.abs(Math.pow((h * l), -0.5)) * Math.abs(d);
	} else if (d <= -4.5e-155) {
		tmp = t_2;
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 5.1e-163) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else if (d <= 5.7e+88) {
		tmp = t_2;
	} else if (d <= 8e+178) {
		tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((d / h))
	t_1 = math.sqrt((d / l))
	t_2 = (t_0 * t_1) * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))))
	tmp = 0
	if d <= -2.1e+156:
		tmp = t_0 * (t_1 * (1.0 - (0.5 * (((D / d) * (D / d)) * ((M / (l / (h * M))) * 0.25)))))
	elif d <= -6.5e+70:
		tmp = math.fabs(math.pow((h * l), -0.5)) * math.fabs(d)
	elif d <= -4.5e-155:
		tmp = t_2
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 5.1e-163:
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * math.sqrt((h / math.pow(l, 3.0))))
	elif d <= 5.7e+88:
		tmp = t_2
	elif d <= 8e+178:
		tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l))
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(d / h))
	t_1 = sqrt(Float64(d / l))
	t_2 = Float64(Float64(t_0 * t_1) * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) * Float64(D * Float64(M * D))) / Float64(l * Float64(d * d))))))
	tmp = 0.0
	if (d <= -2.1e+156)
		tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(0.5 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(M / Float64(l / Float64(h * M))) * 0.25))))));
	elseif (d <= -6.5e+70)
		tmp = Float64(abs((Float64(h * l) ^ -0.5)) * abs(d));
	elseif (d <= -4.5e-155)
		tmp = t_2;
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 5.1e-163)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0)))));
	elseif (d <= 5.7e+88)
		tmp = t_2;
	elseif (d <= 8e+178)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l)));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.1e+156], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M / N[(l / N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.5e+70], N[(N[Abs[N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]], $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.5e-155], t$95$2, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.1e-163], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.7e+88], t$95$2, If[LessEqual[d, 8e+178], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \left(t_0 \cdot t_1\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\
\mathbf{if}\;d \leq -2.1 \cdot 10^{+156}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{\frac{\ell}{h \cdot M}} \cdot 0.25\right)\right)\right)\right)\\

\mathbf{elif}\;d \leq -6.5 \cdot 10^{+70}:\\
\;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\

\mathbf{elif}\;d \leq -4.5 \cdot 10^{-155}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

\mathbf{elif}\;d \leq 5.7 \cdot 10^{+88}:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if d < -2.09999999999999981e156

    1. Initial program 85.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. Step-by-step derivation
      1. associate-*l*85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999981e156 < d < -6.49999999999999978e70

    1. Initial program 49.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. Taylor expanded in d around inf 15.2%

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

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative15.2%

        \[\leadsto \sqrt{1 \cdot \frac{1}{\color{blue}{h \cdot \ell}}} \cdot d \]
    4. Applied egg-rr15.2%

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

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

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

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    7. Step-by-step derivation
      1. add-sqr-sqrt0.3%

        \[\leadsto \color{blue}{\sqrt{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot d} \cdot \sqrt{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot d}} \]
      2. sqrt-unprod35.8%

        \[\leadsto \color{blue}{\sqrt{\left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot d\right) \cdot \left(\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot d\right)}} \]
      3. pow235.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(d \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot \left(d \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right)}} \]
      2. rem-sqrt-square71.6%

        \[\leadsto \color{blue}{\left|d \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right|} \]
      3. sqr-pow71.5%

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}}}\right| \]
      4. rem-sqrt-square71.5%

        \[\leadsto \left|d \cdot \color{blue}{\left|{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right|}\right| \]
      5. metadata-eval71.5%

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

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

    if -6.49999999999999978e70 < d < -4.5000000000000004e-155 or 5.0999999999999999e-163 < d < 5.70000000000000021e88

    1. Initial program 79.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. Step-by-step derivation
      1. metadata-eval79.4%

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

        \[\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) \]
      3. metadata-eval79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(M \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      9. associate-*r*79.6%

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

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

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

    if -4.5000000000000004e-155 < d < -4.999999999999985e-310

    1. Initial program 32.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. Taylor expanded in d around inf 14.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.4%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative14.4%

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity14.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-114.4%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow14.4%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow14.4%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr14.4%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow14.4%

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified14.4%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 8.2%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u33.3%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef33.3%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr49.3%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 5.0999999999999999e-163

    1. Initial program 33.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. Step-by-step derivation
      1. metadata-eval33.3%

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

        \[\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) \]
      3. metadata-eval33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\left(\color{blue}{\left(D \cdot D\right)} \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      4. associate-*l*40.5%

        \[\leadsto -0.125 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right)} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      5. associate-/l*48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      6. associate-/r/48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot M\right)}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
    8. Simplified48.9%

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

    if 5.70000000000000021e88 < d < 8.0000000000000004e178

    1. Initial program 94.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. Step-by-step derivation
      1. metadata-eval94.8%

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

        \[\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) \]
      3. metadata-eval94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{h}} \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) \]
      8. pow199.6%

        \[\leadsto \color{blue}{{\left(\left(\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)\right)}^{1}} \]
    7. Applied egg-rr90.3%

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

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

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

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

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

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

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

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

    if 8.0000000000000004e178 < d

    1. Initial program 69.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. Taylor expanded in d around inf 71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity71.7%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity71.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-171.7%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow71.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow71.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr71.6%

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

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified71.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 7 regimes into one program.
  4. Final simplification73.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.1 \cdot 10^{+156}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{\frac{\ell}{h \cdot M}} \cdot 0.25\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{+70}:\\ \;\;\;\;\left|{\left(h \cdot \ell\right)}^{-0.5}\right| \cdot \left|d\right|\\ \mathbf{elif}\;d \leq -4.5 \cdot 10^{-155}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 5.7 \cdot 10^{+88}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+178}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 4: 55.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{if}\;d \leq -1.46 \cdot 10^{-112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.75 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{elif}\;d \leq 2400000 \lor \neg \left(d \leq 7.2 \cdot 10^{+84}\right) \land d \leq 10^{+178}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
          (sqrt (/ (* d (/ d h)) l)))))
   (if (<= d -1.46e-112)
     t_0
     (if (<= d -5e-310)
       (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
       (if (<= d 1.75e-93)
         (* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
         (if (or (<= d 2400000.0) (and (not (<= d 7.2e+84)) (<= d 1e+178)))
           t_0
           (* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
	double tmp;
	if (d <= -1.46e-112) {
		tmp = t_0;
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.75e-93) {
		tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else if ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178))) {
		tmp = t_0;
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
	double tmp;
	if (d <= -1.46e-112) {
		tmp = t_0;
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.75e-93) {
		tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else if ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178))) {
		tmp = t_0;
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l))
	tmp = 0
	if d <= -1.46e-112:
		tmp = t_0
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 1.75e-93:
		tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))))
	elif (d <= 2400000.0) or (not (d <= 7.2e+84) and (d <= 1e+178)):
		tmp = t_0
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l)))
	tmp = 0.0
	if (d <= -1.46e-112)
		tmp = t_0;
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 1.75e-93)
		tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D))))));
	elseif ((d <= 2400000.0) || (!(d <= 7.2e+84) && (d <= 1e+178)))
		tmp = t_0;
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.46e-112], t$95$0, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.75e-93], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[d, 2400000.0], And[N[Not[LessEqual[d, 7.2e+84]], $MachinePrecision], LessEqual[d, 1e+178]]], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 1.75 \cdot 10^{-93}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\

\mathbf{elif}\;d \leq 2400000 \lor \neg \left(d \leq 7.2 \cdot 10^{+84}\right) \land d \leq 10^{+178}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.46000000000000002e-112 or 1.75e-93 < d < 2.4e6 or 7.1999999999999999e84 < d < 1.0000000000000001e178

    1. Initial program 77.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. Step-by-step derivation
      1. metadata-eval77.5%

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

        \[\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) \]
      3. metadata-eval77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{h}} \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) \]
      8. pow134.5%

        \[\leadsto \color{blue}{{\left(\left(\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)\right)}^{1}} \]
    7. Applied egg-rr71.0%

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

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

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

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

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

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

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

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

    if -1.46000000000000002e-112 < d < -4.999999999999985e-310

    1. Initial program 43.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. Taylor expanded in d around inf 11.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity11.3%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity11.3%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-111.3%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow11.3%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow11.3%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr11.3%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow11.3%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval11.3%

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

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.8%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u27.2%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef27.2%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr47.9%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 1.75e-93

    1. Initial program 54.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. Taylor expanded in d around 0 43.0%

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

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

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

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

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\frac{-0.125}{\frac{d}{{D}^{2} \cdot {M}^{2}}}} \]
      5. unpow243.0%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-0.125}{\frac{d}{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}} \]
      6. associate-*r*48.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{h}}{\sqrt{{\ell}^{3}}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
    7. Step-by-step derivation
      1. sqr-pow53.8%

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

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{\left|{\ell}^{\left(\frac{3}{2}\right)}\right|}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      3. sqr-pow56.3%

        \[\leadsto \frac{\sqrt{h}}{\left|\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}\right|} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      4. fabs-sqr56.3%

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      5. sqr-pow56.4%

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

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

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

    if 2.4e6 < d < 7.1999999999999999e84 or 1.0000000000000001e178 < d

    1. Initial program 74.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. Taylor expanded in d around inf 63.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-163.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow63.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow63.0%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr63.0%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow63.2%

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified63.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.46 \cdot 10^{-112}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.75 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{elif}\;d \leq 2400000 \lor \neg \left(d \leq 7.2 \cdot 10^{+84}\right) \land d \leq 10^{+178}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 5: 60.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -2.9 \cdot 10^{-153}:\\ \;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.55 \cdot 10^{-91}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{elif}\;d \leq 1.08 \cdot 10^{+86}:\\ \;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\frac{D}{\ell} \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+189}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (sqrt (/ d h)) (sqrt (/ d l)))))
   (if (<= d -2.9e-153)
     (* t_0 (- 1.0 (* 0.125 (* (* M (/ M d)) (* (/ h d) (* D (/ D l)))))))
     (if (<= d -5e-310)
       (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
       (if (<= d 1.55e-91)
         (* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
         (if (<= d 1.08e+86)
           (*
            t_0
            (- 1.0 (* 0.125 (* (/ D l) (/ (* D (* M M)) (/ (* d d) h))))))
           (if (<= d 7.2e+189)
             (*
              (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
              (sqrt (/ (* d (/ d h)) l)))
             (* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((d / h)) * sqrt((d / l));
	double tmp;
	if (d <= -2.9e-153) {
		tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.55e-91) {
		tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else if (d <= 1.08e+86) {
		tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h)))));
	} else if (d <= 7.2e+189) {
		tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((d / h)) * Math.sqrt((d / l));
	double tmp;
	if (d <= -2.9e-153) {
		tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.55e-91) {
		tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else if (d <= 1.08e+86) {
		tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h)))));
	} else if (d <= 7.2e+189) {
		tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((d / h)) * math.sqrt((d / l))
	tmp = 0
	if d <= -2.9e-153:
		tmp = t_0 * (1.0 - (0.125 * ((M * (M / d)) * ((h / d) * (D * (D / l))))))
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 1.55e-91:
		tmp = (math.sqrt(h) / math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))))
	elif d <= 1.08e+86:
		tmp = t_0 * (1.0 - (0.125 * ((D / l) * ((D * (M * M)) / ((d * d) / h)))))
	elif d <= 7.2e+189:
		tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l))
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))
	tmp = 0.0
	if (d <= -2.9e-153)
		tmp = Float64(t_0 * Float64(1.0 - Float64(0.125 * Float64(Float64(M * Float64(M / d)) * Float64(Float64(h / d) * Float64(D * Float64(D / l)))))));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 1.55e-91)
		tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D))))));
	elseif (d <= 1.08e+86)
		tmp = Float64(t_0 * Float64(1.0 - Float64(0.125 * Float64(Float64(D / l) * Float64(Float64(D * Float64(M * M)) / Float64(Float64(d * d) / h))))));
	elseif (d <= 7.2e+189)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l)));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	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]}, If[LessEqual[d, -2.9e-153], N[(t$95$0 * N[(1.0 - N[(0.125 * N[(N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.55e-91], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.08e+86], N[(t$95$0 * N[(1.0 - N[(0.125 * N[(N[(D / l), $MachinePrecision] * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.2e+189], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -2.9 \cdot 10^{-153}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 1.55 \cdot 10^{-91}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\

\mathbf{elif}\;d \leq 1.08 \cdot 10^{+86}:\\
\;\;\;\;t_0 \cdot \left(1 - 0.125 \cdot \left(\frac{D}{\ell} \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{h}}\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -2.90000000000000002e-153

    1. Initial program 72.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. Step-by-step derivation
      1. metadata-eval72.4%

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

        \[\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) \]
      3. metadata-eval72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{\ell} \cdot D\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{d} \cdot \frac{h}{d}\right)\right)\right) \]
      13. associate-/r/61.1%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\left(\frac{M \cdot M}{d} \cdot \frac{h}{d}\right) \cdot \frac{D}{\frac{\ell}{D}}\right)}\right) \]
      15. associate-*l*63.2%

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

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

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

    if -2.90000000000000002e-153 < d < -4.999999999999985e-310

    1. Initial program 32.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. Taylor expanded in d around inf 14.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.4%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative14.4%

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity14.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-114.4%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow14.4%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow14.4%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr14.4%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow14.4%

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified14.4%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 8.2%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u33.3%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef33.3%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr49.3%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 1.5499999999999999e-91

    1. Initial program 55.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. Taylor expanded in d around 0 41.9%

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

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

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

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

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\frac{-0.125}{\frac{d}{{D}^{2} \cdot {M}^{2}}}} \]
      5. unpow241.9%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-0.125}{\frac{d}{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}} \]
      6. associate-*r*47.3%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{\left|{\ell}^{\left(\frac{3}{2}\right)}\right|}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      3. sqr-pow54.9%

        \[\leadsto \frac{\sqrt{h}}{\left|\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}\right|} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      4. fabs-sqr54.9%

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

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{3}{2}\right)}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      6. metadata-eval55.0%

        \[\leadsto \frac{\sqrt{h}}{{\ell}^{\color{blue}{1.5}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
    8. Simplified55.0%

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

    if 1.5499999999999999e-91 < d < 1.07999999999999993e86

    1. Initial program 80.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. metadata-eval80.3%

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

        \[\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) \]
      3. metadata-eval80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{\ell} \cdot D\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{d} \cdot \frac{h}{d}\right)\right)\right) \]
      13. associate-/r/65.1%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\left(\frac{M \cdot M}{d} \cdot \frac{h}{d}\right) \cdot \frac{D}{\frac{\ell}{D}}\right)}\right) \]
      15. associate-*l*64.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{\ell} \cdot D\right) \cdot \frac{\color{blue}{\left(M \cdot M\right) \cdot h}}{d \cdot d}\right)\right) \]
      7. associate-*l*74.1%

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

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

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

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

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

    if 1.07999999999999993e86 < d < 7.20000000000000017e189

    1. Initial program 94.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. Step-by-step derivation
      1. metadata-eval94.8%

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

        \[\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) \]
      3. metadata-eval94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{h}} \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) \]
      8. pow199.6%

        \[\leadsto \color{blue}{{\left(\left(\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)\right)}^{1}} \]
    7. Applied egg-rr90.3%

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

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

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

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

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

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

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

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

    if 7.20000000000000017e189 < d

    1. Initial program 69.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. Taylor expanded in d around inf 71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity71.7%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity71.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-171.7%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow71.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow71.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr71.6%

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

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified71.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.9 \cdot 10^{-153}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.55 \cdot 10^{-91}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{elif}\;d \leq 1.08 \cdot 10^{+86}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\frac{D}{\ell} \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+189}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 6: 61.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := M \cdot \frac{M}{d}\\ t_1 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{+85}:\\ \;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{+183}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* M (/ M d))) (t_1 (* (sqrt (/ d h)) (sqrt (/ d l)))))
   (if (<= d -1.45e-155)
     (* t_1 (- 1.0 (* 0.125 (* t_0 (* (/ h d) (* D (/ D l)))))))
     (if (<= d -5e-310)
       (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
       (if (<= d 5.1e-163)
         (* -0.125 (* (* D (* D t_0)) (sqrt (/ h (pow l 3.0)))))
         (if (<= d 3.5e+85)
           (*
            t_1
            (- 1.0 (* 0.125 (/ (* (* h M) (* D (* M D))) (* l (* d d))))))
           (if (<= d 2e+183)
             (*
              (- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0))))
              (sqrt (/ (* d (/ d h)) l)))
             (* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = M * (M / d);
	double t_1 = sqrt((d / h)) * sqrt((d / l));
	double tmp;
	if (d <= -1.45e-155) {
		tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 5.1e-163) {
		tmp = -0.125 * ((D * (D * t_0)) * sqrt((h / pow(l, 3.0))));
	} else if (d <= 3.5e+85) {
		tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
	} else if (d <= 2e+183) {
		tmp = (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))) * sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = M * (M / d);
	double t_1 = Math.sqrt((d / h)) * Math.sqrt((d / l));
	double tmp;
	if (d <= -1.45e-155) {
		tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 5.1e-163) {
		tmp = -0.125 * ((D * (D * t_0)) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else if (d <= 3.5e+85) {
		tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))));
	} else if (d <= 2e+183) {
		tmp = (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))) * Math.sqrt(((d * (d / h)) / l));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = M * (M / d)
	t_1 = math.sqrt((d / h)) * math.sqrt((d / l))
	tmp = 0
	if d <= -1.45e-155:
		tmp = t_1 * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))))
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 5.1e-163:
		tmp = -0.125 * ((D * (D * t_0)) * math.sqrt((h / math.pow(l, 3.0))))
	elif d <= 3.5e+85:
		tmp = t_1 * (1.0 - (0.125 * (((h * M) * (D * (M * D))) / (l * (d * d)))))
	elif d <= 2e+183:
		tmp = (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0)))) * math.sqrt(((d * (d / h)) / l))
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(M * Float64(M / d))
	t_1 = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))
	tmp = 0.0
	if (d <= -1.45e-155)
		tmp = Float64(t_1 * Float64(1.0 - Float64(0.125 * Float64(t_0 * Float64(Float64(h / d) * Float64(D * Float64(D / l)))))));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 5.1e-163)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * t_0)) * sqrt(Float64(h / (l ^ 3.0)))));
	elseif (d <= 3.5e+85)
		tmp = Float64(t_1 * Float64(1.0 - Float64(0.125 * Float64(Float64(Float64(h * M) * Float64(D * Float64(M * D))) / Float64(l * Float64(d * d))))));
	elseif (d <= 2e+183)
		tmp = Float64(Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))) * sqrt(Float64(Float64(d * Float64(d / h)) / l)));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.45e-155], N[(t$95$1 * N[(1.0 - N[(0.125 * N[(t$95$0 * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.1e-163], N[(-0.125 * N[(N[(D * N[(D * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.5e+85], N[(t$95$1 * N[(1.0 - N[(0.125 * N[(N[(N[(h * M), $MachinePrecision] * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2e+183], N[(N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := M \cdot \frac{M}{d}\\
t_1 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -1.45 \cdot 10^{-155}:\\
\;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

\mathbf{elif}\;d \leq 3.5 \cdot 10^{+85}:\\
\;\;\;\;t_1 \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -1.45000000000000005e-155

    1. Initial program 72.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. Step-by-step derivation
      1. metadata-eval72.4%

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

        \[\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) \]
      3. metadata-eval72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{\ell} \cdot D\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{d} \cdot \frac{h}{d}\right)\right)\right) \]
      13. associate-/r/61.1%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\left(\frac{M \cdot M}{d} \cdot \frac{h}{d}\right) \cdot \frac{D}{\frac{\ell}{D}}\right)}\right) \]
      15. associate-*l*63.2%

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

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

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

    if -1.45000000000000005e-155 < d < -4.999999999999985e-310

    1. Initial program 32.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. Taylor expanded in d around inf 14.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.4%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative14.4%

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity14.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-114.4%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow14.4%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow14.4%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr14.4%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow14.4%

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified14.4%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 8.2%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u33.3%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef33.3%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr49.3%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 5.0999999999999999e-163

    1. Initial program 33.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. Step-by-step derivation
      1. metadata-eval33.3%

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

        \[\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) \]
      3. metadata-eval33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\left(\color{blue}{\left(D \cdot D\right)} \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      4. associate-*l*40.5%

        \[\leadsto -0.125 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right)} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      5. associate-/l*48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      6. associate-/r/48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot M\right)}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
    8. Simplified48.9%

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

    if 5.0999999999999999e-163 < d < 3.50000000000000005e85

    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. Step-by-step derivation
      1. metadata-eval82.3%

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

        \[\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) \]
      3. metadata-eval82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(M \cdot \color{blue}{\left(D \cdot D\right)}\right) \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \]
      9. associate-*r*79.2%

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

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

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

    if 3.50000000000000005e85 < d < 1.99999999999999989e183

    1. Initial program 94.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. Step-by-step derivation
      1. metadata-eval94.8%

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

        \[\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) \]
      3. metadata-eval94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{d}}{\sqrt{h}} \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) \]
      8. pow199.6%

        \[\leadsto \color{blue}{{\left(\left(\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)\right)}^{1}} \]
    7. Applied egg-rr90.3%

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

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

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

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

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

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

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

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

    if 1.99999999999999989e183 < d

    1. Initial program 69.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. Taylor expanded in d around inf 71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity71.7%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity71.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-171.7%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow71.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow71.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr71.6%

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

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified71.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 6 regimes into one program.
  4. Final simplification69.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.45 \cdot 10^{-155}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 5.1 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{+85}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{+183}:\\ \;\;\;\;\left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d \cdot \frac{d}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 7: 58.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{-112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.02 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+179}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ (/ M d) 2.0)) 2.0))))
          (sqrt (* (/ d h) (/ d l))))))
   (if (<= d -3.8e-112)
     t_0
     (if (<= d -5e-310)
       (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
       (if (<= d 1.02e-163)
         (* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
         (if (<= d 1.85e+179) t_0 (* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + (-0.5 * ((h / l) * pow((D * ((M / d) / 2.0)), 2.0)))) * sqrt(((d / h) * (d / l)));
	double tmp;
	if (d <= -3.8e-112) {
		tmp = t_0;
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.02e-163) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
	} else if (d <= 1.85e+179) {
		tmp = t_0;
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (1.0 + (-0.5 * ((h / l) * Math.pow((D * ((M / d) / 2.0)), 2.0)))) * Math.sqrt(((d / h) * (d / l)));
	double tmp;
	if (d <= -3.8e-112) {
		tmp = t_0;
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.02e-163) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else if (d <= 1.85e+179) {
		tmp = t_0;
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (1.0 + (-0.5 * ((h / l) * math.pow((D * ((M / d) / 2.0)), 2.0)))) * math.sqrt(((d / h) * (d / l)))
	tmp = 0
	if d <= -3.8e-112:
		tmp = t_0
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 1.02e-163:
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * math.sqrt((h / math.pow(l, 3.0))))
	elif d <= 1.85e+179:
		tmp = t_0
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))) * sqrt(Float64(Float64(d / h) * Float64(d / l))))
	tmp = 0.0
	if (d <= -3.8e-112)
		tmp = t_0;
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 1.02e-163)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0)))));
	elseif (d <= 1.85e+179)
		tmp = t_0;
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.8e-112], t$95$0, If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e-163], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.85e+179], t$95$0, N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 1.02 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

\mathbf{elif}\;d \leq 1.85 \cdot 10^{+179}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -3.79999999999999995e-112 or 1.02000000000000007e-163 < d < 1.85e179

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999995e-112 < d < -4.999999999999985e-310

    1. Initial program 43.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. Taylor expanded in d around inf 11.3%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity11.3%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity11.3%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-111.3%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow11.3%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow11.3%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr11.3%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow11.3%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval11.3%

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

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.8%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u27.2%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef27.2%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr47.9%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 1.02000000000000007e-163

    1. Initial program 33.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. Step-by-step derivation
      1. metadata-eval33.3%

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

        \[\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) \]
      3. metadata-eval33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\left(\color{blue}{\left(D \cdot D\right)} \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      4. associate-*l*40.5%

        \[\leadsto -0.125 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right)} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      5. associate-/l*48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      6. associate-/r/48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot M\right)}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
    8. Simplified48.9%

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

    if 1.85e179 < d

    1. Initial program 69.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. Taylor expanded in d around inf 71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity71.7%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity71.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-171.7%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow71.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow71.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr71.6%

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

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified71.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.8 \cdot 10^{-112}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.02 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+179}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 8: 59.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := M \cdot \frac{M}{d}\\ \mathbf{if}\;d \leq -3.4 \cdot 10^{-157}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.08 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 3.05 \cdot 10^{+178}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* M (/ M d))))
   (if (<= d -3.4e-157)
     (*
      (* (sqrt (/ d h)) (sqrt (/ d l)))
      (- 1.0 (* 0.125 (* t_0 (* (/ h d) (* D (/ D l)))))))
     (if (<= d -5e-310)
       (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
       (if (<= d 1.08e-163)
         (* -0.125 (* (* D (* D t_0)) (sqrt (/ h (pow l 3.0)))))
         (if (<= d 3.05e+178)
           (*
            (+ 1.0 (* -0.5 (* (/ h l) (pow (* D (/ (/ M d) 2.0)) 2.0))))
            (sqrt (* (/ d h) (/ d l))))
           (* d (* (pow h -0.5) (pow l -0.5)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = M * (M / d);
	double tmp;
	if (d <= -3.4e-157) {
		tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.08e-163) {
		tmp = -0.125 * ((D * (D * t_0)) * sqrt((h / pow(l, 3.0))));
	} else if (d <= 3.05e+178) {
		tmp = (1.0 + (-0.5 * ((h / l) * pow((D * ((M / d) / 2.0)), 2.0)))) * sqrt(((d / h) * (d / l)));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = M * (M / d);
	double tmp;
	if (d <= -3.4e-157) {
		tmp = (Math.sqrt((d / h)) * Math.sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.08e-163) {
		tmp = -0.125 * ((D * (D * t_0)) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else if (d <= 3.05e+178) {
		tmp = (1.0 + (-0.5 * ((h / l) * Math.pow((D * ((M / d) / 2.0)), 2.0)))) * Math.sqrt(((d / h) * (d / l)));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = M * (M / d)
	tmp = 0
	if d <= -3.4e-157:
		tmp = (math.sqrt((d / h)) * math.sqrt((d / l))) * (1.0 - (0.125 * (t_0 * ((h / d) * (D * (D / l))))))
	elif d <= -5e-310:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	elif d <= 1.08e-163:
		tmp = -0.125 * ((D * (D * t_0)) * math.sqrt((h / math.pow(l, 3.0))))
	elif d <= 3.05e+178:
		tmp = (1.0 + (-0.5 * ((h / l) * math.pow((D * ((M / d) / 2.0)), 2.0)))) * math.sqrt(((d / h) * (d / l)))
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(M * Float64(M / d))
	tmp = 0.0
	if (d <= -3.4e-157)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(0.125 * Float64(t_0 * Float64(Float64(h / d) * Float64(D * Float64(D / l)))))));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 1.08e-163)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * t_0)) * sqrt(Float64(h / (l ^ 3.0)))));
	elseif (d <= 3.05e+178)
		tmp = Float64(Float64(1.0 + Float64(-0.5 * Float64(Float64(h / l) * (Float64(D * Float64(Float64(M / d) / 2.0)) ^ 2.0)))) * sqrt(Float64(Float64(d / h) * Float64(d / l))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.4e-157], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(0.125 * N[(t$95$0 * N[(N[(h / d), $MachinePrecision] * N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.08e-163], N[(-0.125 * N[(N[(D * N[(D * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.05e+178], N[(N[(1.0 + N[(-0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(N[(M / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := M \cdot \frac{M}{d}\\
\mathbf{if}\;d \leq -3.4 \cdot 10^{-157}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(t_0 \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 1.08 \cdot 10^{-163}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot t_0\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -3.39999999999999977e-157

    1. Initial program 72.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. Step-by-step derivation
      1. metadata-eval72.4%

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

        \[\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) \]
      3. metadata-eval72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(\frac{D}{\ell} \cdot D\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{d} \cdot \frac{h}{d}\right)\right)\right) \]
      13. associate-/r/61.1%

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

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \color{blue}{\left(\left(\frac{M \cdot M}{d} \cdot \frac{h}{d}\right) \cdot \frac{D}{\frac{\ell}{D}}\right)}\right) \]
      15. associate-*l*63.2%

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

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

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

    if -3.39999999999999977e-157 < d < -4.999999999999985e-310

    1. Initial program 32.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. Taylor expanded in d around inf 14.4%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.4%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative14.4%

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity14.4%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-114.4%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow14.4%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow14.4%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr14.4%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow14.4%

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified14.4%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 8.2%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u33.3%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef33.3%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr49.3%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 1.0800000000000001e-163

    1. Initial program 33.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. Step-by-step derivation
      1. metadata-eval33.3%

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

        \[\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) \]
      3. metadata-eval33.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\left(\color{blue}{\left(D \cdot D\right)} \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      4. associate-*l*40.5%

        \[\leadsto -0.125 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right)} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      5. associate-/l*48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      6. associate-/r/48.9%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot M\right)}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
    8. Simplified48.9%

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

    if 1.0800000000000001e-163 < d < 3.05e178

    1. Initial program 85.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. Applied egg-rr19.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.05e178 < d

    1. Initial program 69.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. Taylor expanded in d around inf 71.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity71.7%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity71.7%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-171.7%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow71.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow71.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr71.6%

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

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

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified71.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down81.9%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 5 regimes into one program.
  4. Final simplification65.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.4 \cdot 10^{-157}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.125 \cdot \left(\left(M \cdot \frac{M}{d}\right) \cdot \left(\frac{h}{d} \cdot \left(D \cdot \frac{D}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.08 \cdot 10^{-163}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;d \leq 3.05 \cdot 10^{+178}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 9: 49.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{h \cdot \ell}\\ \mathbf{if}\;d \leq -6 \cdot 10^{-52}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -1.7 \cdot 10^{-71}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-92}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* h l))))
   (if (<= d -6e-52)
     (* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
     (if (<= d -1.7e-71)
       (* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
       (if (<= d -2.1e-94)
         (* (sqrt (/ d h)) (sqrt (/ d l)))
         (if (<= d -5e-310)
           (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
           (if (<= d 1.1e-92)
             (* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
             (* d (* (pow h -0.5) (pow l -0.5))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (h * l);
	double tmp;
	if (d <= -6e-52) {
		tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
	} else if (d <= -1.7e-71) {
		tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
	} else if (d <= -2.1e-94) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.1e-92) {
		tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (h * l);
	double tmp;
	if (d <= -6e-52) {
		tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
	} else if (d <= -1.7e-71) {
		tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
	} else if (d <= -2.1e-94) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 1.1e-92) {
		tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 / Float64(h * l))
	tmp = 0.0
	if (d <= -6e-52)
		tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l)))));
	elseif (d <= -1.7e-71)
		tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0)))));
	elseif (d <= -2.1e-94)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 1.1e-92)
		tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D))))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6e-52], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.7e-71], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.1e-94], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e-92], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;d \leq -6 \cdot 10^{-52}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\

\mathbf{elif}\;d \leq -1.7 \cdot 10^{-71}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\

\mathbf{elif}\;d \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 1.1 \cdot 10^{-92}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -6e-52

    1. Initial program 71.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. Taylor expanded in d around inf 10.7%

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

        \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}} \cdot d \]
      2. *-commutative13.6%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative13.6%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative13.6%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube13.6%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt13.6%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube13.6%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*13.6%

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

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

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

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

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \color{blue}{\frac{-1}{-\ell}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval12.2%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{\color{blue}{-1}}{-\ell}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. mul-1-neg12.2%

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

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot \ell\right) \cdot \left(-1 \cdot \ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      7. mul-1-neg22.2%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\left(-\ell\right)} \cdot \left(-1 \cdot \ell\right)}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. mul-1-neg22.2%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\left(-\ell\right) \cdot \color{blue}{\left(-\ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      9. sqr-neg22.2%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\ell \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      10. sqrt-unprod0.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      11. add-sqr-sqrt47.8%

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

      \[\leadsto \sqrt[3]{\color{blue}{\left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    9. Step-by-step derivation
      1. associate-*r/47.8%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{h} \cdot -1}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      2. associate-*l/47.8%

        \[\leadsto \sqrt[3]{\frac{\color{blue}{\frac{1 \cdot -1}{h}}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval47.8%

        \[\leadsto \sqrt[3]{\frac{\frac{\color{blue}{-1}}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. associate-/l/47.8%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{-1}{\ell \cdot h}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    10. Simplified47.8%

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

    if -6e-52 < d < -1.70000000000000002e-71

    1. Initial program 80.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. Taylor expanded in d around inf 4.3%

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

        \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}}} \cdot d \]
      2. *-commutative81.6%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative81.6%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative81.6%

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

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

    if -1.70000000000000002e-71 < d < -2.1000000000000001e-94

    1. Initial program 59.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. Step-by-step derivation
      1. associate-*l*59.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-94 < d < -4.999999999999985e-310

    1. Initial program 46.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. Taylor expanded in d around inf 12.9%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity12.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative12.9%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-112.9%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow12.9%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow12.9%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr12.9%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow12.9%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval12.9%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified12.9%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.7%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u29.9%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef29.9%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr47.1%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 1.09999999999999994e-92

    1. Initial program 54.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. Taylor expanded in d around 0 43.0%

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

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

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

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

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\frac{-0.125}{\frac{d}{{D}^{2} \cdot {M}^{2}}}} \]
      5. unpow243.0%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-0.125}{\frac{d}{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}} \]
      6. associate-*r*48.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{h}}{\sqrt{{\ell}^{3}}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
    7. Step-by-step derivation
      1. sqr-pow53.8%

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

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{\left|{\ell}^{\left(\frac{3}{2}\right)}\right|}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      3. sqr-pow56.3%

        \[\leadsto \frac{\sqrt{h}}{\left|\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}\right|} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      4. fabs-sqr56.3%

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      5. sqr-pow56.4%

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

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

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

    if 1.09999999999999994e-92 < d

    1. Initial program 80.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity47.8%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity47.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-147.8%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow47.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow47.7%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr47.7%

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

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval47.8%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down64.8%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr64.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6 \cdot 10^{-52}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -1.7 \cdot 10^{-71}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{\frac{1}{h \cdot \ell} \cdot \left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right)}}\\ \mathbf{elif}\;d \leq -2.1 \cdot 10^{-94}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-92}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 10: 48.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -5.5 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 7 \cdot 10^{-93}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -5.5e-93)
   (* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
   (if (<= d -5e-310)
     (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
     (if (<= d 7e-93)
       (* -0.125 (* (* D (* D (* M (/ M d)))) (sqrt (/ h (pow l 3.0)))))
       (* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.5e-93) {
		tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 7e-93) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * sqrt((h / pow(l, 3.0))));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -5.5e-93) {
		tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 7e-93) {
		tmp = -0.125 * ((D * (D * (M * (M / d)))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -5.5e-93)
		tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l)))));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 7e-93)
		tmp = Float64(-0.125 * Float64(Float64(D * Float64(D * Float64(M * Float64(M / d)))) * sqrt(Float64(h / (l ^ 3.0)))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -5.5e-93], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e-93], N[(-0.125 * N[(N[(D * N[(D * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -5.5 \cdot 10^{-93}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 7 \cdot 10^{-93}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -5.49999999999999968e-93

    1. Initial program 71.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube17.4%

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

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative17.4%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative17.4%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube17.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt17.4%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube17.4%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*17.4%

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}} \cdot d \]
    7. Step-by-step derivation
      1. div-inv12.4%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \color{blue}{\frac{-1}{-\ell}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval12.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{\color{blue}{-1}}{-\ell}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. mul-1-neg12.4%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{-1 \cdot \ell} \cdot \sqrt{-1 \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      6. sqrt-unprod21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot \ell\right) \cdot \left(-1 \cdot \ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      7. mul-1-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\left(-\ell\right)} \cdot \left(-1 \cdot \ell\right)}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. mul-1-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\left(-\ell\right) \cdot \color{blue}{\left(-\ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      9. sqr-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\ell \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      10. sqrt-unprod0.0%

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

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

      \[\leadsto \sqrt[3]{\color{blue}{\left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    9. Step-by-step derivation
      1. associate-*r/45.5%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{h} \cdot -1}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      2. associate-*l/45.5%

        \[\leadsto \sqrt[3]{\frac{\color{blue}{\frac{1 \cdot -1}{h}}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval45.5%

        \[\leadsto \sqrt[3]{\frac{\frac{\color{blue}{-1}}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. associate-/l/45.5%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{-1}{\ell \cdot h}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    10. Simplified45.5%

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

    if -5.49999999999999968e-93 < d < -4.999999999999985e-310

    1. Initial program 46.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. Taylor expanded in d around inf 12.9%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity12.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative12.9%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-112.9%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow12.9%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow12.9%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr12.9%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow12.9%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval12.9%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified12.9%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.7%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u29.9%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef29.9%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr47.1%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 7e-93

    1. Initial program 54.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. Step-by-step derivation
      1. metadata-eval54.5%

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

        \[\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) \]
      3. metadata-eval54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\left(\color{blue}{\left(D \cdot D\right)} \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      4. associate-*l*51.1%

        \[\leadsto -0.125 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \frac{M \cdot M}{d}\right)\right)} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      5. associate-/l*56.2%

        \[\leadsto -0.125 \cdot \left(\left(D \cdot \left(D \cdot \color{blue}{\frac{M}{\frac{d}{M}}}\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \]
      6. associate-/r/56.2%

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

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

    if 7e-93 < d

    1. Initial program 80.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity47.8%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity47.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-147.8%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow47.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow47.7%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr47.7%

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

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval47.8%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down64.8%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.5 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 7 \cdot 10^{-93}:\\ \;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot \frac{M}{d}\right)\right)\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 11: 49.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.5 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 9.5 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.5e-93)
   (* d (cbrt (* (/ -1.0 (* h l)) (sqrt (/ (/ 1.0 h) l)))))
   (if (<= d -5e-310)
     (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
     (if (<= d 9.5e-93)
       (* (/ (sqrt h) (pow l 1.5)) (/ -0.125 (/ d (* M (* M (* D D))))))
       (* d (* (pow h -0.5) (pow l -0.5)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.5e-93) {
		tmp = d * cbrt(((-1.0 / (h * l)) * sqrt(((1.0 / h) / l))));
	} else if (d <= -5e-310) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 9.5e-93) {
		tmp = (sqrt(h) / pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.5e-93) {
		tmp = d * Math.cbrt(((-1.0 / (h * l)) * Math.sqrt(((1.0 / h) / l))));
	} else if (d <= -5e-310) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else if (d <= 9.5e-93) {
		tmp = (Math.sqrt(h) / Math.pow(l, 1.5)) * (-0.125 / (d / (M * (M * (D * D)))));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.5e-93)
		tmp = Float64(d * cbrt(Float64(Float64(-1.0 / Float64(h * l)) * sqrt(Float64(Float64(1.0 / h) / l)))));
	elseif (d <= -5e-310)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	elseif (d <= 9.5e-93)
		tmp = Float64(Float64(sqrt(h) / (l ^ 1.5)) * Float64(-0.125 / Float64(d / Float64(M * Float64(M * Float64(D * D))))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.5e-93], N[(d * N[Power[N[(N[(-1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.5e-93], N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d / N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{-93}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;d \leq 9.5 \cdot 10^{-93}:\\
\;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.49999999999999997e-93

    1. Initial program 71.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube17.4%

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

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative17.4%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative17.4%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube17.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt17.4%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube17.4%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*17.4%

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}} \cdot d \]
    7. Step-by-step derivation
      1. div-inv12.4%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \color{blue}{\frac{-1}{-\ell}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval12.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{\color{blue}{-1}}{-\ell}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. mul-1-neg12.4%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{-1 \cdot \ell} \cdot \sqrt{-1 \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      6. sqrt-unprod21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot \ell\right) \cdot \left(-1 \cdot \ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      7. mul-1-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\left(-\ell\right)} \cdot \left(-1 \cdot \ell\right)}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. mul-1-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\left(-\ell\right) \cdot \color{blue}{\left(-\ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      9. sqr-neg21.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\ell \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      10. sqrt-unprod0.0%

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

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

      \[\leadsto \sqrt[3]{\color{blue}{\left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    9. Step-by-step derivation
      1. associate-*r/45.5%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{h} \cdot -1}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      2. associate-*l/45.5%

        \[\leadsto \sqrt[3]{\frac{\color{blue}{\frac{1 \cdot -1}{h}}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval45.5%

        \[\leadsto \sqrt[3]{\frac{\frac{\color{blue}{-1}}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. associate-/l/45.5%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{-1}{\ell \cdot h}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    10. Simplified45.5%

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

    if -2.49999999999999997e-93 < d < -4.999999999999985e-310

    1. Initial program 46.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. Taylor expanded in d around inf 12.9%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity12.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative12.9%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-112.9%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow12.9%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow12.9%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr12.9%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow12.9%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval12.9%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified12.9%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.7%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u29.9%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef29.9%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr47.1%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -4.999999999999985e-310 < d < 9.5000000000000001e-93

    1. Initial program 54.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. Taylor expanded in d around 0 43.0%

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

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

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

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

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \color{blue}{\frac{-0.125}{\frac{d}{{D}^{2} \cdot {M}^{2}}}} \]
      5. unpow243.0%

        \[\leadsto \sqrt{\frac{h}{{\ell}^{3}}} \cdot \frac{-0.125}{\frac{d}{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}} \]
      6. associate-*r*48.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{h}}{\sqrt{{\ell}^{3}}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
    7. Step-by-step derivation
      1. sqr-pow53.8%

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

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{\left|{\ell}^{\left(\frac{3}{2}\right)}\right|}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      3. sqr-pow56.3%

        \[\leadsto \frac{\sqrt{h}}{\left|\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}\right|} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      4. fabs-sqr56.3%

        \[\leadsto \frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}} \cdot \frac{-0.125}{\frac{d}{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}} \]
      5. sqr-pow56.4%

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

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

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

    if 9.5000000000000001e-93 < d

    1. Initial program 80.4%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity47.8%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity47.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-147.8%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow47.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow47.7%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr47.7%

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

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval47.8%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified47.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down64.8%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.5 \cdot 10^{-93}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;d \leq 9.5 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \frac{-0.125}{\frac{d}{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 12: 46.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.9 \cdot 10^{+54}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)}\\

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


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

    1. Initial program 61.0%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity6.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative6.9%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-16.9%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow6.9%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow6.9%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr6.9%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow6.9%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval6.9%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified6.9%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.8%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u23.8%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef23.8%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr57.7%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -1.9000000000000001e54 < h < -1.999999999999994e-310

    1. Initial program 63.1%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube23.4%

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

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative23.4%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative23.4%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube23.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt23.4%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube23.4%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*23.4%

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{\color{blue}{-1}}{-\ell}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. mul-1-neg18.3%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{-1 \cdot \ell} \cdot \sqrt{-1 \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot \ell\right) \cdot \left(-1 \cdot \ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      7. mul-1-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\left(-\ell\right)} \cdot \left(-1 \cdot \ell\right)}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. mul-1-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\left(-\ell\right) \cdot \color{blue}{\left(-\ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      9. sqr-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\ell \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      10. sqrt-unprod0.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      11. add-sqr-sqrt45.8%

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

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

    if -1.999999999999994e-310 < h

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow38.2%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.0%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.9 \cdot 10^{+54}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt[3]{\sqrt{\frac{\frac{1}{h}}{\ell}} \cdot \left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 13: 46.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\

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


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

    1. Initial program 61.0%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity6.9%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative6.9%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-16.9%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow6.9%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow6.9%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr6.9%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow6.9%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval6.9%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified6.9%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.8%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u23.8%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef23.8%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr57.7%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if -1.6e52 < h < -1.999999999999994e-310

    1. Initial program 63.1%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube23.4%

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

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{\color{blue}{h \cdot \ell}} \cdot \frac{1}{\ell \cdot h}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      3. *-commutative23.4%

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative23.4%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube23.4%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt23.4%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube23.4%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*23.4%

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

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

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

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

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

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{\color{blue}{-1}}{-\ell}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. mul-1-neg18.3%

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

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{-1 \cdot \ell} \cdot \sqrt{-1 \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\left(-1 \cdot \ell\right) \cdot \left(-1 \cdot \ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      7. mul-1-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\left(-\ell\right)} \cdot \left(-1 \cdot \ell\right)}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      8. mul-1-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\left(-\ell\right) \cdot \color{blue}{\left(-\ell\right)}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      9. sqr-neg18.4%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\sqrt{\color{blue}{\ell \cdot \ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      10. sqrt-unprod0.0%

        \[\leadsto \sqrt[3]{\left(\frac{1}{h} \cdot \frac{-1}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      11. add-sqr-sqrt45.8%

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

      \[\leadsto \sqrt[3]{\color{blue}{\left(\frac{1}{h} \cdot \frac{-1}{\ell}\right)} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    9. Step-by-step derivation
      1. associate-*r/45.8%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{h} \cdot -1}{\ell}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      2. associate-*l/45.8%

        \[\leadsto \sqrt[3]{\frac{\color{blue}{\frac{1 \cdot -1}{h}}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      3. metadata-eval45.8%

        \[\leadsto \sqrt[3]{\frac{\frac{\color{blue}{-1}}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
      4. associate-/l/45.7%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{-1}{\ell \cdot h}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    10. Simplified45.7%

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

    if -1.999999999999994e-310 < h

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow38.2%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.0%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.6 \cdot 10^{+52}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt[3]{\frac{-1}{h \cdot \ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 14: 47.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.32 \cdot 10^{-94}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-303}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.32e-94)
   (* (sqrt (/ d h)) (sqrt (/ d l)))
   (if (<= d 1.6e-303)
     (* d (exp (* -0.5 (log1p (+ (* l (/ 1.0 h)) -1.0)))))
     (* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.32e-94) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else if (d <= 1.6e-303) {
		tmp = d * exp((-0.5 * log1p(((l * (1.0 / h)) + -1.0))));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.32e-94) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else if (d <= 1.6e-303) {
		tmp = d * Math.exp((-0.5 * Math.log1p(((l * (1.0 / h)) + -1.0))));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -2.32e-94:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	elif d <= 1.6e-303:
		tmp = d * math.exp((-0.5 * math.log1p(((l * (1.0 / h)) + -1.0))))
	else:
		tmp = d * (math.pow(h, -0.5) * math.pow(l, -0.5))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.32e-94)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	elseif (d <= 1.6e-303)
		tmp = Float64(d * exp(Float64(-0.5 * log1p(Float64(Float64(l * Float64(1.0 / h)) + -1.0)))));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.32e-94], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.6e-303], N[(d * N[Exp[N[(-0.5 * N[Log[1 + N[(N[(l * N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;d \leq 1.6 \cdot 10^{-303}:\\
\;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\

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


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

    1. Initial program 71.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*71.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.32000000000000002e-94 < d < 1.59999999999999995e-303

    1. Initial program 45.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity12.5%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-112.5%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow12.5%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow12.5%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr12.5%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow12.5%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval12.5%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified12.5%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 6.4%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. log1p-expm1-u28.6%

        \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)\right)}} \cdot d \]
      2. expm1-udef28.6%

        \[\leadsto e^{-0.5 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)} - 1}\right)} \cdot d \]
    9. Applied egg-rr45.3%

      \[\leadsto e^{-0.5 \cdot \color{blue}{\mathsf{log1p}\left(\ell \cdot \frac{1}{h} - 1\right)}} \cdot d \]

    if 1.59999999999999995e-303 < d

    1. Initial program 73.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. Taylor expanded in d around inf 38.8%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity38.8%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity38.8%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.8%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.8%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.6%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.6%

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

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.8%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.8%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.8%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.8%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.32 \cdot 10^{-94}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-303}:\\ \;\;\;\;d \cdot e^{-0.5 \cdot \mathsf{log1p}\left(\ell \cdot \frac{1}{h} + -1\right)}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 15: 34.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -6.4e-15)
   (* d (pow (/ l h) -0.5))
   (if (<= h -2e-310)
     (* d (cbrt (pow (/ 1.0 (* h l)) 1.5)))
     (* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -6.4e-15) {
		tmp = d * pow((l / h), -0.5);
	} else if (h <= -2e-310) {
		tmp = d * cbrt(pow((1.0 / (h * l)), 1.5));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -6.4e-15) {
		tmp = d * Math.pow((l / h), -0.5);
	} else if (h <= -2e-310) {
		tmp = d * Math.cbrt(Math.pow((1.0 / (h * l)), 1.5));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -6.4e-15)
		tmp = Float64(d * (Float64(l / h) ^ -0.5));
	elseif (h <= -2e-310)
		tmp = Float64(d * cbrt((Float64(1.0 / Float64(h * l)) ^ 1.5)));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -6.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-310], N[(d * N[Power[N[Power[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -6.3999999999999999e-15

    1. Initial program 59.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

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

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

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

    if -6.3999999999999999e-15 < h < -1.999999999999994e-310

    1. Initial program 64.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. Taylor expanded in d around inf 14.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube27.1%

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

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

        \[\leadsto \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{\color{blue}{h \cdot \ell}}\right) \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      4. *-commutative27.1%

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube27.1%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}\right) \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}}} \cdot d \]
      2. add-sqr-sqrt27.1%

        \[\leadsto \sqrt[3]{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      3. add-cbrt-cube27.1%

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*27.1%

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}} \cdot d \]
    7. Step-by-step derivation
      1. expm1-log1p-u20.9%

        \[\leadsto \sqrt[3]{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right)}} \cdot d \]
      2. expm1-udef21.0%

        \[\leadsto \sqrt[3]{\color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} - 1}} \cdot d \]
      3. pow121.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} - 1} \cdot d \]
      4. pow1/221.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{1} \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}}\right)} - 1} \cdot d \]
      5. pow-prod-up21.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{\left(1 + 0.5\right)}}\right)} - 1} \cdot d \]
      6. associate-/l/21.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\color{blue}{\left(\frac{1}{\ell \cdot h}\right)}}^{\left(1 + 0.5\right)}\right)} - 1} \cdot d \]
      7. inv-pow21.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\color{blue}{\left({\left(\ell \cdot h\right)}^{-1}\right)}}^{\left(1 + 0.5\right)}\right)} - 1} \cdot d \]
      8. metadata-eval21.0%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{\color{blue}{1.5}}\right)} - 1} \cdot d \]
    8. Applied egg-rr21.0%

      \[\leadsto \sqrt[3]{\color{blue}{e^{\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}\right)} - 1}} \cdot d \]
    9. Step-by-step derivation
      1. expm1-def20.9%

        \[\leadsto \sqrt[3]{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}\right)\right)}} \cdot d \]
      2. expm1-log1p20.9%

        \[\leadsto \sqrt[3]{\color{blue}{{\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}}} \cdot d \]
      3. unpow-120.9%

        \[\leadsto \sqrt[3]{{\color{blue}{\left(\frac{1}{\ell \cdot h}\right)}}^{1.5}} \cdot d \]
    10. Simplified20.9%

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

    if -1.999999999999994e-310 < h

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow38.2%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.0%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 16: 45.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -9 \cdot 10^{-177}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -9e-177)
   (* (sqrt (/ d h)) (sqrt (/ d l)))
   (if (<= l -5e-311)
     (* d (cbrt (pow (/ 1.0 (* h l)) 1.5)))
     (* d (* (pow h -0.5) (pow l -0.5))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -9e-177) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else if (l <= -5e-311) {
		tmp = d * cbrt(pow((1.0 / (h * l)), 1.5));
	} else {
		tmp = d * (pow(h, -0.5) * pow(l, -0.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -9e-177) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else if (l <= -5e-311) {
		tmp = d * Math.cbrt(Math.pow((1.0 / (h * l)), 1.5));
	} else {
		tmp = d * (Math.pow(h, -0.5) * Math.pow(l, -0.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -9e-177)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	elseif (l <= -5e-311)
		tmp = Float64(d * cbrt((Float64(1.0 / Float64(h * l)) ^ 1.5)));
	else
		tmp = Float64(d * Float64((h ^ -0.5) * (l ^ -0.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -9e-177], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(d * N[Power[N[Power[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[h, -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\

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


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

    1. Initial program 57.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. Step-by-step derivation
      1. associate-*l*57.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000007e-177 < l < -5.00000000000023e-311

    1. Initial program 77.1%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. add-cbrt-cube51.5%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
    5. Step-by-step derivation
      1. add-cbrt-cube51.5%

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

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

        \[\leadsto \sqrt[3]{\color{blue}{\frac{1}{h \cdot \ell}} \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \frac{1}{h \cdot \ell}\right) \cdot \frac{1}{h \cdot \ell}}}} \cdot d \]
      4. associate-/r*51.5%

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

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

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

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}}} \cdot d \]
    7. Step-by-step derivation
      1. expm1-log1p-u44.9%

        \[\leadsto \sqrt[3]{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right)}} \cdot d \]
      2. expm1-udef44.7%

        \[\leadsto \sqrt[3]{\color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{1}{h}}{\ell} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} - 1}} \cdot d \]
      3. pow144.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1}} \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)} - 1} \cdot d \]
      4. pow1/244.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\left(\frac{\frac{1}{h}}{\ell}\right)}^{1} \cdot \color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{0.5}}\right)} - 1} \cdot d \]
      5. pow-prod-up44.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{\left(1 + 0.5\right)}}\right)} - 1} \cdot d \]
      6. associate-/l/44.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\color{blue}{\left(\frac{1}{\ell \cdot h}\right)}}^{\left(1 + 0.5\right)}\right)} - 1} \cdot d \]
      7. inv-pow44.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\color{blue}{\left({\left(\ell \cdot h\right)}^{-1}\right)}}^{\left(1 + 0.5\right)}\right)} - 1} \cdot d \]
      8. metadata-eval44.7%

        \[\leadsto \sqrt[3]{e^{\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{\color{blue}{1.5}}\right)} - 1} \cdot d \]
    8. Applied egg-rr44.7%

      \[\leadsto \sqrt[3]{\color{blue}{e^{\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}\right)} - 1}} \cdot d \]
    9. Step-by-step derivation
      1. expm1-def44.9%

        \[\leadsto \sqrt[3]{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}\right)\right)}} \cdot d \]
      2. expm1-log1p44.9%

        \[\leadsto \sqrt[3]{\color{blue}{{\left({\left(\ell \cdot h\right)}^{-1}\right)}^{1.5}}} \cdot d \]
      3. unpow-144.9%

        \[\leadsto \sqrt[3]{{\color{blue}{\left(\frac{1}{\ell \cdot h}\right)}}^{1.5}} \cdot d \]
    10. Simplified44.9%

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

    if -5.00000000000023e-311 < l

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow38.2%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.0%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -9 \cdot 10^{-177}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{1}{h \cdot \ell}\right)}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 17: 33.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -6.3999999999999999e-15

    1. Initial program 59.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

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

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

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

    if -6.3999999999999999e-15 < h < -1.999999999999994e-310

    1. Initial program 64.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. Taylor expanded in d around inf 14.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.7%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative14.7%

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

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

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

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

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

    if -1.999999999999994e-310 < h

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-138.2%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow38.2%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow38.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr38.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow38.2%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval38.2%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified38.2%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Step-by-step derivation
      1. unpow-prod-down51.0%

        \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
    8. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({h}^{-0.5} \cdot {\ell}^{-0.5}\right)\\ \end{array} \]

Alternative 18: 33.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.9 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.9000000000000001e-15

    1. Initial program 59.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

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

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

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

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

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

    if -1.9000000000000001e-15 < h < -1.999999999999994e-310

    1. Initial program 64.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. Taylor expanded in d around inf 14.7%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity14.7%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative14.7%

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

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

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

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

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

    if -1.999999999999994e-310 < h

    1. Initial program 73.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. Taylor expanded in d around inf 38.2%

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

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative38.2%

        \[\leadsto \sqrt{1 \cdot \frac{1}{\color{blue}{h \cdot \ell}}} \cdot d \]
    4. Applied egg-rr38.2%

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    6. Simplified40.1%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    7. Step-by-step derivation
      1. sqrt-div51.0%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}} \cdot d \]
      2. inv-pow51.0%

        \[\leadsto \frac{\sqrt{\color{blue}{{h}^{-1}}}}{\sqrt{\ell}} \cdot d \]
      3. sqrt-pow151.0%

        \[\leadsto \frac{\color{blue}{{h}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \cdot d \]
      4. metadata-eval51.0%

        \[\leadsto \frac{{h}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \cdot d \]
    8. Applied egg-rr51.0%

      \[\leadsto \color{blue}{\frac{{h}^{-0.5}}{\sqrt{\ell}}} \cdot d \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.9 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{{h}^{-0.5}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 19: 29.5% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -4.6 \cdot 10^{-17}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -4.6e-17) (* d (pow (/ l h) -0.5)) (* d (sqrt (/ 1.0 (* h l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -4.6e-17) {
		tmp = d * pow((l / h), -0.5);
	} else {
		tmp = d * sqrt((1.0 / (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 (h <= (-4.6d-17)) then
        tmp = d * ((l / h) ** (-0.5d0))
    else
        tmp = d * sqrt((1.0d0 / (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 (h <= -4.6e-17) {
		tmp = d * Math.pow((l / h), -0.5);
	} else {
		tmp = d * Math.sqrt((1.0 / (h * l)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if h <= -4.6e-17:
		tmp = d * math.pow((l / h), -0.5)
	else:
		tmp = d * math.sqrt((1.0 / (h * l)))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -4.6e-17)
		tmp = Float64(d * (Float64(l / h) ^ -0.5));
	else
		tmp = Float64(d * sqrt(Float64(1.0 / Float64(h * l))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (h <= -4.6e-17)
		tmp = d * ((l / h) ^ -0.5);
	else
		tmp = d * sqrt((1.0 / (h * l)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -4.6e-17], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -4.6 \cdot 10^{-17}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -4.60000000000000018e-17

    1. Initial program 59.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Taylor expanded in d around inf 7.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative7.1%

        \[\leadsto \left(1 \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \cdot d \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}} \cdot d \]
      4. rem-sqrt-square7.1%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

      \[\leadsto \color{blue}{{\left(\frac{\ell}{h}\right)}^{-0.5}} \cdot d \]

    if -4.60000000000000018e-17 < h

    1. Initial program 70.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. Taylor expanded in d around inf 30.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -4.6 \cdot 10^{-17}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \]

Alternative 20: 29.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -3.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -3.4e-15) (* d (pow (/ l h) -0.5)) (* d (sqrt (/ (/ 1.0 h) l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -3.4e-15) {
		tmp = d * pow((l / h), -0.5);
	} else {
		tmp = d * sqrt(((1.0 / 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 (h <= (-3.4d-15)) then
        tmp = d * ((l / h) ** (-0.5d0))
    else
        tmp = d * sqrt(((1.0d0 / 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 (h <= -3.4e-15) {
		tmp = d * Math.pow((l / h), -0.5);
	} else {
		tmp = d * Math.sqrt(((1.0 / h) / l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if h <= -3.4e-15:
		tmp = d * math.pow((l / h), -0.5)
	else:
		tmp = d * math.sqrt(((1.0 / h) / l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -3.4e-15)
		tmp = Float64(d * (Float64(l / h) ^ -0.5));
	else
		tmp = Float64(d * sqrt(Float64(Float64(1.0 / h) / l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (h <= -3.4e-15)
		tmp = d * ((l / h) ^ -0.5);
	else
		tmp = d * sqrt(((1.0 / h) / l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -3.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -3.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -3.4e-15

    1. Initial program 59.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Taylor expanded in d around inf 7.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative7.1%

        \[\leadsto \left(1 \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \cdot d \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}} \cdot d \]
      4. rem-sqrt-square7.1%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

      \[\leadsto \color{blue}{{\left(\frac{\ell}{h}\right)}^{-0.5}} \cdot d \]

    if -3.4e-15 < h

    1. Initial program 70.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. Taylor expanded in d around inf 30.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity30.6%

        \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{\ell \cdot h}}} \cdot d \]
      2. *-commutative30.6%

        \[\leadsto \sqrt{1 \cdot \frac{1}{\color{blue}{h \cdot \ell}}} \cdot d \]
    4. Applied egg-rr30.6%

      \[\leadsto \sqrt{\color{blue}{1 \cdot \frac{1}{h \cdot \ell}}} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity30.6%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. associate-/r*31.9%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
    6. Simplified31.9%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \cdot d \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -3.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \end{array} \]

Alternative 21: 29.4% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= h -6.4e-15) (* d (pow (/ l h) -0.5)) (* d (pow (* h l) -0.5))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -6.4e-15) {
		tmp = d * pow((l / h), -0.5);
	} else {
		tmp = d * pow((h * l), -0.5);
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (h <= (-6.4d-15)) then
        tmp = d * ((l / h) ** (-0.5d0))
    else
        tmp = d * ((h * l) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (h <= -6.4e-15) {
		tmp = d * Math.pow((l / h), -0.5);
	} else {
		tmp = d * Math.pow((h * l), -0.5);
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if h <= -6.4e-15:
		tmp = d * math.pow((l / h), -0.5)
	else:
		tmp = d * math.pow((h * l), -0.5)
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (h <= -6.4e-15)
		tmp = Float64(d * (Float64(l / h) ^ -0.5));
	else
		tmp = Float64(d * (Float64(h * l) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (h <= -6.4e-15)
		tmp = d * ((l / h) ^ -0.5);
	else
		tmp = d * ((h * l) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -6.4e-15], N[(d * N[Power[N[(l / h), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\

\mathbf{else}:\\
\;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -6.3999999999999999e-15

    1. Initial program 59.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Taylor expanded in d around inf 7.1%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity7.1%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative7.1%

        \[\leadsto \left(1 \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \cdot d \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity7.1%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-17.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow7.1%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}} \cdot d \]
      4. rem-sqrt-square7.1%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow7.1%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr7.1%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow7.1%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval7.1%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
    7. Taylor expanded in h around -inf 7.0%

      \[\leadsto \color{blue}{e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}} \cdot d \]
    8. Step-by-step derivation
      1. expm1-log1p-u7.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)\right)} \cdot d \]
      2. expm1-udef7.0%

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(e^{-0.5 \cdot \left(\log \left(-1 \cdot \ell\right) + -1 \cdot \log \left(\frac{-1}{h}\right)\right)}\right)} - 1\right)} \cdot d \]
    9. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)} - 1\right)} \cdot d \]
    10. Step-by-step derivation
      1. expm1-def28.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}\right)\right)} \cdot d \]
      2. expm1-log1p28.0%

        \[\leadsto \color{blue}{{\left(\ell \cdot \frac{1}{h}\right)}^{-0.5}} \cdot d \]
      3. associate-*r/28.0%

        \[\leadsto {\color{blue}{\left(\frac{\ell \cdot 1}{h}\right)}}^{-0.5} \cdot d \]
      4. *-rgt-identity28.0%

        \[\leadsto {\left(\frac{\color{blue}{\ell}}{h}\right)}^{-0.5} \cdot d \]
    11. Simplified28.0%

      \[\leadsto \color{blue}{{\left(\frac{\ell}{h}\right)}^{-0.5}} \cdot d \]

    if -6.3999999999999999e-15 < h

    1. Initial program 70.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. Taylor expanded in d around inf 30.6%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Step-by-step derivation
      1. *-un-lft-identity30.6%

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
      2. *-commutative30.6%

        \[\leadsto \left(1 \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \cdot d \]
    4. Applied egg-rr30.6%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
    5. Step-by-step derivation
      1. *-lft-identity30.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      2. unpow-130.6%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
      3. sqr-pow30.6%

        \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}} \cdot d \]
      4. rem-sqrt-square30.6%

        \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
      5. sqr-pow30.5%

        \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
      6. fabs-sqr30.5%

        \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
      7. sqr-pow30.6%

        \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
      8. metadata-eval30.6%

        \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
    6. Simplified30.6%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;d \cdot {\left(\frac{\ell}{h}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]

Alternative 22: 26.7% accurate, 3.1× speedup?

\[\begin{array}{l} \\ d \cdot {\left(h \cdot \ell\right)}^{-0.5} \end{array} \]
(FPCore (d h l M D) :precision binary64 (* d (pow (* h l) -0.5)))
double code(double d, double h, double l, double M, double D) {
	return d * pow((h * l), -0.5);
}
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 * l) ** (-0.5d0))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d * Math.pow((h * l), -0.5);
}
def code(d, h, l, M, D):
	return d * math.pow((h * l), -0.5)
function code(d, h, l, M, D)
	return Float64(d * (Float64(h * l) ^ -0.5))
end
function tmp = code(d, h, l, M, D)
	tmp = d * ((h * l) ^ -0.5);
end
code[d_, h_, l_, M_, D_] := N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
d \cdot {\left(h \cdot \ell\right)}^{-0.5}
\end{array}
Derivation
  1. Initial program 67.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. Taylor expanded in d around inf 25.0%

    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
  3. Step-by-step derivation
    1. *-un-lft-identity25.0%

      \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)} \cdot d \]
    2. *-commutative25.0%

      \[\leadsto \left(1 \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \cdot d \]
  4. Applied egg-rr25.0%

    \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \cdot d \]
  5. Step-by-step derivation
    1. *-lft-identity25.0%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
    2. unpow-125.0%

      \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{-1}}} \cdot d \]
    3. sqr-pow25.0%

      \[\leadsto \sqrt{\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}}} \cdot d \]
    4. rem-sqrt-square25.0%

      \[\leadsto \color{blue}{\left|{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right|} \cdot d \]
    5. sqr-pow25.0%

      \[\leadsto \left|\color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}}\right| \cdot d \]
    6. fabs-sqr25.0%

      \[\leadsto \color{blue}{\left({\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)} \cdot {\left(h \cdot \ell\right)}^{\left(\frac{\frac{-1}{2}}{2}\right)}\right)} \cdot d \]
    7. sqr-pow25.0%

      \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}} \cdot d \]
    8. metadata-eval25.0%

      \[\leadsto {\left(h \cdot \ell\right)}^{\color{blue}{-0.5}} \cdot d \]
  6. Simplified25.0%

    \[\leadsto \color{blue}{{\left(h \cdot \ell\right)}^{-0.5}} \cdot d \]
  7. Final simplification25.0%

    \[\leadsto d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]

Reproduce

?
herbie shell --seed 2023181 
(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)))))