Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.5% → 75.5%
Time: 9.1s
Alternatives: 13
Speedup: 1.9×

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 13 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: 65.5% 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: 75.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := 1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\\
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 t\_0\\
t_2 := \frac{\left(\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot -0.125\right) \cdot {\left(\frac{h}{\ell}\right)}^{1.5}}{h}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_0\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -inf.0 or +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 44.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 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.6%

      \[\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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\frac{{\left(M \cdot D\right)}^{2}}{d} \cdot \frac{-1}{8}\right) \cdot {\left(\frac{h}{\ell}\right)}^{\left(\frac{3}{2}\right)}}{h} \]
      16. metadata-eval69.5

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

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

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

    1. Initial program 90.4%

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

        \[\leadsto \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-/.f6490.4

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

      \[\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) \]

    if 5.00000000000000009e233 < (*.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 59.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. 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 rewrites61.8%

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

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
    8. Applied rewrites75.5%

      \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 53.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
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 {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\left(-0.125 \cdot \frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot -1}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0 \cdot d}{h}\\

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


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

    1. Initial program 77.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
    4. Applied rewrites96.7%

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

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

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      8. lower-*.f6498.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 \left(1 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    6. Applied rewrites98.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 \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
    7. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      3. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      4. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
      17. lift-/.f6498.0

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

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

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

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

      if 5.00000000000000009e233 < (*.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 59.9%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. 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 rewrites61.8%

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

          \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
      8. Applied rewrites75.5%

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

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

      1. Initial program 0.0%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Add Preprocessing
      3. 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 rewrites21.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 l around -inf

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

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

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

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

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

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

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

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

          \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
        9. lift-/.f6422.7

          \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
      8. Applied rewrites22.7%

        \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
    11. Recombined 4 regimes into one program.
    12. Final simplification55.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 0:\\ \;\;\;\;\left(-0.125 \cdot \frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot -1}{d}\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\ \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 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \end{array} \]
    13. Add Preprocessing

    Alternative 3: 50.8% accurate, 0.3× speedup?

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

      1. Initial program 84.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}^{2} \cdot \left(\frac{-1}{8} \cdot \left(\frac{{M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) + \frac{d}{{D}^{2}} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.0000000000000001e-170 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000009e233

      1. Initial program 88.7%

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

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

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

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

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

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
      4. Applied rewrites87.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 \left(1 - \color{blue}{\frac{\left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}}\right) \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        8. lower-*.f6488.6

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
        17. lift-/.f6488.6

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
      10. 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 5.00000000000000009e233 < (*.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 59.9%

          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        2. 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 rewrites61.8%

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

            \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
        8. Applied rewrites75.5%

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

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

        1. Initial program 0.0%

          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
        2. Add Preprocessing
        3. 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 rewrites21.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 l around -inf

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

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

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

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

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

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

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

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

            \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          9. lift-/.f6422.7

            \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
        8. Applied rewrites22.7%

          \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
      11. Recombined 4 regimes into one program.
      12. Final simplification55.0%

        \[\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 -5 \cdot 10^{-170}:\\ \;\;\;\;\frac{\left(\sqrt{h \cdot \ell} \cdot \frac{M \cdot M}{d}\right) \cdot -0.125}{\ell \cdot \ell} \cdot \left(D \cdot D\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 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \end{array} \]
      13. Add Preprocessing

      Alternative 4: 47.0% accurate, 0.3× 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{h}{\ell}}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{t\_1 \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_1}{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)))))
              (t_1 (sqrt (/ h l))))
         (if (<= t_0 0.0)
           (* (sqrt (/ (/ 1.0 l) h)) d)
           (if (<= t_0 5e+233)
             (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
             (if (<= t_0 INFINITY) (/ (* t_1 d) h) (/ (* (- d) t_1) 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 t_1 = sqrt((h / l));
      	double tmp;
      	if (t_0 <= 0.0) {
      		tmp = sqrt(((1.0 / l) / h)) * d;
      	} else if (t_0 <= 5e+233) {
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	} else if (t_0 <= ((double) INFINITY)) {
      		tmp = (t_1 * d) / h;
      	} else {
      		tmp = (-d * t_1) / 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 t_1 = Math.sqrt((h / l));
      	double tmp;
      	if (t_0 <= 0.0) {
      		tmp = Math.sqrt(((1.0 / l) / h)) * d;
      	} else if (t_0 <= 5e+233) {
      		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
      	} else if (t_0 <= Double.POSITIVE_INFINITY) {
      		tmp = (t_1 * d) / h;
      	} else {
      		tmp = (-d * t_1) / 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)))
      	t_1 = math.sqrt((h / l))
      	tmp = 0
      	if t_0 <= 0.0:
      		tmp = math.sqrt(((1.0 / l) / h)) * d
      	elif t_0 <= 5e+233:
      		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
      	elif t_0 <= math.inf:
      		tmp = (t_1 * d) / h
      	else:
      		tmp = (-d * t_1) / 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))))
      	t_1 = sqrt(Float64(h / l))
      	tmp = 0.0
      	if (t_0 <= 0.0)
      		tmp = Float64(sqrt(Float64(Float64(1.0 / l) / h)) * d);
      	elseif (t_0 <= 5e+233)
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
      	elseif (t_0 <= Inf)
      		tmp = Float64(Float64(t_1 * d) / h);
      	else
      		tmp = Float64(Float64(Float64(-d) * t_1) / 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)));
      	t_1 = sqrt((h / l));
      	tmp = 0.0;
      	if (t_0 <= 0.0)
      		tmp = sqrt(((1.0 / l) / h)) * d;
      	elseif (t_0 <= 5e+233)
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	elseif (t_0 <= Inf)
      		tmp = (t_1 * d) / h;
      	else
      		tmp = (-d * t_1) / 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]}, Block[{t$95$1 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision], If[LessEqual[t$95$0, 5e+233], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(t$95$1 * d), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$1), $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)\\
      t_1 := \sqrt{\frac{h}{\ell}}\\
      \mathbf{if}\;t\_0 \leq 0:\\
      \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+233}:\\
      \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
      
      \mathbf{elif}\;t\_0 \leq \infty:\\
      \;\;\;\;\frac{t\_1 \cdot d}{h}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left(-d\right) \cdot t\_1}{h}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0

        1. Initial program 77.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-*.f6414.5

            \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
        5. Applied rewrites14.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. lift-*.f6414.5

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

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

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

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
          3. associate-/r*N/A

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

            \[\leadsto \sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d \]
          5. lower-/.f6414.5

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

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

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

        1. Initial program 98.0%

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

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

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

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
        4. Applied rewrites96.7%

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

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

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          8. lower-*.f6498.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 \left(1 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
        6. Applied rewrites98.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 \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
        7. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          3. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          4. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
          17. lift-/.f6498.0

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

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

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

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

          if 5.00000000000000009e233 < (*.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 59.9%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. 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 rewrites61.8%

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

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites75.5%

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

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

          1. Initial program 0.0%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Add Preprocessing
          3. 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 rewrites21.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 l around -inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
            9. lift-/.f6422.7

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          8. Applied rewrites22.7%

            \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
        11. Recombined 4 regimes into one program.
        12. Final simplification48.5%

          \[\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 0:\\ \;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\\ \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 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \end{array} \]
        13. Add Preprocessing

        Alternative 5: 46.0% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ 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 {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-170} \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 \cdot d}{h}\\ \end{array} \end{array} \]
        (FPCore (d h l M D)
         :precision binary64
         (let* ((t_0 (sqrt (/ h l)))
                (t_1
                 (*
                  (* (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 (or (<= t_1 -5e-170) (not (<= t_1 INFINITY)))
             (/ (* (- d) t_0) h)
             (/ (* t_0 d) h))))
        double code(double d, double h, double l, double M, double D) {
        	double t_0 = sqrt((h / l));
        	double t_1 = (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_1 <= -5e-170) || !(t_1 <= ((double) INFINITY))) {
        		tmp = (-d * t_0) / h;
        	} else {
        		tmp = (t_0 * d) / h;
        	}
        	return tmp;
        }
        
        public static double code(double d, double h, double l, double M, double D) {
        	double t_0 = Math.sqrt((h / l));
        	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) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
        	double tmp;
        	if ((t_1 <= -5e-170) || !(t_1 <= Double.POSITIVE_INFINITY)) {
        		tmp = (-d * t_0) / h;
        	} else {
        		tmp = (t_0 * d) / h;
        	}
        	return tmp;
        }
        
        def code(d, h, l, M, D):
        	t_0 = math.sqrt((h / l))
        	t_1 = (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_1 <= -5e-170) or not (t_1 <= math.inf):
        		tmp = (-d * t_0) / h
        	else:
        		tmp = (t_0 * d) / h
        	return tmp
        
        function code(d, h, l, M, D)
        	t_0 = sqrt(Float64(h / l))
        	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) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
        	tmp = 0.0
        	if ((t_1 <= -5e-170) || !(t_1 <= Inf))
        		tmp = Float64(Float64(Float64(-d) * t_0) / h);
        	else
        		tmp = Float64(Float64(t_0 * d) / h);
        	end
        	return tmp
        end
        
        function tmp_2 = code(d, h, l, M, D)
        	t_0 = sqrt((h / l));
        	t_1 = (((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_1 <= -5e-170) || ~((t_1 <= Inf)))
        		tmp = (-d * t_0) / h;
        	else
        		tmp = (t_0 * d) / h;
        	end
        	tmp_2 = tmp;
        end
        
        code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $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] * 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[Or[LessEqual[t$95$1, -5e-170], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[(t$95$0 * d), $MachinePrecision] / h), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sqrt{\frac{h}{\ell}}\\
        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 {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-170} \lor \neg \left(t\_1 \leq \infty\right):\\
        \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{t\_0 \cdot d}{h}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.0000000000000001e-170 or +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 51.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 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 rewrites46.9%

            \[\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 l around -inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
            9. lift-/.f6415.4

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          8. Applied rewrites15.4%

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

          if -5.0000000000000001e-170 < (*.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 81.5%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. 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 rewrites58.0%

            \[\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-*.f6474.1

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites74.1%

            \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification42.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 -5 \cdot 10^{-170} \lor \neg \left(\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \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\right):\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 6: 71.2% accurate, 0.5× speedup?

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

          1. Initial program 86.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites84.9%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6486.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 \left(1 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          6. Applied rewrites86.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 \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          7. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            3. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            4. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6486.5

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

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot 0.5\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            2. count-2-revN/A

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

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

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

          if 5.00000000000000009e233 < (*.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 59.9%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. 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 rewrites61.8%

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

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites75.5%

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

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

          1. Initial program 0.0%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Add Preprocessing
          3. 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 rewrites21.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 l around -inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
            9. lift-/.f6422.7

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          8. Applied rewrites22.7%

            \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification72.0%

          \[\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 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{d + d}\right)}^{2} \cdot 0.5\right) \cdot 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:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 70.7% accurate, 0.5× speedup?

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

          1. Initial program 86.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites84.9%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6486.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 \left(1 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          6. Applied rewrites86.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 \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          7. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            3. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            4. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6486.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 5.00000000000000009e233 < (*.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 59.9%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. 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 rewrites61.8%

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

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites75.5%

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

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

          1. Initial program 0.0%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. Add Preprocessing
          3. 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 rewrites21.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 l around -inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
            9. lift-/.f6422.7

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          8. Applied rewrites22.7%

            \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification70.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 5 \cdot 10^{+233}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\left(\left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)\right) \cdot 0.5\right) \cdot 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:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 74.4% accurate, 1.5× speedup?

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

          1. Initial program 77.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
            2. lift-*.f64N/A

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites77.9%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6478.9

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6478.9

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

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot 0.5\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            2. count-2-revN/A

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

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

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

          if -2.20000000000000019e-189 < d < -1.999999999999994e-310

          1. Initial program 30.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.999999999999994e-310 < d < 4.40000000000000021e-139

          1. Initial program 43.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites43.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.40000000000000021e-139 < d

          1. Initial program 72.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites73.1%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6475.2

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6475.2

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

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

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

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

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

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

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

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

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

        Alternative 9: 74.2% accurate, 1.5× speedup?

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

          1. Initial program 77.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
            2. lift-*.f64N/A

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites77.9%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6478.9

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6478.9

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

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot 0.5\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            2. count-2-revN/A

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

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

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

          if -2.20000000000000019e-189 < d < -1.999999999999994e-310

          1. Initial program 30.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.999999999999994e-310 < d < 3.39999999999999999e-139

          1. Initial program 43.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites43.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.39999999999999999e-139 < d

          1. Initial program 72.5%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites73.1%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6475.2

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6475.2

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

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

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

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

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

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

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

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

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

        Alternative 10: 73.6% accurate, 1.9× speedup?

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

          1. Initial program 77.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
            2. lift-*.f64N/A

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites77.9%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6478.9

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6478.9

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

            \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot 0.5\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            2. count-2-revN/A

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

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

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

          if -2.20000000000000019e-189 < d < -1.999999999999994e-310

          1. Initial program 30.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 h around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.999999999999994e-310 < d

          1. Initial program 62.7%

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

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

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

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
            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 \left(1 - \color{blue}{\frac{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{\ell}}\right) \]
          4. Applied rewrites63.1%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot \frac{1}{2}\right) \cdot 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)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left({\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            8. lower-*.f6464.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 \left(1 - \frac{\left({\left(\frac{D \cdot M}{\color{blue}{2 \cdot d}}\right)}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          6. Applied rewrites64.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 \left(1 - \frac{\left({\color{blue}{\left(\frac{D \cdot M}{2 \cdot d}\right)}}^{2} \cdot 0.5\right) \cdot h}{\ell}\right) \]
          7. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            3. 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            4. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \left(1 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot 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 - \frac{\left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot h}{\ell}\right) \]
            17. lift-/.f6464.5

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

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

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

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

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

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

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

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

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

        Alternative 11: 43.9% accurate, 7.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;d \leq -7.2 \cdot 10^{-188}:\\ \;\;\;\;\frac{t\_0 \cdot d}{h}\\ \mathbf{elif}\;d \leq 6.6 \cdot 10^{-268}:\\ \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \end{array} \]
        (FPCore (d h l M D)
         :precision binary64
         (let* ((t_0 (sqrt (/ h l))))
           (if (<= d -7.2e-188)
             (/ (* t_0 d) h)
             (if (<= d 6.6e-268)
               (/ (* (- d) t_0) h)
               (* (/ 1.0 (* (sqrt l) (sqrt h))) d)))))
        double code(double d, double h, double l, double M, double D) {
        	double t_0 = sqrt((h / l));
        	double tmp;
        	if (d <= -7.2e-188) {
        		tmp = (t_0 * d) / h;
        	} else if (d <= 6.6e-268) {
        		tmp = (-d * t_0) / h;
        	} else {
        		tmp = (1.0 / (sqrt(l) * sqrt(h))) * 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 = sqrt((h / l))
            if (d <= (-7.2d-188)) then
                tmp = (t_0 * d) / h
            else if (d <= 6.6d-268) then
                tmp = (-d * t_0) / h
            else
                tmp = (1.0d0 / (sqrt(l) * sqrt(h))) * d
            end if
            code = tmp
        end function
        
        public static double code(double d, double h, double l, double M, double D) {
        	double t_0 = Math.sqrt((h / l));
        	double tmp;
        	if (d <= -7.2e-188) {
        		tmp = (t_0 * d) / h;
        	} else if (d <= 6.6e-268) {
        		tmp = (-d * t_0) / h;
        	} else {
        		tmp = (1.0 / (Math.sqrt(l) * Math.sqrt(h))) * d;
        	}
        	return tmp;
        }
        
        def code(d, h, l, M, D):
        	t_0 = math.sqrt((h / l))
        	tmp = 0
        	if d <= -7.2e-188:
        		tmp = (t_0 * d) / h
        	elif d <= 6.6e-268:
        		tmp = (-d * t_0) / h
        	else:
        		tmp = (1.0 / (math.sqrt(l) * math.sqrt(h))) * d
        	return tmp
        
        function code(d, h, l, M, D)
        	t_0 = sqrt(Float64(h / l))
        	tmp = 0.0
        	if (d <= -7.2e-188)
        		tmp = Float64(Float64(t_0 * d) / h);
        	elseif (d <= 6.6e-268)
        		tmp = Float64(Float64(Float64(-d) * t_0) / h);
        	else
        		tmp = Float64(Float64(1.0 / Float64(sqrt(l) * sqrt(h))) * d);
        	end
        	return tmp
        end
        
        function tmp_2 = code(d, h, l, M, D)
        	t_0 = sqrt((h / l));
        	tmp = 0.0;
        	if (d <= -7.2e-188)
        		tmp = (t_0 * d) / h;
        	elseif (d <= 6.6e-268)
        		tmp = (-d * t_0) / h;
        	else
        		tmp = (1.0 / (sqrt(l) * sqrt(h))) * d;
        	end
        	tmp_2 = tmp;
        end
        
        code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7.2e-188], N[(N[(t$95$0 * d), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 6.6e-268], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sqrt{\frac{h}{\ell}}\\
        \mathbf{if}\;d \leq -7.2 \cdot 10^{-188}:\\
        \;\;\;\;\frac{t\_0 \cdot d}{h}\\
        
        \mathbf{elif}\;d \leq 6.6 \cdot 10^{-268}:\\
        \;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if d < -7.1999999999999994e-188

          1. Initial program 77.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 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 rewrites58.6%

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

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites51.3%

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

          if -7.1999999999999994e-188 < d < 6.59999999999999986e-268

          1. Initial program 32.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 rewrites37.0%

            \[\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 l around -inf

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

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

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

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

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

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

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

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

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
            9. lift-/.f6426.9

              \[\leadsto \frac{d \cdot \left(-\sqrt{\frac{h}{\ell}}\right)}{h} \]
          8. Applied rewrites26.9%

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

          if 6.59999999999999986e-268 < d

          1. Initial program 64.8%

            \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
          2. 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-*.f6438.0

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

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

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

              \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
            3. lift-pow.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. lift-*.f6438.0

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

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

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

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

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

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

              \[\leadsto \frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d \]
            6. lower-sqrt.f6442.7

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -7.2 \cdot 10^{-188}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{elif}\;d \leq 6.6 \cdot 10^{-268}:\\ \;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell} \cdot \sqrt{h}} \cdot d\\ \end{array} \]
        5. Add Preprocessing

        Alternative 12: 39.8% accurate, 9.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -3.8 \cdot 10^{-189}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \end{array} \end{array} \]
        (FPCore (d h l M D)
         :precision binary64
         (if (<= d -3.8e-189) (/ (* (sqrt (/ h l)) d) h) (* (sqrt (/ 1.0 (* l h))) d)))
        double code(double d, double h, double l, double M, double D) {
        	double tmp;
        	if (d <= -3.8e-189) {
        		tmp = (sqrt((h / l)) * d) / h;
        	} else {
        		tmp = sqrt((1.0 / (l * h))) * 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 <= (-3.8d-189)) then
                tmp = (sqrt((h / l)) * d) / h
            else
                tmp = sqrt((1.0d0 / (l * h))) * d
            end if
            code = tmp
        end function
        
        public static double code(double d, double h, double l, double M, double D) {
        	double tmp;
        	if (d <= -3.8e-189) {
        		tmp = (Math.sqrt((h / l)) * d) / h;
        	} else {
        		tmp = Math.sqrt((1.0 / (l * h))) * d;
        	}
        	return tmp;
        }
        
        def code(d, h, l, M, D):
        	tmp = 0
        	if d <= -3.8e-189:
        		tmp = (math.sqrt((h / l)) * d) / h
        	else:
        		tmp = math.sqrt((1.0 / (l * h))) * d
        	return tmp
        
        function code(d, h, l, M, D)
        	tmp = 0.0
        	if (d <= -3.8e-189)
        		tmp = Float64(Float64(sqrt(Float64(h / l)) * d) / h);
        	else
        		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * d);
        	end
        	return tmp
        end
        
        function tmp_2 = code(d, h, l, M, D)
        	tmp = 0.0;
        	if (d <= -3.8e-189)
        		tmp = (sqrt((h / l)) * d) / h;
        	else
        		tmp = sqrt((1.0 / (l * h))) * d;
        	end
        	tmp_2 = tmp;
        end
        
        code[d_, h_, l_, M_, D_] := If[LessEqual[d, -3.8e-189], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision] / h), $MachinePrecision], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;d \leq -3.8 \cdot 10^{-189}:\\
        \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot d}{h}\\
        
        \mathbf{else}:\\
        \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if d < -3.80000000000000022e-189

          1. Initial program 77.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 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 rewrites58.6%

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

              \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot d}{h} \]
          8. Applied rewrites51.3%

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

          if -3.80000000000000022e-189 < d

          1. Initial program 57.1%

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

            \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
          4. Step-by-step derivation
            1. *-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-*.f6432.1

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

            \[\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. lift-*.f6432.1

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

            \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 13: 26.4% accurate, 12.9× speedup?

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

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

          \[\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. lift-*.f6421.6

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

          \[\leadsto \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]
        8. Add Preprocessing

        Reproduce

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