Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.1% → 72.9%
Time: 9.6s
Alternatives: 16
Speedup: 0.8×

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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    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 16 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.1% 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)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    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: 72.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\ t_1 := 1 - \left(\frac{1}{2} \cdot t\_0\right) \cdot \frac{h}{\ell}\\ t_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 t\_1\\ \mathbf{if}\;t\_2 \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(0.5 \cdot t\_0\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\left(\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (pow (/ (* M D) (* 2.0 d)) 2.0))
        (t_1 (- 1.0 (* (* (/ 1.0 2.0) t_0) (/ h l))))
        (t_2 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) t_1)))
   (if (<= t_2 4e+264)
     (* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (* 0.5 t_0) (/ h l))))
     (if (<= t_2 INFINITY)
       (* (* (- d) (pow (* h l) -0.5)) t_1)
       (/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = pow(((M * D) / (2.0 * d)), 2.0);
	double t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l));
	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * t_1;
	double tmp;
	if (t_2 <= 4e+264) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (-d * pow((h * l), -0.5)) * t_1;
	} else {
		tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.pow(((M * D) / (2.0 * d)), 2.0);
	double t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l));
	double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * t_1;
	double tmp;
	if (t_2 <= 4e+264) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = (-d * Math.pow((h * l), -0.5)) * t_1;
	} else {
		tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.pow(((M * D) / (2.0 * d)), 2.0)
	t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l))
	t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * t_1
	tmp = 0
	if t_2 <= 4e+264:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)))
	elif t_2 <= math.inf:
		tmp = (-d * math.pow((h * l), -0.5)) * t_1
	else:
		tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0
	t_1 = Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * t_0) * Float64(h / l)))
	t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * t_1)
	tmp = 0.0
	if (t_2 <= 4e+264)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(0.5 * t_0) * Float64(h / l))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(Float64(-d) * (Float64(h * l) ^ -0.5)) * t_1);
	else
		tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = ((M * D) / (2.0 * d)) ^ 2.0;
	t_1 = 1.0 - (((1.0 / 2.0) * t_0) * (h / l));
	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * t_1;
	tmp = 0.0;
	if (t_2 <= 4e+264)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_0) * (h / l)));
	elseif (t_2 <= Inf)
		tmp = (-d * ((h * l) ^ -0.5)) * t_1;
	else
		tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[((-d) * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(\left(-d\right) \cdot {\left(h \cdot \ell\right)}^{-0.5}\right) \cdot t\_1\\

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

    1. Initial program 50.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in h around -inf

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

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

        \[\leadsto \left(\left(\color{blue}{d} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \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. metadata-evalN/A

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

        \[\leadsto \left(\left(d \cdot \color{blue}{{\left(\sqrt{-1}\right)}^{2}}\right) \cdot \sqrt{\frac{1}{h \cdot \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. metadata-evalN/A

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

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

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

        \[\leadsto \left(\left(d \cdot -1\right) \cdot \sqrt{\frac{1}{\color{blue}{h \cdot \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. associate-*l*N/A

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

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

        \[\leadsto \left(d \cdot \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \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) \]
      12. lower-neg.f64N/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{{\left(h \cdot \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) \]
      14. *-commutativeN/A

        \[\leadsto \left(d \cdot \left(-\sqrt{{\left(\ell \cdot h\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) \]
      15. sqrt-pow1N/A

        \[\leadsto \left(d \cdot \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\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) \]
      16. lower-pow.f64N/A

        \[\leadsto \left(d \cdot \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\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) \]
      17. *-commutativeN/A

        \[\leadsto \left(d \cdot \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\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) \]
      18. lower-*.f64N/A

        \[\leadsto \left(d \cdot \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\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) \]
      19. metadata-eval65.6

        \[\leadsto \left(d \cdot \left(-{\left(h \cdot \ell\right)}^{-0.5}\right)\right) \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 rewrites65.6%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      10. unpow-prod-downN/A

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      13. lift-/.f6442.1

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

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot -0.125}{h} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot \frac{-1}{8}}{h} \]
      6. lift-*.f6442.1

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
    10. Applied rewrites42.1%

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.6%

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

Alternative 2: 72.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M}{2} \cdot \frac{D}{d}\\ t_1 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\ t_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 t\_1\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_2 \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(0.5 \cdot t\_1\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (/ M 2.0) (/ D d)))
        (t_1 (pow (/ (* M D) (* 2.0 d)) 2.0))
        (t_2
         (*
          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
          (- 1.0 (* (* (/ 1.0 2.0) t_1) (/ h l))))))
   (if (<= t_2 4e+264)
     (* (* (sqrt (/ d l)) (sqrt (/ d h))) (- 1.0 (* (* 0.5 t_1) (/ h l))))
     (if (<= t_2 INFINITY)
       (*
        (* (- d) (sqrt (pow (* h l) -1.0)))
        (- 1.0 (* (* (/ 1.0 2.0) (* t_0 t_0)) (/ h l))))
       (/ (* (* (pow (/ h l) 1.5) (/ (* (* D M) (* D M)) d)) -0.125) h)))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M / 2.0) * (D / d);
	double t_1 = pow(((M * D) / (2.0 * d)), 2.0);
	double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
	double tmp;
	if (t_2 <= 4e+264) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (-d * sqrt(pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)));
	} else {
		tmp = ((pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (M / 2.0) * (D / d);
	double t_1 = Math.pow(((M * D) / (2.0 * d)), 2.0);
	double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
	double tmp;
	if (t_2 <= 4e+264) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = (-d * Math.sqrt(Math.pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)));
	} else {
		tmp = ((Math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (M / 2.0) * (D / d)
	t_1 = math.pow(((M * D) / (2.0 * d)), 2.0)
	t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)))
	tmp = 0
	if t_2 <= 4e+264:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)))
	elif t_2 <= math.inf:
		tmp = (-d * math.sqrt(math.pow((h * l), -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)))
	else:
		tmp = ((math.pow((h / l), 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M / 2.0) * Float64(D / d))
	t_1 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0
	t_2 = 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) * t_1) * Float64(h / l))))
	tmp = 0.0
	if (t_2 <= 4e+264)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(0.5 * t_1) * Float64(h / l))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(Float64(-d) * sqrt((Float64(h * l) ^ -1.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * Float64(t_0 * t_0)) * Float64(h / l))));
	else
		tmp = Float64(Float64(Float64((Float64(h / l) ^ 1.5) * Float64(Float64(Float64(D * M) * Float64(D * M)) / d)) * -0.125) / h);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (M / 2.0) * (D / d);
	t_1 = ((M * D) / (2.0 * d)) ^ 2.0;
	t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * t_1) * (h / l)));
	tmp = 0.0;
	if (t_2 <= 4e+264)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((0.5 * t_1) * (h / l)));
	elseif (t_2 <= Inf)
		tmp = (-d * sqrt(((h * l) ^ -1.0))) * (1.0 - (((1.0 / 2.0) * (t_0 * t_0)) * (h / l)));
	else
		tmp = ((((h / l) ^ 1.5) * (((D * M) * (D * M)) / d)) * -0.125) / h;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = 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] * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * t$95$1), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[((-d) * N[Sqrt[N[Power[N[(h * l), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot \frac{h}{\ell}\right)\\

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

    1. Initial program 50.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(d \cdot \left(-\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)\right)\right) \cdot \frac{h}{\ell}\right) \]
      9. inv-powN/A

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

        \[\leadsto \left(d \cdot \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right)\right) \cdot \left(1 - \left(\frac{1}{2} \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)\right)\right) \cdot \frac{h}{\ell}\right) \]
      11. lift-*.f6465.5

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      10. unpow-prod-downN/A

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      13. lift-/.f6442.1

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

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot -0.125}{h} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot \frac{-1}{8}}{h} \]
      6. lift-*.f6442.1

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
    10. Applied rewrites42.1%

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.6%

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

Alternative 3: 72.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

    1. Initial program 50.8%

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      4. inv-powN/A

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
      5. lower-pow.f64N/A

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
      6. *-commutativeN/A

        \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
      7. lower-*.f6434.4

        \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
    5. Applied rewrites34.4%

      \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
    6. Taylor expanded in h around -inf

      \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
    7. Step-by-step derivation
      1. sqrt-pow2N/A

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

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

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

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

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

        \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
      7. inv-powN/A

        \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
      8. *-commutativeN/A

        \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
      9. sqrt-pow1N/A

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

        \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
      11. *-commutativeN/A

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

        \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
      13. metadata-eval64.9

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      10. unpow-prod-downN/A

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      13. lift-/.f6442.1

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

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot -0.125}{h} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot \frac{-1}{8}}{h} \]
      6. lift-*.f6442.1

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
    10. Applied rewrites42.1%

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.6%

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

Alternative 4: 73.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_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)\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \frac{D}{d}\right) \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)\right)\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 50.8%

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
      4. inv-powN/A

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
      5. lower-pow.f64N/A

        \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
      6. *-commutativeN/A

        \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
      7. lower-*.f6434.4

        \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
    5. Applied rewrites34.4%

      \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
    6. Taylor expanded in h around -inf

      \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
    7. Step-by-step derivation
      1. sqrt-pow2N/A

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

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

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

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

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

        \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
      7. inv-powN/A

        \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
      8. *-commutativeN/A

        \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
      9. sqrt-pow1N/A

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

        \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
      11. *-commutativeN/A

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

        \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
      13. metadata-eval64.9

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{D}^{2} \cdot {M}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      10. unpow-prod-downN/A

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot \frac{-1}{8}}{h} \]
      13. lift-/.f6442.1

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

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}\right) \cdot -0.125}{h} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{\frac{3}{2}} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot \frac{-1}{8}}{h} \]
      6. lift-*.f6442.1

        \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
    10. Applied rewrites42.1%

      \[\leadsto \frac{\left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right) \cdot -0.125}{h} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.8%

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

Alternative 5: 60.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_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)\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-143}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\frac{-0.125}{d \cdot d}, \frac{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot h}{\ell}, 1\right)\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_1 \cdot 1\\

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


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

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\frac{\frac{-1}{8}}{d \cdot d}, \frac{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot h}{\ell}, 1\right) \]
      6. lift-*.f6459.8

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

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

    if -1.9999999999999999e-143 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

      1. Initial program 19.6%

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

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

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

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

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        4. inv-powN/A

          \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
        5. lower-pow.f64N/A

          \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
        6. *-commutativeN/A

          \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
        7. lower-*.f6418.5

          \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
      5. Applied rewrites18.5%

        \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
      6. Taylor expanded in h around -inf

        \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
      7. Step-by-step derivation
        1. sqrt-pow2N/A

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

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

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

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

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

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. inv-powN/A

          \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
        8. *-commutativeN/A

          \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
        9. sqrt-pow1N/A

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

          \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
        11. *-commutativeN/A

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

          \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
        13. metadata-eval32.5

          \[\leadsto \left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d \]
      8. Applied rewrites32.5%

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

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

    Alternative 6: 60.6% accurate, 0.5× speedup?

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

      1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\frac{\frac{-1}{8}}{d \cdot d}, \frac{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot h}{\ell}, 1\right) \]
        6. lift-*.f6459.8

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

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

      if -1.9999999999999999e-143 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

      1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

        1. Initial program 19.6%

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

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

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

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

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          4. inv-powN/A

            \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
          5. lower-pow.f64N/A

            \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
          6. *-commutativeN/A

            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
          7. lower-*.f6418.5

            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
        5. Applied rewrites18.5%

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

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

            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
          3. unpow-1N/A

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

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          5. *-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          6. lower-*.f6418.5

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

          \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
        8. Taylor expanded in h around -inf

          \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
        9. Step-by-step derivation
          1. sqrt-pow2N/A

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

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

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

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

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

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

            \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
          8. inv-powN/A

            \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
          9. lower-pow.f64N/A

            \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
          10. lift-*.f6432.5

            \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
        10. Applied rewrites32.5%

          \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
        11. Step-by-step derivation
          1. lift-*.f64N/A

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

            \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
          3. inv-powN/A

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

            \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
          5. lift-*.f6432.5

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

          \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 7: 55.9% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_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)\\ \mathbf{if}\;t\_0 \leq -100:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\ \end{array} \end{array} \]
      (FPCore (d h l M D)
       :precision binary64
       (let* ((t_0
               (*
                (* (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))))))
         (if (<= t_0 -100.0)
           (*
            (sqrt (* (/ d l) (/ d h)))
            (* (/ (* (* (* M D) (* M D)) h) (* (* d d) l)) -0.125))
           (if (<= t_0 4e+264)
             (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
             (* (- (sqrt (/ 1.0 (* h l)))) d)))))
      double code(double d, double h, double l, double M, double D) {
      	double t_0 = (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 tmp;
      	if (t_0 <= -100.0) {
      		tmp = sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125);
      	} else if (t_0 <= 4e+264) {
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	} else {
      		tmp = -sqrt((1.0 / (h * l))) * d;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(d, h, l, m, d_1)
      use fmin_fmax_functions
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: m
          real(8), intent (in) :: d_1
          real(8) :: t_0
          real(8) :: tmp
          t_0 = (((d / 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)))
          if (t_0 <= (-100.0d0)) then
              tmp = sqrt(((d / l) * (d / h))) * (((((m * d_1) * (m * d_1)) * h) / ((d * d) * l)) * (-0.125d0))
          else if (t_0 <= 4d+264) then
              tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
          else
              tmp = -sqrt((1.0d0 / (h * l))) * 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.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)));
      	double tmp;
      	if (t_0 <= -100.0) {
      		tmp = Math.sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125);
      	} else if (t_0 <= 4e+264) {
      		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
      	} else {
      		tmp = -Math.sqrt((1.0 / (h * l))) * d;
      	}
      	return tmp;
      }
      
      def code(d, h, l, M, D):
      	t_0 = (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)))
      	tmp = 0
      	if t_0 <= -100.0:
      		tmp = math.sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125)
      	elif t_0 <= 4e+264:
      		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
      	else:
      		tmp = -math.sqrt((1.0 / (h * l))) * d
      	return tmp
      
      function code(d, h, l, M, D)
      	t_0 = 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))))
      	tmp = 0.0
      	if (t_0 <= -100.0)
      		tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) * h) / Float64(Float64(d * d) * l)) * -0.125));
      	elseif (t_0 <= 4e+264)
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
      	else
      		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d);
      	end
      	return tmp
      end
      
      function tmp_2 = code(d, h, l, M, D)
      	t_0 = (((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)));
      	tmp = 0.0;
      	if (t_0 <= -100.0)
      		tmp = sqrt(((d / l) * (d / h))) * (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125);
      	elseif (t_0 <= 4e+264)
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	else
      		tmp = -sqrt((1.0 / (h * l))) * d;
      	end
      	tmp_2 = tmp;
      end
      
      code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -100.0], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_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)\\
      \mathbf{if}\;t\_0 \leq -100:\\
      \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right)\\
      
      \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
      \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -100

        1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \frac{\frac{-1}{8} \cdot \left({\left(D \cdot M\right)}^{2} \cdot h\right)}{\left(d \cdot d\right) \cdot \ell} \]
          13. lower-*.f6461.8

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \]
        8. Applied rewrites53.8%

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

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

        1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

          1. Initial program 19.6%

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

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

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

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

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            4. inv-powN/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            5. lower-pow.f64N/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            6. *-commutativeN/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            7. lower-*.f6418.5

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
          5. Applied rewrites18.5%

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

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

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            3. unpow-1N/A

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

              \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            5. *-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            6. lower-*.f6418.5

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

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          8. Taylor expanded in h around -inf

            \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
          9. Step-by-step derivation
            1. sqrt-pow2N/A

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

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

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

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

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

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

              \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
            8. inv-powN/A

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            9. lower-pow.f64N/A

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            10. lift-*.f6432.5

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
          10. Applied rewrites32.5%

            \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
          11. Step-by-step derivation
            1. lift-*.f64N/A

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

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            3. inv-powN/A

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

              \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
            5. lift-*.f6432.5

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

            \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 8: 52.3% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_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)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+222}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\ \end{array} \end{array} \]
        (FPCore (d h l M D)
         :precision binary64
         (let* ((t_0
                 (*
                  (* (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))))))
           (if (<= t_0 -2e+222)
             (*
              (sqrt (* (/ d l) (/ d h)))
              (* (* (* D D) (* (* M M) (/ h (* (* d d) l)))) -0.125))
             (if (<= t_0 4e+264)
               (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
               (* (- (sqrt (/ 1.0 (* h l)))) d)))))
        double code(double d, double h, double l, double M, double D) {
        	double t_0 = (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 tmp;
        	if (t_0 <= -2e+222) {
        		tmp = sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125);
        	} else if (t_0 <= 4e+264) {
        		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
        	} else {
        		tmp = -sqrt((1.0 / (h * l))) * d;
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(d, h, l, m, d_1)
        use fmin_fmax_functions
            real(8), intent (in) :: d
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: m
            real(8), intent (in) :: d_1
            real(8) :: t_0
            real(8) :: tmp
            t_0 = (((d / 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)))
            if (t_0 <= (-2d+222)) then
                tmp = sqrt(((d / l) * (d / h))) * (((d_1 * d_1) * ((m * m) * (h / ((d * d) * l)))) * (-0.125d0))
            else if (t_0 <= 4d+264) then
                tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
            else
                tmp = -sqrt((1.0d0 / (h * l))) * 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.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)));
        	double tmp;
        	if (t_0 <= -2e+222) {
        		tmp = Math.sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125);
        	} else if (t_0 <= 4e+264) {
        		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
        	} else {
        		tmp = -Math.sqrt((1.0 / (h * l))) * d;
        	}
        	return tmp;
        }
        
        def code(d, h, l, M, D):
        	t_0 = (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)))
        	tmp = 0
        	if t_0 <= -2e+222:
        		tmp = math.sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125)
        	elif t_0 <= 4e+264:
        		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
        	else:
        		tmp = -math.sqrt((1.0 / (h * l))) * d
        	return tmp
        
        function code(d, h, l, M, D)
        	t_0 = 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))))
        	tmp = 0.0
        	if (t_0 <= -2e+222)
        		tmp = Float64(sqrt(Float64(Float64(d / l) * Float64(d / h))) * Float64(Float64(Float64(D * D) * Float64(Float64(M * M) * Float64(h / Float64(Float64(d * d) * l)))) * -0.125));
        	elseif (t_0 <= 4e+264)
        		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
        	else
        		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d);
        	end
        	return tmp
        end
        
        function tmp_2 = code(d, h, l, M, D)
        	t_0 = (((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)));
        	tmp = 0.0;
        	if (t_0 <= -2e+222)
        		tmp = sqrt(((d / l) * (d / h))) * (((D * D) * ((M * M) * (h / ((d * d) * l)))) * -0.125);
        	elseif (t_0 <= 4e+264)
        		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
        	else
        		tmp = -sqrt((1.0 / (h * l))) * d;
        	end
        	tmp_2 = tmp;
        end
        
        code[d_, h_, l_, M_, D_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -2e+222], N[(N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(h / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_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)\\
        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+222}:\\
        \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right)\\
        
        \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
        \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e222

          1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \frac{\frac{-1}{8} \cdot \left({\left(D \cdot M\right)}^{2} \cdot h\right)}{\left(d \cdot d\right) \cdot \ell} \]
            13. lower-*.f6459.5

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

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

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

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

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

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

              \[\leadsto \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\frac{{\left(D \cdot M\right)}^{2} \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot \frac{-1}{8}\right) \]
            5. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot \frac{-1}{8}\right) \]
            21. lift-*.f6443.6

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

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

          if -2.0000000000000001e222 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

          1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Taylor expanded in d around inf

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

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

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

            1. Initial program 19.6%

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6418.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites18.5%

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

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

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. unpow-1N/A

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

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. lower-*.f6418.5

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

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            8. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            9. Step-by-step derivation
              1. sqrt-pow2N/A

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

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              8. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              9. lower-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              10. lift-*.f6432.5

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            10. Applied rewrites32.5%

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            11. Step-by-step derivation
              1. lift-*.f64N/A

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

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              3. inv-powN/A

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. lift-*.f6432.5

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

              \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 9: 68.4% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \frac{D}{d}\right) \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<=
                (*
                 (* (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))))
                4e+264)
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (* (* (* 0.5 (/ D d)) (/ M 2.0)) (* (* (/ D d) (/ M 2.0)) (/ h l)))))
             (* (- (pow (* h l) -0.5)) d)))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((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)))) <= 4e+264) {
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
          	} else {
          		tmp = -pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (((((d / h) ** (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)))) <= 4d+264) then
                  tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((0.5d0 * (d_1 / d)) * (m / 2.0d0)) * (((d_1 / d) * (m / 2.0d0)) * (h / l))))
              else
                  tmp = -((h * l) ** (-0.5d0)) * d
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((Math.pow((d / h), (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)))) <= 4e+264) {
          		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
          	} else {
          		tmp = -Math.pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if ((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)))) <= 4e+264:
          		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))))
          	else:
          		tmp = -math.pow((h * l), -0.5) * d
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (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)))) <= 4e+264)
          		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(D / d)) * Float64(M / 2.0)) * Float64(Float64(Float64(D / d) * Float64(M / 2.0)) * Float64(h / l)))));
          	else
          		tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d);
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (((((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)))) <= 4e+264)
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * (D / d)) * (M / 2.0)) * (((D / d) * (M / 2.0)) * (h / l))));
          	else
          		tmp = -((h * l) ^ -0.5) * d;
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\
          \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \frac{D}{d}\right) \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

            1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 19.6%

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6418.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites18.5%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            7. Step-by-step derivation
              1. sqrt-pow2N/A

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              8. *-commutativeN/A

                \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
              9. sqrt-pow1N/A

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

                \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              11. *-commutativeN/A

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

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              13. metadata-eval32.5

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d \]
            8. Applied rewrites32.5%

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

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

          Alternative 10: 67.0% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<=
                (*
                 (* (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))))
                4e+264)
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (-
               1.0
               (* (* (* 0.5 (* (/ D d) (/ M 2.0))) (* (/ D d) (* M 0.5))) (/ h l))))
             (* (- (pow (* h l) -0.5)) d)))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((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)))) <= 4e+264) {
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)));
          	} else {
          		tmp = -pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (((((d / h) ** (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)))) <= 4d+264) then
                  tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((0.5d0 * ((d_1 / d) * (m / 2.0d0))) * ((d_1 / d) * (m * 0.5d0))) * (h / l)))
              else
                  tmp = -((h * l) ** (-0.5d0)) * d
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((Math.pow((d / h), (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)))) <= 4e+264) {
          		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)));
          	} else {
          		tmp = -Math.pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if ((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)))) <= 4e+264:
          		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)))
          	else:
          		tmp = -math.pow((h * l), -0.5) * d
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (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)))) <= 4e+264)
          		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(Float64(D / d) * Float64(M / 2.0))) * Float64(Float64(D / d) * Float64(M * 0.5))) * Float64(h / l))));
          	else
          		tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d);
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (((((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)))) <= 4e+264)
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((0.5 * ((D / d) * (M / 2.0))) * ((D / d) * (M * 0.5))) * (h / l)));
          	else
          		tmp = -((h * l) ^ -0.5) * d;
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\
          \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(0.5 \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)\right) \cdot \frac{h}{\ell}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

            1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 19.6%

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6418.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites18.5%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            7. Step-by-step derivation
              1. sqrt-pow2N/A

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              8. *-commutativeN/A

                \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
              9. sqrt-pow1N/A

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

                \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              11. *-commutativeN/A

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

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              13. metadata-eval32.5

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d \]
            8. Applied rewrites32.5%

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

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

          Alternative 11: 66.7% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<=
                (*
                 (* (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))))
                4e+264)
             (*
              (* (sqrt (/ d l)) (sqrt (/ d h)))
              (- 1.0 (* (* (* (/ (* M D) d) 0.25) (* (/ D d) (/ M 2.0))) (/ h l))))
             (* (- (pow (* h l) -0.5)) d)))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((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)))) <= 4e+264) {
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)));
          	} else {
          		tmp = -pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (((((d / h) ** (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)))) <= 4d+264) then
                  tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - (((((m * d_1) / d) * 0.25d0) * ((d_1 / d) * (m / 2.0d0))) * (h / l)))
              else
                  tmp = -((h * l) ** (-0.5d0)) * d
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (((Math.pow((d / h), (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)))) <= 4e+264) {
          		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)));
          	} else {
          		tmp = -Math.pow((h * l), -0.5) * d;
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if ((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)))) <= 4e+264:
          		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)))
          	else:
          		tmp = -math.pow((h * l), -0.5) * d
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (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)))) <= 4e+264)
          		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(Float64(D / d) * Float64(M / 2.0))) * Float64(h / l))));
          	else
          		tmp = Float64(Float64(-(Float64(h * l) ^ -0.5)) * d);
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (((((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)))) <= 4e+264)
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((((M * D) / d) * 0.25) * ((D / d) * (M / 2.0))) * (h / l)));
          	else
          		tmp = -((h * l) ^ -0.5) * d;
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[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], 4e+264], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]) * d), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+264}:\\
          \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \frac{h}{\ell}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.00000000000000018e264

            1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)} \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. metadata-evalN/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \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. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
            11. Applied rewrites84.2%

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

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

            1. Initial program 19.6%

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6418.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites18.5%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            7. Step-by-step derivation
              1. sqrt-pow2N/A

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              8. *-commutativeN/A

                \[\leadsto \left(-\sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot d \]
              9. sqrt-pow1N/A

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

                \[\leadsto \left(-{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              11. *-commutativeN/A

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

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{\left(\frac{-1}{2}\right)}\right) \cdot d \]
              13. metadata-eval32.5

                \[\leadsto \left(-{\left(h \cdot \ell\right)}^{-0.5}\right) \cdot d \]
            8. Applied rewrites32.5%

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

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

          Alternative 12: 42.3% accurate, 8.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(-t\_0\right) \cdot d\\ \mathbf{elif}\;h \leq 1.8 \cdot 10^{-141}:\\ \;\;\;\;t\_0 \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (let* ((t_0 (sqrt (/ 1.0 (* h l)))))
             (if (<= h -5e-311)
               (* (- t_0) d)
               (if (<= h 1.8e-141) (* t_0 d) (/ (* (sqrt (/ h l)) d) h)))))
          double code(double d, double h, double l, double M, double D) {
          	double t_0 = sqrt((1.0 / (h * l)));
          	double tmp;
          	if (h <= -5e-311) {
          		tmp = -t_0 * d;
          	} else if (h <= 1.8e-141) {
          		tmp = t_0 * d;
          	} else {
          		tmp = (sqrt((h / l)) * d) / h;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              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((1.0d0 / (h * l)))
              if (h <= (-5d-311)) then
                  tmp = -t_0 * d
              else if (h <= 1.8d-141) then
                  tmp = t_0 * d
              else
                  tmp = (sqrt((h / l)) * d) / h
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double t_0 = Math.sqrt((1.0 / (h * l)));
          	double tmp;
          	if (h <= -5e-311) {
          		tmp = -t_0 * d;
          	} else if (h <= 1.8e-141) {
          		tmp = t_0 * d;
          	} else {
          		tmp = (Math.sqrt((h / l)) * d) / h;
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	t_0 = math.sqrt((1.0 / (h * l)))
          	tmp = 0
          	if h <= -5e-311:
          		tmp = -t_0 * d
          	elif h <= 1.8e-141:
          		tmp = t_0 * d
          	else:
          		tmp = (math.sqrt((h / l)) * d) / h
          	return tmp
          
          function code(d, h, l, M, D)
          	t_0 = sqrt(Float64(1.0 / Float64(h * l)))
          	tmp = 0.0
          	if (h <= -5e-311)
          		tmp = Float64(Float64(-t_0) * d);
          	elseif (h <= 1.8e-141)
          		tmp = Float64(t_0 * d);
          	else
          		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	t_0 = sqrt((1.0 / (h * l)));
          	tmp = 0.0;
          	if (h <= -5e-311)
          		tmp = -t_0 * d;
          	elseif (h <= 1.8e-141)
          		tmp = t_0 * d;
          	else
          		tmp = (sqrt((h / l)) * d) / h;
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -5e-311], N[((-t$95$0) * d), $MachinePrecision], If[LessEqual[h, 1.8e-141], N[(t$95$0 * d), $MachinePrecision], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \sqrt{\frac{1}{h \cdot \ell}}\\
          \mathbf{if}\;h \leq -5 \cdot 10^{-311}:\\
          \;\;\;\;\left(-t\_0\right) \cdot d\\
          
          \mathbf{elif}\;h \leq 1.8 \cdot 10^{-141}:\\
          \;\;\;\;t\_0 \cdot d\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if h < -5.00000000000023e-311

            1. Initial program 65.2%

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6410.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites10.5%

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

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

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. unpow-1N/A

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

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. lower-*.f6410.5

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

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            8. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            9. Step-by-step derivation
              1. sqrt-pow2N/A

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

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

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

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

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

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              8. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              9. lower-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              10. lift-*.f6447.8

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            10. Applied rewrites47.8%

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            11. Step-by-step derivation
              1. lift-*.f64N/A

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

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              3. inv-powN/A

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

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. lift-*.f6447.8

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
            12. Applied rewrites47.8%

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

            if -5.00000000000023e-311 < h < 1.80000000000000007e-141

            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. Add Preprocessing
            3. Taylor expanded in d around inf

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

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

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

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6461.2

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites61.2%

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

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

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. unpow-1N/A

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

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. lower-*.f6461.2

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            7. Applied rewrites61.2%

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

            if 1.80000000000000007e-141 < h

            1. Initial program 63.1%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in h around 0

              \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{\color{blue}{h}} \]
            5. Applied rewrites49.1%

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-0.125 \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}, \sqrt{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
            6. Taylor expanded in d around inf

              \[\leadsto \frac{d \cdot \sqrt{\frac{h}{\ell}}}{h} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
              2. lift-sqrt.f64N/A

                \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
              3. lift-/.f64N/A

                \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
              4. lift-*.f6441.8

                \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
            8. Applied rewrites41.8%

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          3. Recombined 3 regimes into one program.
          4. Add Preprocessing

          Alternative 13: 46.7% accurate, 8.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 7.6 \cdot 10^{-296}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<= l 7.6e-296)
             (* (- (sqrt (/ 1.0 (* h l)))) d)
             (* (/ 1.0 (* (sqrt h) (sqrt l))) d)))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (l <= 7.6e-296) {
          		tmp = -sqrt((1.0 / (h * l))) * d;
          	} else {
          		tmp = (1.0 / (sqrt(h) * sqrt(l))) * d;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (l <= 7.6d-296) then
                  tmp = -sqrt((1.0d0 / (h * l))) * d
              else
                  tmp = (1.0d0 / (sqrt(h) * sqrt(l))) * d
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (l <= 7.6e-296) {
          		tmp = -Math.sqrt((1.0 / (h * l))) * d;
          	} else {
          		tmp = (1.0 / (Math.sqrt(h) * Math.sqrt(l))) * d;
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if l <= 7.6e-296:
          		tmp = -math.sqrt((1.0 / (h * l))) * d
          	else:
          		tmp = (1.0 / (math.sqrt(h) * math.sqrt(l))) * d
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (l <= 7.6e-296)
          		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d);
          	else
          		tmp = Float64(Float64(1.0 / Float64(sqrt(h) * sqrt(l))) * d);
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (l <= 7.6e-296)
          		tmp = -sqrt((1.0 / (h * l))) * d;
          	else
          		tmp = (1.0 / (sqrt(h) * sqrt(l))) * d;
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[l, 7.6e-296], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq 7.6 \cdot 10^{-296}:\\
          \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if l < 7.6000000000000004e-296

            1. Initial program 65.5%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6410.2

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites10.2%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. unpow-1N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. lower-*.f6410.2

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            7. Applied rewrites10.2%

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            8. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            9. Step-by-step derivation
              1. sqrt-pow2N/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
              2. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
              3. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
              4. *-commutativeN/A

                \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
              6. lower-neg.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. lower-sqrt.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              8. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              9. lower-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              10. lift-*.f6447.3

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            10. Applied rewrites47.3%

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            11. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              3. inv-powN/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. lift-*.f6447.3

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
            12. Applied rewrites47.3%

              \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]

            if 7.6000000000000004e-296 < l

            1. Initial program 63.3%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6437.5

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites37.5%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              4. *-commutativeN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. inv-powN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. sqrt-divN/A

                \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
              7. metadata-evalN/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              8. lower-/.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              9. *-commutativeN/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              10. lower-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              11. *-commutativeN/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              12. lower-*.f6437.5

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            7. Applied rewrites37.5%

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              2. lift-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              3. sqrt-prodN/A

                \[\leadsto \frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d \]
              4. lower-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d \]
              5. lower-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d \]
              6. lower-sqrt.f6453.7

                \[\leadsto \frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d \]
            9. Applied rewrites53.7%

              \[\leadsto \frac{1}{\sqrt{h} \cdot \sqrt{\ell}} \cdot d \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 14: 42.9% accurate, 10.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3.2 \cdot 10^{-212}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<= l 3.2e-212) (* (- (sqrt (/ 1.0 (* h l)))) d) (/ d (sqrt (* h l)))))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (l <= 3.2e-212) {
          		tmp = -sqrt((1.0 / (h * l))) * d;
          	} else {
          		tmp = d / sqrt((h * l));
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (l <= 3.2d-212) then
                  tmp = -sqrt((1.0d0 / (h * l))) * d
              else
                  tmp = d / sqrt((h * l))
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (l <= 3.2e-212) {
          		tmp = -Math.sqrt((1.0 / (h * l))) * d;
          	} else {
          		tmp = d / Math.sqrt((h * l));
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if l <= 3.2e-212:
          		tmp = -math.sqrt((1.0 / (h * l))) * d
          	else:
          		tmp = d / math.sqrt((h * l))
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (l <= 3.2e-212)
          		tmp = Float64(Float64(-sqrt(Float64(1.0 / Float64(h * l)))) * d);
          	else
          		tmp = Float64(d / sqrt(Float64(h * l)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (l <= 3.2e-212)
          		tmp = -sqrt((1.0 / (h * l))) * d;
          	else
          		tmp = d / sqrt((h * l));
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.2e-212], N[((-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * d), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq 3.2 \cdot 10^{-212}:\\
          \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if l < 3.1999999999999999e-212

            1. Initial program 67.9%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6411.3

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites11.3%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. unpow-1N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. lower-*.f6411.3

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            7. Applied rewrites11.3%

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            8. Taylor expanded in h around -inf

              \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot d \]
            9. Step-by-step derivation
              1. sqrt-pow2N/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{\left(\frac{2}{2}\right)}\right) \cdot d \]
              2. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {-1}^{1}\right) \cdot d \]
              3. metadata-evalN/A

                \[\leadsto \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot -1\right) \cdot d \]
              4. *-commutativeN/A

                \[\leadsto \left(-1 \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right) \cdot d \]
              6. lower-neg.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              7. lower-sqrt.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              8. inv-powN/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              9. lower-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              10. lift-*.f6445.0

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            10. Applied rewrites45.0%

              \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
            11. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \left(-\sqrt{{\left(h \cdot \ell\right)}^{-1}}\right) \cdot d \]
              3. inv-powN/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
              5. lift-*.f6445.0

                \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]
            12. Applied rewrites45.0%

              \[\leadsto \left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d \]

            if 3.1999999999999999e-212 < l

            1. Initial program 59.8%

              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in d around inf

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lower-*.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              4. inv-powN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. lower-pow.f64N/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              6. *-commutativeN/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              7. lower-*.f6440.0

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            5. Applied rewrites40.0%

              \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              2. lift-pow.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              3. lower-sqrt.f64N/A

                \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
              4. *-commutativeN/A

                \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
              5. inv-powN/A

                \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
              6. sqrt-divN/A

                \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
              7. metadata-evalN/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              8. lower-/.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              9. *-commutativeN/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              10. lower-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
              11. *-commutativeN/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              12. lower-*.f6439.9

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            7. Applied rewrites39.9%

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot \color{blue}{d} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              3. lift-*.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              4. lift-sqrt.f64N/A

                \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
              5. associate-*l/N/A

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              8. lift-sqrt.f64N/A

                \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
              9. lift-*.f6440.1

                \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
            9. Applied rewrites40.1%

              \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification42.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.2 \cdot 10^{-212}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{h \cdot \ell}}\right) \cdot d\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 15: 27.2% accurate, 12.9× speedup?

          \[\begin{array}{l} \\ \sqrt{\frac{1}{h \cdot \ell}} \cdot d \end{array} \]
          (FPCore (d h l M D) :precision binary64 (* (sqrt (/ 1.0 (* h l))) d))
          double code(double d, double h, double l, double M, double D) {
          	return sqrt((1.0 / (h * l))) * d;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              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((1.0d0 / (h * l))) * d
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	return Math.sqrt((1.0 / (h * l))) * d;
          }
          
          def code(d, h, l, M, D):
          	return math.sqrt((1.0 / (h * l))) * d
          
          function code(d, h, l, M, D)
          	return Float64(sqrt(Float64(1.0 / Float64(h * l))) * d)
          end
          
          function tmp = code(d, h, l, M, D)
          	tmp = sqrt((1.0 / (h * l))) * d;
          end
          
          code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \sqrt{\frac{1}{h \cdot \ell}} \cdot d
          \end{array}
          
          Derivation
          1. Initial program 64.4%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in d around inf

            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
            2. lower-*.f64N/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            4. inv-powN/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            5. lower-pow.f64N/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            6. *-commutativeN/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            7. lower-*.f6423.8

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
          5. Applied rewrites23.8%

            \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            2. lift-pow.f64N/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            3. unpow-1N/A

              \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            4. lower-/.f64N/A

              \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
            5. *-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            6. lower-*.f6423.8

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          7. Applied rewrites23.8%

            \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
          8. Add Preprocessing

          Alternative 16: 27.2% accurate, 15.3× speedup?

          \[\begin{array}{l} \\ \frac{d}{\sqrt{h \cdot \ell}} \end{array} \]
          (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
          double code(double d, double h, double l, double M, double D) {
          	return d / sqrt((h * l));
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(d, h, l, m, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: m
              real(8), intent (in) :: d_1
              code = d / sqrt((h * l))
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	return d / Math.sqrt((h * l));
          }
          
          def code(d, h, l, M, D):
          	return d / math.sqrt((h * l))
          
          function code(d, h, l, M, D)
          	return Float64(d / sqrt(Float64(h * l)))
          end
          
          function tmp = code(d, h, l, M, D)
          	tmp = d / sqrt((h * l));
          end
          
          code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{d}{\sqrt{h \cdot \ell}}
          \end{array}
          
          Derivation
          1. Initial program 64.4%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in d around inf

            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
            2. lower-*.f64N/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{d} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            4. inv-powN/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            5. lower-pow.f64N/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            6. *-commutativeN/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            7. lower-*.f6423.8

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
          5. Applied rewrites23.8%

            \[\leadsto \color{blue}{\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            2. lift-pow.f64N/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            3. lower-sqrt.f64N/A

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            4. *-commutativeN/A

              \[\leadsto \sqrt{{\left(h \cdot \ell\right)}^{-1}} \cdot d \]
            5. inv-powN/A

              \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
            6. sqrt-divN/A

              \[\leadsto \frac{\sqrt{1}}{\sqrt{h \cdot \ell}} \cdot d \]
            7. metadata-evalN/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            8. lower-/.f64N/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            9. *-commutativeN/A

              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
            10. lower-sqrt.f64N/A

              \[\leadsto \frac{1}{\sqrt{\ell \cdot h}} \cdot d \]
            11. *-commutativeN/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            12. lower-*.f6423.7

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
          7. Applied rewrites23.7%

            \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot \color{blue}{d} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            3. lift-*.f64N/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            4. lift-sqrt.f64N/A

              \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
            5. associate-*l/N/A

              \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
            6. lower-/.f64N/A

              \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
            7. lower-*.f64N/A

              \[\leadsto \frac{1 \cdot d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
            8. lift-sqrt.f64N/A

              \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
            9. lift-*.f6423.8

              \[\leadsto \frac{1 \cdot d}{\sqrt{h \cdot \ell}} \]
          9. Applied rewrites23.8%

            \[\leadsto \frac{1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
          10. Final simplification23.8%

            \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
          11. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025054 
          (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)))))