Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.6% → 77.0%
Time: 21.4s
Alternatives: 17
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 66.6% accurate, 1.0× speedup?

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

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

Alternative 1: 77.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.000000000000002e-309

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

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

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

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

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

        \[\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*71.2%

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

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

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

      \[\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. Step-by-step derivation
      1. pow1/269.8%

        \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}} \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) \]
      2. metadata-eval69.8%

        \[\leadsto {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \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) \]
      3. sqr-pow69.7%

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

        \[\leadsto \color{blue}{{\left({\left(\frac{d}{h}\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{2}} \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) \]
      5. metadata-eval69.7%

        \[\leadsto {\left({\left(\frac{d}{h}\right)}^{\left(\frac{\color{blue}{0.5}}{2}\right)}\right)}^{2} \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) \]
      6. metadata-eval69.7%

        \[\leadsto {\left({\left(\frac{d}{h}\right)}^{\color{blue}{0.25}}\right)}^{2} \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) \]
    5. Applied egg-rr69.7%

      \[\leadsto \color{blue}{{\left({\left(\frac{d}{h}\right)}^{0.25}\right)}^{2}} \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) \]
    6. Taylor expanded in h around -inf 78.0%

      \[\leadsto {\color{blue}{\left(e^{0.25 \cdot \left(\log \left(\frac{-1}{h}\right) + \log \left(-1 \cdot d\right)\right)}\right)}}^{2} \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) \]
    7. Step-by-step derivation
      1. distribute-lft-in78.0%

        \[\leadsto {\left(e^{\color{blue}{0.25 \cdot \log \left(\frac{-1}{h}\right) + 0.25 \cdot \log \left(-1 \cdot d\right)}}\right)}^{2} \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) \]
      2. exp-sum78.2%

        \[\leadsto {\color{blue}{\left(e^{0.25 \cdot \log \left(\frac{-1}{h}\right)} \cdot e^{0.25 \cdot \log \left(-1 \cdot d\right)}\right)}}^{2} \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) \]
      3. *-commutative78.2%

        \[\leadsto {\left(e^{\color{blue}{\log \left(\frac{-1}{h}\right) \cdot 0.25}} \cdot e^{0.25 \cdot \log \left(-1 \cdot d\right)}\right)}^{2} \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. exp-to-pow78.6%

        \[\leadsto {\left(\color{blue}{{\left(\frac{-1}{h}\right)}^{0.25}} \cdot e^{0.25 \cdot \log \left(-1 \cdot d\right)}\right)}^{2} \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) \]
      5. *-commutative78.6%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot e^{\color{blue}{\log \left(-1 \cdot d\right) \cdot 0.25}}\right)}^{2} \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) \]
      6. rem-square-sqrt0.0%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot e^{\log \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot 0.25}\right)}^{2} \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) \]
      7. unpow20.0%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot e^{\log \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot d\right) \cdot 0.25}\right)}^{2} \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) \]
      8. exp-to-pow0.0%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot \color{blue}{{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)}^{0.25}}\right)}^{2} \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) \]
      9. unpow20.0%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right)}^{0.25}\right)}^{2} \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) \]
      10. rem-square-sqrt81.6%

        \[\leadsto {\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(\color{blue}{-1} \cdot d\right)}^{0.25}\right)}^{2} \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) \]
      11. mul-1-neg81.6%

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 72.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. div-inv72.3%

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

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

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{\color{blue}{0.5}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Applied egg-rr85.0%

      \[\leadsto \left(\color{blue}{\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{0.5}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Step-by-step derivation
      1. unpow1/285.0%

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right) \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) \]
      2. pow1/285.0%

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

        \[\leadsto \left(\left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)\right)}\right) \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. expm1-udef52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-309}:\\ \;\;\;\;{\left({\left(\frac{-1}{h}\right)}^{0.25} \cdot {\left(-d\right)}^{0.25}\right)}^{2} \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)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}{\ell}\right)\\ \end{array} \]

Alternative 2: 72.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.000000000000002e-309

    1. Initial program 71.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. Step-by-step derivation
      1. metadata-eval71.2%

        \[\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/271.2%

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

        \[\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/271.2%

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

        \[\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*71.2%

        \[\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-frac69.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-eval69.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. Simplified69.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-times71.2%

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

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

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 72.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. div-inv72.3%

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

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

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{\color{blue}{0.5}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Applied egg-rr85.0%

      \[\leadsto \left(\color{blue}{\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{0.5}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Step-by-step derivation
      1. unpow1/285.0%

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right) \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) \]
      2. pow1/285.0%

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

        \[\leadsto \left(\left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)\right)}\right) \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. expm1-udef52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 71.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.000000000000002e-309

    1. Initial program 71.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. Step-by-step derivation
      1. metadata-eval71.2%

        \[\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/271.2%

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

        \[\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/271.2%

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

        \[\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*71.2%

        \[\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-frac69.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-eval69.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. Simplified69.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-times71.2%

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

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

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

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

    if -1.000000000000002e-309 < l

    1. Initial program 72.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 M around 0 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 - 0.125 \cdot \left(\frac{h}{\ell} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d}\right)\right) \]
      2. pow1/261.6%

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

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

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

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

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

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

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

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

Alternative 4: 68.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(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\right) \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (sqrt (/ d h))
  (*
   (sqrt (/ d l))
   (- 1.0 (* 0.5 (* h (/ (pow (* M (* 0.5 (/ D d))) 2.0) l)))))))
double code(double d, double h, double l, double M, double D) {
	return sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (pow((M * (0.5 * (D / d))), 2.0) / 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 = sqrt((d / h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * (h * (((m * (0.5d0 * (d_1 / d))) ** 2.0d0) / l)))))
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 * (Math.pow((M * (0.5 * (D / d))), 2.0) / l)))));
}
def code(d, h, l, M, D):
	return math.sqrt((d / h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * (h * (math.pow((M * (0.5 * (D / d))), 2.0) / l)))))
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(h * Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) / l))))))
end
function tmp = code(d, h, l, M, D)
	tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 - (0.5 * (h * (((M * (0.5 * (D / d))) ^ 2.0) / l)))));
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[(h * N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $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(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\right)\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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. associate-*l*71.7%

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

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

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

    \[\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. Step-by-step derivation
    1. associate-*r/73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 47.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.65 \cdot 10^{-226}:\\
\;\;\;\;t_0 \cdot t_1\\

\mathbf{elif}\;M \leq 2.15 \cdot 10^{-66}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \frac{0.25 \cdot \frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}{d \cdot d}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell \cdot d} \cdot \frac{M \cdot \left(h \cdot M\right)}{d}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 1.65e-226

    1. Initial program 74.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. associate-*l*74.5%

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

        \[\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/274.5%

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

        \[\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/274.5%

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

        \[\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. +-commutative74.5%

        \[\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. *-commutative74.5%

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

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

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

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. expm1-log1p-u43.9%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity35.5%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
    6. Applied egg-rr35.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def43.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p45.9%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
    8. Simplified45.9%

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

    if 1.65e-226 < M < 2.15000000000000007e-66

    1. Initial program 65.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*65.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-eval65.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/265.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-eval65.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/265.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. associate-*l*65.6%

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

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

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

      \[\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 49.6%

      \[\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) \]
    5. Step-by-step derivation
      1. associate-/r*52.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{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell}}{{d}^{2}}}\right)\right)\right) \]
      2. associate-*r/52.8%

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

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

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

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

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

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

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

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

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

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

    if 2.15000000000000007e-66 < M

    1. Initial program 68.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. associate-*l*68.3%

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

        \[\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/268.3%

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

        \[\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/268.3%

        \[\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*68.3%

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r/71.0%

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

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

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

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

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

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

      \[\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) \]
    7. Step-by-step derivation
      1. *-commutative42.7%

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

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

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

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

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

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

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\left(\ell \cdot d\right) \cdot d}\right)}\right)\right) \]
    9. Step-by-step derivation
      1. times-frac51.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.65 \cdot 10^{-226}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 2.15 \cdot 10^{-66}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{0.25 \cdot \frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell}}{d \cdot d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell \cdot d} \cdot \frac{M \cdot \left(h \cdot M\right)}{d}\right)\right)\right)\right)\\ \end{array} \]

Alternative 6: 39.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\ell \cdot h}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;M \leq 3.1 \cdot 10^{-10}:\\ \;\;\;\;t_1 \cdot t_2\\ \mathbf{elif}\;M \leq 7.8 \cdot 10^{+37}:\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;M \leq 1.28 \cdot 10^{+66}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(t_1 \cdot \left(-0.125 \cdot \left(\frac{D}{\frac{d \cdot d}{D}} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* l h))) (t_1 (sqrt (/ d l))) (t_2 (sqrt (/ d h))))
   (if (<= M 3.1e-10)
     (* t_1 t_2)
     (if (<= M 7.8e+37)
       (* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
       (if (<= M 1.28e+66)
         (* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))
         (*
          t_2
          (* t_1 (* -0.125 (* (/ D (/ (* d d) D)) (/ (* M M) (/ l h)))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (l * h);
	double t_1 = sqrt((d / l));
	double t_2 = sqrt((d / h));
	double tmp;
	if (M <= 3.1e-10) {
		tmp = t_1 * t_2;
	} else if (M <= 7.8e+37) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
	} else if (M <= 1.28e+66) {
		tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
	} else {
		tmp = t_2 * (t_1 * (-0.125 * ((D / ((d * d) / D)) * ((M * M) / (l / h)))));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (l * h);
	double t_1 = Math.sqrt((d / l));
	double t_2 = Math.sqrt((d / h));
	double tmp;
	if (M <= 3.1e-10) {
		tmp = t_1 * t_2;
	} else if (M <= 7.8e+37) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else if (M <= 1.28e+66) {
		tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
	} else {
		tmp = t_2 * (t_1 * (-0.125 * ((D / ((d * d) / D)) * ((M * M) / (l / h)))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 / Float64(l * h))
	t_1 = sqrt(Float64(d / l))
	t_2 = sqrt(Float64(d / h))
	tmp = 0.0
	if (M <= 3.1e-10)
		tmp = Float64(t_1 * t_2);
	elseif (M <= 7.8e+37)
		tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0)))));
	elseif (M <= 1.28e+66)
		tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0)))));
	else
		tmp = Float64(t_2 * Float64(t_1 * Float64(-0.125 * Float64(Float64(D / Float64(Float64(d * d) / D)) * Float64(Float64(M * M) / Float64(l / h))))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[M, 3.1e-10], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[M, 7.8e+37], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.28e+66], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * N[(-0.125 * N[(N[(D / N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 3.1 \cdot 10^{-10}:\\
\;\;\;\;t_1 \cdot t_2\\

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

\mathbf{elif}\;M \leq 1.28 \cdot 10^{+66}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(t_1 \cdot \left(-0.125 \cdot \left(\frac{D}{\frac{d \cdot d}{D}} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if M < 3.10000000000000015e-10

    1. Initial program 72.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*72.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-eval72.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/272.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-eval72.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/272.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. sub-neg72.8%

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

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

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

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

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

      \[\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 48.8%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. expm1-log1p-u46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)\right)} \]
      2. expm1-udef34.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.8%

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.8%

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

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

    if 3.10000000000000015e-10 < M < 7.7999999999999997e37

    1. Initial program 41.7%

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

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

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

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{\color{blue}{0.5}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Applied egg-rr30.0%

      \[\leadsto \left(\color{blue}{\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{0.5}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Step-by-step derivation
      1. unpow1/230.0%

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

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

      \[\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-/l*20.8%

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

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

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

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

    if 7.7999999999999997e37 < M < 1.28000000000000003e66

    1. Initial program 61.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. associate-*l*61.3%

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

        \[\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/261.3%

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

        \[\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/261.3%

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

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

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

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

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

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

      \[\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 61.5%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 21.6%

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \color{blue}{\frac{1}{h \cdot \ell}}\right) \cdot \frac{\frac{1}{\ell}}{h}}} \]
      4. associate-/l/2.2%

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

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

    if 1.28000000000000003e66 < M

    1. Initial program 74.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*74.5%

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

        \[\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/274.5%

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

        \[\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/274.5%

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

        \[\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. +-commutative74.5%

        \[\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. *-commutative74.5%

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

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

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

      \[\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 inf 36.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.1 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 7.8 \cdot 10^{+37}:\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{elif}\;M \leq 1.28 \cdot 10^{+66}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{\frac{1}{\ell \cdot h} \cdot \left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{D}{\frac{d \cdot d}{D}} \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\right)\\ \end{array} \]

Alternative 7: 46.4% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.9 \cdot 10^{-79}:\\
\;\;\;\;t_0 \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{D \cdot D}{\ell \cdot d} \cdot \frac{M \cdot \left(h \cdot M\right)}{d}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.9000000000000001e-79

    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. Step-by-step derivation
      1. associate-*l*73.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-eval73.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/273.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-eval73.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/273.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. sub-neg73.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity35.7%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
    6. Applied egg-rr35.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
    8. Simplified48.7%

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

    if 1.9000000000000001e-79 < M

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*66.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-eval66.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/266.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-eval66.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/266.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. associate-*l*66.4%

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*r/69.1%

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

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

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

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

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

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

      \[\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) \]
    7. Step-by-step derivation
      1. *-commutative41.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 43.2% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.8 \cdot 10^{-79}:\\
\;\;\;\;t_0 \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + \frac{-0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.8000000000000001e-79

    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. Step-by-step derivation
      1. associate-*l*73.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-eval73.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/273.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-eval73.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/273.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. sub-neg73.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity35.7%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
    6. Applied egg-rr35.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.7%

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}} \]
    8. Simplified48.7%

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

    if 1.8000000000000001e-79 < M

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*66.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-eval66.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/266.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-eval66.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/266.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-neg66.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. +-commutative66.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. *-commutative66.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-in66.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-def66.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. Simplified65.1%

      \[\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 41.6%

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

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

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

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

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

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

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

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

Alternative 9: 66.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
\left(1 - 0.125 \cdot \left(\frac{h}{\ell} \cdot \left(t_0 \cdot t_0\right)\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot {\left(\frac{d}{h}\right)}^{0.5}\right)
\end{array}
\end{array}
Derivation
  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 M around 0 46.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 37.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\ell \cdot h}\\ \mathbf{if}\;M \leq 5.5 \cdot 10^{-11}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 2.2 \cdot 10^{+38} \lor \neg \left(M \leq 3.5 \cdot 10^{+74}\right) \land M \leq 3 \cdot 10^{+200}:\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ 1.0 (* l h))))
   (if (<= M 5.5e-11)
     (* (sqrt (/ d l)) (sqrt (/ d h)))
     (if (or (<= M 2.2e+38) (and (not (<= M 3.5e+74)) (<= M 3e+200)))
       (* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
       (* d (sqrt (cbrt (* t_0 (* t_0 t_0)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (l * h);
	double tmp;
	if (M <= 5.5e-11) {
		tmp = sqrt((d / l)) * sqrt((d / h));
	} else if ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200))) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
	} else {
		tmp = d * sqrt(cbrt((t_0 * (t_0 * t_0))));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 / (l * h);
	double tmp;
	if (M <= 5.5e-11) {
		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
	} else if ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200))) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else {
		tmp = d * Math.sqrt(Math.cbrt((t_0 * (t_0 * t_0))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(1.0 / Float64(l * h))
	tmp = 0.0
	if (M <= 5.5e-11)
		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
	elseif ((M <= 2.2e+38) || (!(M <= 3.5e+74) && (M <= 3e+200)))
		tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0)))));
	else
		tmp = Float64(d * sqrt(cbrt(Float64(t_0 * Float64(t_0 * t_0)))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 5.5e-11], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 2.2e+38], And[N[Not[LessEqual[M, 3.5e+74]], $MachinePrecision], LessEqual[M, 3e+200]]], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;M \leq 5.5 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{elif}\;M \leq 2.2 \cdot 10^{+38} \lor \neg \left(M \leq 3.5 \cdot 10^{+74}\right) \land M \leq 3 \cdot 10^{+200}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 5.49999999999999975e-11

    1. Initial program 72.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*72.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-eval72.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/272.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-eval72.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/272.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. sub-neg72.8%

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

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

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

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

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

      \[\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 48.8%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. expm1-log1p-u46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)\right)} \]
      2. expm1-udef34.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.8%

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.8%

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

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

    if 5.49999999999999975e-11 < M < 2.20000000000000006e38 or 3.50000000000000014e74 < M < 2.99999999999999991e200

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

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

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

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{\color{blue}{0.5}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Applied egg-rr46.9%

      \[\leadsto \left(\color{blue}{\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{0.5}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Step-by-step derivation
      1. unpow1/246.9%

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

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

      \[\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-/l*32.7%

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

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

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

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

    if 2.20000000000000006e38 < M < 3.50000000000000014e74 or 2.99999999999999991e200 < M

    1. Initial program 74.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*74.9%

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

        \[\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/274.9%

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

        \[\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/274.9%

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

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

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

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

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

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

      \[\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 23.6%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 11.4%

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

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

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

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

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

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

        \[\leadsto d \cdot \sqrt{\sqrt[3]{\left(\frac{1}{h \cdot \ell} \cdot \color{blue}{\frac{1}{h \cdot \ell}}\right) \cdot \frac{\frac{1}{\ell}}{h}}} \]
      4. associate-/l/14.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 5.5 \cdot 10^{-11}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 2.2 \cdot 10^{+38} \lor \neg \left(M \leq 3.5 \cdot 10^{+74}\right) \land M \leq 3 \cdot 10^{+200}:\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\sqrt[3]{\frac{1}{\ell \cdot h} \cdot \left(\frac{1}{\ell \cdot h} \cdot \frac{1}{\ell \cdot h}\right)}}\\ \end{array} \]

Alternative 11: 40.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \leq 1.02 \cdot 10^{-11}:\\
\;\;\;\;t_0 \cdot t_1\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_0 \cdot \left(\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell} \cdot \frac{-0.125}{d \cdot d}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.01999999999999994e-11

    1. Initial program 72.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*72.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-eval72.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/272.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-eval72.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/272.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. sub-neg72.8%

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

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

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

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

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

      \[\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 48.8%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. expm1-log1p-u46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)\right)} \]
      2. expm1-udef34.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.8%

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.8%

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

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

    if 1.01999999999999994e-11 < M

    1. Initial program 68.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. associate-*l*68.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-eval68.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/268.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-eval68.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/268.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-neg68.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. +-commutative68.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. *-commutative68.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-in68.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-def68.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. Simplified66.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 inf 32.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.02 \cdot 10^{-11}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\frac{h \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right)}{\ell} \cdot \frac{-0.125}{d \cdot d}\right)\right)\\ \end{array} \]

Alternative 12: 37.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 1.6 \cdot 10^{+38} \lor \neg \left(M \leq 8.5 \cdot 10^{+71}\right):\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= M 1.9e-10)
   (* (sqrt (/ d l)) (sqrt (/ d h)))
   (if (or (<= M 1.6e+38) (not (<= M 8.5e+71)))
     (* -0.125 (* (/ (* D D) (/ d (* M M))) (sqrt (/ h (pow l 3.0)))))
     (* d (cbrt (pow (/ (/ 1.0 h) l) 1.5))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (M <= 1.9e-10) {
		tmp = sqrt((d / l)) * sqrt((d / h));
	} else if ((M <= 1.6e+38) || !(M <= 8.5e+71)) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * sqrt((h / pow(l, 3.0))));
	} else {
		tmp = d * cbrt(pow(((1.0 / h) / l), 1.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (M <= 1.9e-10) {
		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
	} else if ((M <= 1.6e+38) || !(M <= 8.5e+71)) {
		tmp = -0.125 * (((D * D) / (d / (M * M))) * Math.sqrt((h / Math.pow(l, 3.0))));
	} else {
		tmp = d * Math.cbrt(Math.pow(((1.0 / h) / l), 1.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (M <= 1.9e-10)
		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
	elseif ((M <= 1.6e+38) || !(M <= 8.5e+71))
		tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d / Float64(M * M))) * sqrt(Float64(h / (l ^ 3.0)))));
	else
		tmp = Float64(d * cbrt((Float64(Float64(1.0 / h) / l) ^ 1.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 1.9e-10], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 1.6e+38], N[Not[LessEqual[M, 8.5e+71]], $MachinePrecision]], N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[Power[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;M \leq 1.6 \cdot 10^{+38} \lor \neg \left(M \leq 8.5 \cdot 10^{+71}\right):\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 1.8999999999999999e-10

    1. Initial program 72.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*72.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-eval72.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/272.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-eval72.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/272.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. sub-neg72.8%

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

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

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

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

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

      \[\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 48.8%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. expm1-log1p-u46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)\right)} \]
      2. expm1-udef34.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.8%

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.8%

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

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

    if 1.8999999999999999e-10 < M < 1.59999999999999993e38 or 8.4999999999999996e71 < M

    1. Initial program 68.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. div-inv68.5%

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

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

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

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

        \[\leadsto \left(\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{\color{blue}{0.5}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Applied egg-rr40.8%

      \[\leadsto \left(\color{blue}{\left(\sqrt{d} \cdot {\left(\frac{1}{h}\right)}^{0.5}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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. Step-by-step derivation
      1. unpow1/240.8%

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

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

      \[\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-/l*30.7%

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

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

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

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

    if 1.59999999999999993e38 < M < 8.4999999999999996e71

    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. sub-neg67.8%

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

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

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

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

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

      \[\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 51.5%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 18.2%

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

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

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

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

        \[\leadsto {\left(\color{blue}{{\left(\frac{1}{\ell \cdot h}\right)}^{1}} \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}^{0.3333333333333333} \cdot d \]
      5. pow1/216.8%

        \[\leadsto {\left({\left(\frac{1}{\ell \cdot h}\right)}^{1} \cdot \color{blue}{{\left(\frac{1}{\ell \cdot h}\right)}^{0.5}}\right)}^{0.3333333333333333} \cdot d \]
      6. pow-prod-up16.7%

        \[\leadsto {\color{blue}{\left({\left(\frac{1}{\ell \cdot h}\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \cdot d \]
      7. metadata-eval16.7%

        \[\leadsto {\left({\left(\frac{1}{\ell \cdot h}\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} \cdot d \]
    7. Applied egg-rr16.7%

      \[\leadsto \color{blue}{{\left({\left(\frac{1}{\ell \cdot h}\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot d \]
    8. Step-by-step derivation
      1. unpow1/318.0%

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

        \[\leadsto \sqrt[3]{{\left(\frac{1}{\color{blue}{h \cdot \ell}}\right)}^{1.5}} \cdot d \]
      3. associate-/r*18.0%

        \[\leadsto \sqrt[3]{{\color{blue}{\left(\frac{\frac{1}{h}}{\ell}\right)}}^{1.5}} \cdot d \]
    9. Simplified18.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;M \leq 1.6 \cdot 10^{+38} \lor \neg \left(M \leq 8.5 \cdot 10^{+71}\right):\\ \;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{M \cdot M}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\ \end{array} \]

Alternative 13: 37.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 6600:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= M 6600.0)
   (* (sqrt (/ d l)) (sqrt (/ d h)))
   (* d (cbrt (pow (/ (/ 1.0 h) l) 1.5)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (M <= 6600.0) {
		tmp = sqrt((d / l)) * sqrt((d / h));
	} else {
		tmp = d * cbrt(pow(((1.0 / h) / l), 1.5));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (M <= 6600.0) {
		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
	} else {
		tmp = d * Math.cbrt(Math.pow(((1.0 / h) / l), 1.5));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (M <= 6600.0)
		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
	else
		tmp = Float64(d * cbrt((Float64(Float64(1.0 / h) / l) ^ 1.5)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 6600.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Power[N[Power[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 6600:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 6600

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.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 48.1%

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.3%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
    6. Applied egg-rr34.3%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.1%

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

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

    if 6600 < M

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.1%

      \[\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 22.1%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 14.6%

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

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

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

        \[\leadsto {\left(\color{blue}{\frac{1}{\ell \cdot h}} \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}^{0.3333333333333333} \cdot d \]
      4. pow115.6%

        \[\leadsto {\left(\color{blue}{{\left(\frac{1}{\ell \cdot h}\right)}^{1}} \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)}^{0.3333333333333333} \cdot d \]
      5. pow1/215.6%

        \[\leadsto {\left({\left(\frac{1}{\ell \cdot h}\right)}^{1} \cdot \color{blue}{{\left(\frac{1}{\ell \cdot h}\right)}^{0.5}}\right)}^{0.3333333333333333} \cdot d \]
      6. pow-prod-up15.6%

        \[\leadsto {\color{blue}{\left({\left(\frac{1}{\ell \cdot h}\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \cdot d \]
      7. metadata-eval15.6%

        \[\leadsto {\left({\left(\frac{1}{\ell \cdot h}\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} \cdot d \]
    7. Applied egg-rr15.6%

      \[\leadsto \color{blue}{{\left({\left(\frac{1}{\ell \cdot h}\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot d \]
    8. Step-by-step derivation
      1. unpow1/316.1%

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

        \[\leadsto \sqrt[3]{{\left(\frac{1}{\color{blue}{h \cdot \ell}}\right)}^{1.5}} \cdot d \]
      3. associate-/r*16.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 6600:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt[3]{{\left(\frac{\frac{1}{h}}{\ell}\right)}^{1.5}}\\ \end{array} \]

Alternative 14: 40.8% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 3.7e-258

    1. Initial program 69.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. associate-*l*69.0%

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

        \[\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/269.0%

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

        \[\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/269.0%

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

        \[\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. +-commutative69.0%

        \[\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. *-commutative69.0%

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

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

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

      \[\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 39.4%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow1/239.4%

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.25}}\right)}^{2} \cdot 1\right) \]
    6. Applied egg-rr39.3%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot 1\right)\right)\right)} \]
      2. expm1-udef30.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity30.4%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
      5. pow-pow30.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(0.25 \cdot 2\right)}} \cdot \sqrt{\frac{d}{h}}\right)} - 1 \]
      6. metadata-eval30.4%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{h}}\right)} - 1 \]
      7. pow1/230.4%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)} - 1 \]
      8. pow-prod-down25.4%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def31.0%

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

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      3. unpow1/232.1%

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

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

    if 3.7e-258 < d

    1. Initial program 75.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. associate-*l*75.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-eval75.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/275.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-eval75.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/275.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-neg75.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. +-commutative75.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. *-commutative75.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-in75.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-def75.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. Simplified74.5%

      \[\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 45.3%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 41.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 3.7 \cdot 10^{-258}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]

Alternative 15: 37.2% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 6500:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 6500

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.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 48.1%

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.3%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
    6. Applied egg-rr34.3%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\right)} \]
      2. expm1-log1p48.1%

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

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

    if 6500 < M

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.1%

      \[\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 22.1%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 14.6%

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

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

        \[\leadsto {\color{blue}{\left({\left(\ell \cdot h\right)}^{-1}\right)}}^{0.5} \cdot d \]
      3. pow-pow14.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 6500:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]

Alternative 16: 31.7% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 6800:\\
\;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 6800

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.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 48.1%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Step-by-step derivation
      1. pow1/248.1%

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

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.25}}\right)}^{2} \cdot 1\right) \]
    6. Applied egg-rr48.0%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot 1\right)\right)\right)} \]
      2. expm1-udef34.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}} \cdot \left({\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot 1\right)\right)} - 1} \]
      3. *-rgt-identity34.3%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left({\left(\frac{d}{\ell}\right)}^{0.25}\right)}^{2} \cdot \sqrt{\frac{d}{h}}}\right)} - 1 \]
      5. pow-pow34.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(0.25 \cdot 2\right)}} \cdot \sqrt{\frac{d}{h}}\right)} - 1 \]
      6. metadata-eval34.3%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{h}}\right)} - 1 \]
      7. pow1/234.3%

        \[\leadsto e^{\mathsf{log1p}\left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{d}{h}\right)}^{0.5}}\right)} - 1 \]
      8. pow-prod-down28.2%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def36.9%

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

        \[\leadsto \color{blue}{{\left(\frac{d}{\ell} \cdot \frac{d}{h}\right)}^{0.5}} \]
      3. unpow1/238.1%

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

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

    if 6800 < M

    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. Step-by-step derivation
      1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.1%

      \[\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 22.1%

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
    5. Taylor expanded in d around 0 14.6%

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

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

        \[\leadsto {\color{blue}{\left({\left(\ell \cdot h\right)}^{-1}\right)}}^{0.5} \cdot d \]
      3. pow-pow14.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 6800:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]

Alternative 17: 25.9% accurate, 3.1× speedup?

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

\\
d \cdot {\left(\ell \cdot h\right)}^{-0.5}
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-*l*71.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-eval71.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/271.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-eval71.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/271.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-neg71.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. +-commutative71.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. *-commutative71.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-in71.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-def71.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. Simplified70.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 41.8%

    \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{1}\right) \]
  5. Taylor expanded in d around 0 24.1%

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

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

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

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

      \[\leadsto {\left(\ell \cdot h\right)}^{\color{blue}{-0.5}} \cdot d \]
  7. Applied egg-rr24.1%

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

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

Reproduce

?
herbie shell --seed 2023240 
(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)))))