Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.9% → 81.2%
Time: 11.1s
Alternatives: 19
Speedup: 0.7×

Specification

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

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

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

Alternative 1: 81.2% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{t\_1}{d} \cdot t\_0\right) \cdot 0.25\right) \cdot t\_0\right) \cdot t\_1\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}}\\


\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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 2: 81.2% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(t\_2 \cdot t\_0\right) \cdot 0.25\right) \cdot t\_0\right) \cdot t\_1\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}}\\


\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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 3: 81.0% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := \mathsf{min}\left(\left|M\right|, D\right)\\ t_1 := \sqrt{h \cdot \ell}\\ t_2 := \mathsf{max}\left(\left|M\right|, D\right)\\ t_3 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_0 \cdot t\_2}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_4 := \frac{t\_2}{d} \cdot t\_0\\ t_5 := t\_4 \cdot 0.25\\ \mathbf{if}\;t\_3 \leq 10^{-233}:\\ \;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \left(t\_4 \cdot t\_5\right) \cdot \frac{h}{\ell}, 1\right)}{t\_1}\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+262}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(t\_5 \cdot t\_0\right) \cdot t\_2\right) \cdot h}{d \cdot \ell}, 1\right)}{t\_1}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (fmin (fabs M) D))
        (t_1 (sqrt (* h l)))
        (t_2 (fmax (fabs M) D))
        (t_3
         (*
          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
          (-
           1.0
           (* (* (/ 1.0 2.0) (pow (/ (* t_0 t_2) (* 2.0 d)) 2.0)) (/ h l)))))
        (t_4 (* (/ t_2 d) t_0))
        (t_5 (* t_4 0.25)))
   (if (<= t_3 1e-233)
     (/ (* (fabs d) (fma -0.5 (* (* t_4 t_5) (/ h l)) 1.0)) t_1)
     (if (<= t_3 5e+262)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (/
        (* (fabs d) (fma -0.5 (/ (* (* (* t_5 t_0) t_2) h) (* d l)) 1.0))
        t_1)))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = fmin(fabs(M), D);
	double t_1 = sqrt((h * l));
	double t_2 = fmax(fabs(M), D);
	double t_3 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_0 * t_2) / (2.0 * d)), 2.0)) * (h / l)));
	double t_4 = (t_2 / d) * t_0;
	double t_5 = t_4 * 0.25;
	double tmp;
	if (t_3 <= 1e-233) {
		tmp = (fabs(d) * fma(-0.5, ((t_4 * t_5) * (h / l)), 1.0)) / t_1;
	} else if (t_3 <= 5e+262) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = (fabs(d) * fma(-0.5, ((((t_5 * t_0) * t_2) * h) / (d * l)), 1.0)) / t_1;
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = fmin(abs(M), D)
	t_1 = sqrt(Float64(h * l))
	t_2 = fmax(abs(M), D)
	t_3 = 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(t_0 * t_2) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	t_4 = Float64(Float64(t_2 / d) * t_0)
	t_5 = Float64(t_4 * 0.25)
	tmp = 0.0
	if (t_3 <= 1e-233)
		tmp = Float64(Float64(abs(d) * fma(-0.5, Float64(Float64(t_4 * t_5) * Float64(h / l)), 1.0)) / t_1);
	elseif (t_3 <= 5e+262)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = Float64(Float64(abs(d) * fma(-0.5, Float64(Float64(Float64(Float64(t_5 * t_0) * t_2) * h) / Float64(d * l)), 1.0)) / t_1);
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Min[N[Abs[M], $MachinePrecision], D], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[M], $MachinePrecision], D], $MachinePrecision]}, Block[{t$95$3 = 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[(t$95$0 * t$95$2), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 / d), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * 0.25), $MachinePrecision]}, If[LessEqual[t$95$3, 1e-233], N[(N[(N[Abs[d], $MachinePrecision] * N[(-0.5 * N[(N[(t$95$4 * t$95$5), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 5e+262], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] * N[(-0.5 * N[(N[(N[(N[(t$95$5 * t$95$0), $MachinePrecision] * t$95$2), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|M\right|, D\right)\\
t_1 := \sqrt{h \cdot \ell}\\
t_2 := \mathsf{max}\left(\left|M\right|, D\right)\\
t_3 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_0 \cdot t\_2}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_4 := \frac{t\_2}{d} \cdot t\_0\\
t_5 := t\_4 \cdot 0.25\\
\mathbf{if}\;t\_3 \leq 10^{-233}:\\
\;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \left(t\_4 \cdot t\_5\right) \cdot \frac{h}{\ell}, 1\right)}{t\_1}\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(t\_5 \cdot t\_0\right) \cdot t\_2\right) \cdot h}{d \cdot \ell}, 1\right)}{t\_1}\\


\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)))) < 9.9999999999999996e-234

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \left(\frac{1}{4} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right) \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      9. lower-*.f6470.6%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \left(0.25 \cdot \left(M \cdot \frac{D}{d}\right)\right)\right) \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      10. lift-*.f64N/A

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \left(\left(\frac{D}{d} \cdot M\right) \cdot \color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \frac{1}{4}\right)}\right) \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      12. lower-*.f6470.6%

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \left(\left(\frac{D}{d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right)\right) \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      15. lower-*.f6470.6%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \left(\left(\frac{D}{d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot 0.25\right)\right) \cdot \frac{h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites70.6%

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

    if 9.9999999999999996e-234 < (*.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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 4: 80.4% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(t\_1 \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{t\_3}\\


\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)))) < 9.9999999999999996e-234

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \frac{h}{\ell}\right), 1\right)}{\sqrt{h \cdot \ell}} \]
      14. lower-*.f6472.2%

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \left(\left(\frac{D}{d} \cdot M\right) \cdot \frac{1}{4}\right) \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{h}{\ell}\right), 1\right)}{\sqrt{h \cdot \ell}} \]
      17. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{h}{\ell}\right), 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

    if 9.9999999999999996e-234 < (*.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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 5: 79.0% accurate, 0.7× speedup?

\[\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^{+262}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(M \cdot \frac{D}{d}\right) \cdot M, \left(-0.125 \cdot \frac{h}{\ell}\right) \cdot \frac{D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
       (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
      5e+262)
   (*
    (*
     (fma (* (* M (/ D d)) M) (* (* -0.125 (/ h l)) (/ D d)) 1.0)
     (sqrt (/ d l)))
    (sqrt (/ d h)))
   (/
    (*
     (fabs d)
     (fma -0.5 (/ (* (* (* (* (* (/ D d) M) 0.25) M) D) h) (* d l)) 1.0))
    (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+262) {
		tmp = (fma(((M * (D / d)) * M), ((-0.125 * (h / l)) * (D / d)), 1.0) * sqrt((d / l))) * sqrt((d / h));
	} else {
		tmp = (fabs(d) * fma(-0.5, (((((((D / d) * M) * 0.25) * M) * D) * h) / (d * l)), 1.0)) / sqrt((h * l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+262)
		tmp = Float64(Float64(fma(Float64(Float64(M * Float64(D / d)) * M), Float64(Float64(-0.125 * Float64(h / l)) * Float64(D / d)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h)));
	else
		tmp = Float64(Float64(abs(d) * fma(-0.5, Float64(Float64(Float64(Float64(Float64(Float64(Float64(D / d) * M) * 0.25) * M) * D) * h) / Float64(d * l)), 1.0)) / sqrt(Float64(h * l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+262], N[(N[(N[(N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * N[(N[(-0.125 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] * N[(-0.5 * N[(N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * 0.25), $MachinePrecision] * M), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\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^{+262}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(M \cdot \frac{D}{d}\right) \cdot M, \left(-0.125 \cdot \frac{h}{\ell}\right) \cdot \frac{D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\

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


\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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 6: 79.0% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

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


\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)))) < 9.9999999999999996e-234 or 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

    if 9.9999999999999996e-234 < (*.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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.6% accurate, 0.7× speedup?

\[\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^{+262}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(D \cdot \frac{M}{d}\right) \cdot M, \left(-0.125 \cdot \frac{h}{\ell}\right) \cdot \frac{D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
       (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
      5e+262)
   (*
    (*
     (fma (* (* D (/ M d)) M) (* (* -0.125 (/ h l)) (/ D d)) 1.0)
     (sqrt (/ d l)))
    (sqrt (/ d h)))
   (/
    (*
     (fabs d)
     (fma -0.5 (/ (* (* (* (* (* (/ D d) M) 0.25) M) D) h) (* d l)) 1.0))
    (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 5e+262) {
		tmp = (fma(((D * (M / d)) * M), ((-0.125 * (h / l)) * (D / d)), 1.0) * sqrt((d / l))) * sqrt((d / h));
	} else {
		tmp = (fabs(d) * fma(-0.5, (((((((D / d) * M) * 0.25) * M) * D) * h) / (d * l)), 1.0)) / sqrt((h * l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 5e+262)
		tmp = Float64(Float64(fma(Float64(Float64(D * Float64(M / d)) * M), Float64(Float64(-0.125 * Float64(h / l)) * Float64(D / d)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h)));
	else
		tmp = Float64(Float64(abs(d) * fma(-0.5, Float64(Float64(Float64(Float64(Float64(Float64(Float64(D / d) * M) * 0.25) * M) * D) * h) / Float64(d * l)), 1.0)) / sqrt(Float64(h * l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+262], N[(N[(N[(N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * N[(N[(-0.125 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] * N[(-0.5 * N[(N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * 0.25), $MachinePrecision] * M), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\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^{+262}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(D \cdot \frac{M}{d}\right) \cdot M, \left(-0.125 \cdot \frac{h}{\ell}\right) \cdot \frac{D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\

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


\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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.4%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\color{blue}{\left(\frac{D}{2 \cdot d} \cdot M\right)} \cdot \frac{1}{2}\right)\right) \cdot \frac{h}{\ell}\right) \]
      22. lower-/.f6447.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(\frac{-1}{2}, \frac{\left(\left(\left(\color{blue}{\left(\frac{D}{d} \cdot M\right)} \cdot \frac{1}{4}\right) \cdot M\right) \cdot D\right) \cdot h}{d \cdot \ell}, 1\right)}{\sqrt{h \cdot \ell}} \]
      16. lower-*.f6472.2%

        \[\leadsto \frac{\left|d\right| \cdot \mathsf{fma}\left(-0.5, \frac{\left(\left(\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.25\right) \cdot M\right) \cdot D\right) \cdot h}{\color{blue}{d \cdot \ell}}, 1\right)}{\sqrt{h \cdot \ell}} \]
    8. Applied rewrites72.2%

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

Alternative 8: 76.5% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

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


\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)))) < 9.9999999999999996e-234 or 5.0000000000000001e262 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e-234 < (*.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.0000000000000001e262

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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. *-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) \]
      3. lower-*.f6465.9%

        \[\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) \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\color{blue}{{\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) \]
      5. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{\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) \]
      6. 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) \]
      7. unpow1/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) \]
      8. lower-sqrt.f6465.9%

        \[\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) \]
      9. lift-pow.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\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) \]
      11. 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) \]
      12. unpow1/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) \]
      13. lower-sqrt.f6465.9%

        \[\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) \]
    3. Applied rewrites65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.9% accurate, 0.4× speedup?

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

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

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


\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)))) < -3.9999999999999997e-129

    1. Initial program 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\sqrt{\frac{h}{d} \cdot \frac{h}{d}}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      4. lower-*.f6415.0%

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

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

    if -3.9999999999999997e-129 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

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

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

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

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

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

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

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

    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 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      3. lower-*.f6411.6%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
      9. lower-neg.f6411.6%

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

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

Alternative 10: 52.7% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\sqrt{\frac{d}{\ell} \cdot \frac{d}{\ell}}}}{h} \]
      4. lower-*.f6414.6%

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

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

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

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

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

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

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

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

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

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

    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 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      3. lower-*.f6411.6%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
      9. lower-neg.f6411.6%

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

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

Alternative 11: 51.9% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

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

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

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

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

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

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

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

    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 65.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      3. lower-*.f6411.6%

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
      9. lower-neg.f6411.6%

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

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

Alternative 12: 50.9% accurate, 0.4× speedup?

\[\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 -2 \cdot 10^{-130}:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d}{\ell \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)}{h}\\ \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 -2e-130)
     (/ (* -1.0 (* d t_0)) h)
     (if (<= t_1 INFINITY)
       (/ d (* l t_0))
       (/ (* (sqrt (/ d l)) (* (- d) (sqrt (/ h 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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = d / (l * t_0);
	} else {
		tmp = (sqrt((d / l)) * (-d * sqrt((h / 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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = d / (l * t_0);
	} else {
		tmp = (Math.sqrt((d / l)) * (-d * Math.sqrt((h / 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 <= -2e-130:
		tmp = (-1.0 * (d * t_0)) / h
	elif t_1 <= math.inf:
		tmp = d / (l * t_0)
	else:
		tmp = (math.sqrt((d / l)) * (-d * math.sqrt((h / 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 <= -2e-130)
		tmp = Float64(Float64(-1.0 * Float64(d * t_0)) / h);
	elseif (t_1 <= Inf)
		tmp = Float64(d / Float64(l * t_0));
	else
		tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(Float64(-d) * sqrt(Float64(h / 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 <= -2e-130)
		tmp = (-1.0 * (d * t_0)) / h;
	elseif (t_1 <= Inf)
		tmp = d / (l * t_0);
	else
		tmp = (sqrt((d / l)) * (-d * sqrt((h / 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[LessEqual[t$95$1, -2e-130], N[(N[(-1.0 * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(d / N[(l * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[((-d) * N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]]]]]
\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 -2 \cdot 10^{-130}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\

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

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


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

    1. Initial program 65.9%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{\color{blue}{h}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      5. lower-pow.f6418.3%

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
    5. Applied rewrites18.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    6. Taylor expanded in d around -inf

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      4. lower-/.f6413.7%

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    8. Applied rewrites13.7%

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]

    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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Taylor expanded in h around 0

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{\color{blue}{h}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

      \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      4. lower-/.f6411.6%

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    7. Applied rewrites11.6%

      \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      3. lower-*.f6411.6%

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      5. mul-1-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\mathsf{neg}\left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\mathsf{neg}\left(d \cdot \sqrt{\frac{h}{d}}\right)\right)}{h} \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(\mathsf{neg}\left(d\right)\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
      9. lower-neg.f6411.6%

        \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
    9. Applied rewrites11.6%

      \[\leadsto \frac{\sqrt{\frac{d}{\ell}} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)}{h} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 49.8% accurate, 0.4× speedup?

\[\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 -2 \cdot 10^{-130}:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d}{\ell \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{h} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)\\ \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 -2e-130)
     (/ (* -1.0 (* d t_0)) h)
     (if (<= t_1 INFINITY)
       (/ d (* l t_0))
       (* (/ (sqrt (/ d l)) h) (* (- d) (sqrt (/ h d))))))))
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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = d / (l * t_0);
	} else {
		tmp = (sqrt((d / l)) / h) * (-d * sqrt((h / d)));
	}
	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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = d / (l * t_0);
	} else {
		tmp = (Math.sqrt((d / l)) / h) * (-d * Math.sqrt((h / d)));
	}
	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 <= -2e-130:
		tmp = (-1.0 * (d * t_0)) / h
	elif t_1 <= math.inf:
		tmp = d / (l * t_0)
	else:
		tmp = (math.sqrt((d / l)) / h) * (-d * math.sqrt((h / d)))
	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 <= -2e-130)
		tmp = Float64(Float64(-1.0 * Float64(d * t_0)) / h);
	elseif (t_1 <= Inf)
		tmp = Float64(d / Float64(l * t_0));
	else
		tmp = Float64(Float64(sqrt(Float64(d / l)) / h) * Float64(Float64(-d) * sqrt(Float64(h / d))));
	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 <= -2e-130)
		tmp = (-1.0 * (d * t_0)) / h;
	elseif (t_1 <= Inf)
		tmp = d / (l * t_0);
	else
		tmp = (sqrt((d / l)) / h) * (-d * 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]}, 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, -2e-130], N[(N[(-1.0 * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(d / N[(l * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / h), $MachinePrecision] * N[((-d) * N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\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 -2 \cdot 10^{-130}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d}{\ell \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{h} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000002e-130

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Applied rewrites35.0%

      \[\leadsto \color{blue}{\frac{\left(\ell - \left(\left(M \cdot M\right) \cdot 0.25\right) \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \left(0.5 \cdot h\right)\right)\right) \cdot \sqrt{d \cdot \frac{d}{h \cdot \ell}}}{\ell}} \]
    3. Taylor expanded in h around 0

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{\color{blue}{h}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      5. lower-pow.f6418.3%

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
    5. Applied rewrites18.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    6. Taylor expanded in d around -inf

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      4. lower-/.f6413.7%

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    8. Applied rewrites13.7%

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]

    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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Taylor expanded in h around 0

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{\color{blue}{h}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      6. lower-/.f6423.4%

        \[\leadsto \frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    4. Applied rewrites23.4%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot h} \cdot \sqrt{\frac{d}{\ell}}}{h}} \]
    5. Taylor expanded in d around -inf

      \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      4. lower-/.f6411.6%

        \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    7. Applied rewrites11.6%

      \[\leadsto \frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Applied rewrites10.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{\ell}}}{h} \cdot \left(\left(-d\right) \cdot \sqrt{\frac{h}{d}}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 49.4% accurate, 3.1× speedup?

\[\begin{array}{l} \mathbf{if}\;\ell \leq -2.7 \cdot 10^{-271}:\\ \;\;\;\;\frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\left|h\right|}}\\ \mathbf{elif}\;\ell \leq 3.2 \cdot 10^{-282}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h}\\ \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{-135}:\\ \;\;\;\;\frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -2.7e-271)
   (/ (- d) (* (sqrt (fabs l)) (sqrt (fabs h))))
   (if (<= l 3.2e-282)
     (/ (* (sqrt (/ h l)) (fabs d)) h)
     (if (<= l 1.25e-135)
       (/ (- d) (sqrt (* (sqrt (* (* l l) h)) (sqrt h))))
       (/ d (sqrt (* h l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -2.7e-271) {
		tmp = -d / (sqrt(fabs(l)) * sqrt(fabs(h)));
	} else if (l <= 3.2e-282) {
		tmp = (sqrt((h / l)) * fabs(d)) / h;
	} else if (l <= 1.25e-135) {
		tmp = -d / sqrt((sqrt(((l * l) * h)) * sqrt(h)));
	} else {
		tmp = d / sqrt((h * l));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-2.7d-271)) then
        tmp = -d / (sqrt(abs(l)) * sqrt(abs(h)))
    else if (l <= 3.2d-282) then
        tmp = (sqrt((h / l)) * abs(d)) / h
    else if (l <= 1.25d-135) then
        tmp = -d / sqrt((sqrt(((l * l) * h)) * sqrt(h)))
    else
        tmp = d / sqrt((h * l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -2.7e-271) {
		tmp = -d / (Math.sqrt(Math.abs(l)) * Math.sqrt(Math.abs(h)));
	} else if (l <= 3.2e-282) {
		tmp = (Math.sqrt((h / l)) * Math.abs(d)) / h;
	} else if (l <= 1.25e-135) {
		tmp = -d / Math.sqrt((Math.sqrt(((l * l) * h)) * Math.sqrt(h)));
	} else {
		tmp = d / Math.sqrt((h * l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -2.7e-271:
		tmp = -d / (math.sqrt(math.fabs(l)) * math.sqrt(math.fabs(h)))
	elif l <= 3.2e-282:
		tmp = (math.sqrt((h / l)) * math.fabs(d)) / h
	elif l <= 1.25e-135:
		tmp = -d / math.sqrt((math.sqrt(((l * l) * h)) * math.sqrt(h)))
	else:
		tmp = d / math.sqrt((h * l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -2.7e-271)
		tmp = Float64(Float64(-d) / Float64(sqrt(abs(l)) * sqrt(abs(h))));
	elseif (l <= 3.2e-282)
		tmp = Float64(Float64(sqrt(Float64(h / l)) * abs(d)) / h);
	elseif (l <= 1.25e-135)
		tmp = Float64(Float64(-d) / sqrt(Float64(sqrt(Float64(Float64(l * l) * h)) * sqrt(h))));
	else
		tmp = Float64(d / sqrt(Float64(h * l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -2.7e-271)
		tmp = -d / (sqrt(abs(l)) * sqrt(abs(h)));
	elseif (l <= 3.2e-282)
		tmp = (sqrt((h / l)) * abs(d)) / h;
	elseif (l <= 1.25e-135)
		tmp = -d / sqrt((sqrt(((l * l) * h)) * sqrt(h)));
	else
		tmp = d / sqrt((h * l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.7e-271], N[((-d) / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[h], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e-282], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[l, 1.25e-135], N[((-d) / N[Sqrt[N[(N[Sqrt[N[(N[(l * l), $MachinePrecision] * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{-271}:\\
\;\;\;\;\frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\left|h\right|}}\\

\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{-282}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h}\\

\mathbf{elif}\;\ell \leq 1.25 \cdot 10^{-135}:\\
\;\;\;\;\frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -2.6999999999999999e-271

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{h \cdot \ell}} \]
      2. sqrt-fabs-revN/A

        \[\leadsto \frac{-d}{\left|\sqrt{h \cdot \ell}\right|} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{-d}{\left|\sqrt{h \cdot \ell}\right|} \]
      4. rem-sqrt-square-revN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}} \]
      5. lift-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}} \]
      7. sqrt-unprodN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}} \]
      8. rem-sqrt-squareN/A

        \[\leadsto \frac{-d}{\sqrt{\left|h \cdot \ell\right|}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\left|h \cdot \ell\right|}} \]
      10. *-commutativeN/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell \cdot h\right|}} \]
      11. fabs-mulN/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right| \cdot \left|h\right|}} \]
      12. sqrt-prodN/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \color{blue}{\sqrt{\left|h\right|}}} \]
      13. lower-unsound-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \color{blue}{\sqrt{\left|h\right|}}} \]
      14. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\color{blue}{\left|h\right|}}} \]
      15. lower-fabs.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\left|\color{blue}{h}\right|}} \]
      16. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\left|h\right|}} \]
      17. lower-fabs.f6428.9%

        \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \sqrt{\left|h\right|}} \]
    10. Applied rewrites28.9%

      \[\leadsto \frac{-d}{\sqrt{\left|\ell\right|} \cdot \color{blue}{\sqrt{\left|h\right|}}} \]

    if -2.6999999999999999e-271 < l < 3.1999999999999998e-282

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Applied rewrites35.0%

      \[\leadsto \color{blue}{\frac{\left(\ell - \left(\left(M \cdot M\right) \cdot 0.25\right) \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \left(0.5 \cdot h\right)\right)\right) \cdot \sqrt{d \cdot \frac{d}{h \cdot \ell}}}{\ell}} \]
    3. Taylor expanded in h around 0

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{\color{blue}{h}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      5. lower-pow.f6418.3%

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
    5. Applied rewrites18.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    6. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      4. lift-pow.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      5. pow2N/A

        \[\leadsto \frac{\sqrt{\frac{\left(d \cdot d\right) \cdot h}{\ell}}}{h} \]
      6. associate-/l*N/A

        \[\leadsto \frac{\sqrt{\left(d \cdot d\right) \cdot \frac{h}{\ell}}}{h} \]
      7. lift-/.f64N/A

        \[\leadsto \frac{\sqrt{\left(d \cdot d\right) \cdot \frac{h}{\ell}}}{h} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell} \cdot \left(d \cdot d\right)}}{h} \]
      9. sqrt-prodN/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \sqrt{d \cdot d}}{h} \]
      10. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \sqrt{d \cdot d}}{h} \]
      11. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \sqrt{d \cdot d}}{h} \]
      12. rem-sqrt-square-revN/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h} \]
      13. lift-fabs.f64N/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h} \]
      14. lower-unsound-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h} \]
      15. lower-unsound-sqrt.f6424.8%

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{h} \]
    7. Applied rewrites24.8%

      \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left|d\right|}{\color{blue}{h}} \]

    if 3.1999999999999998e-282 < l < 1.25e-135

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}} \]
      2. sqrt-unprodN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}} \]
      4. associate-*l*N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{h \cdot \left(\ell \cdot \left(h \cdot \ell\right)\right)}}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \left(h \cdot \ell\right)\right) \cdot h}}} \]
      6. sqrt-prodN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\ell \cdot \left(h \cdot \ell\right)} \cdot \sqrt{h}}} \]
      7. lower-unsound-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\ell \cdot \left(h \cdot \ell\right)} \cdot \sqrt{h}}} \]
      8. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\ell \cdot \left(h \cdot \ell\right)} \cdot \sqrt{h}}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\ell \cdot \left(h \cdot \ell\right)} \cdot \sqrt{h}}} \]
      10. *-commutativeN/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\ell \cdot \left(\ell \cdot h\right)} \cdot \sqrt{h}}} \]
      11. associate-*r*N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}} \]
      14. lower-unsound-sqrt.f649.7%

        \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}} \]
    10. Applied rewrites9.7%

      \[\leadsto \frac{-d}{\sqrt{\sqrt{\left(\ell \cdot \ell\right) \cdot h} \cdot \sqrt{h}}} \]

    if 1.25e-135 < l

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in d around inf

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      3. lower-*.f6426.2%

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
    11. Applied rewrites26.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 15: 49.0% accurate, 0.5× speedup?

\[\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 -2 \cdot 10^{-130}:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{d}{\ell \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}}\\ \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 -2e-130)
     (/ (* -1.0 (* d t_0)) h)
     (if (<= t_1 INFINITY) (/ d (* l t_0)) (/ (- d) (* h (sqrt (/ l 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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = d / (l * t_0);
	} else {
		tmp = -d / (h * sqrt((l / 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 <= -2e-130) {
		tmp = (-1.0 * (d * t_0)) / h;
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = d / (l * t_0);
	} else {
		tmp = -d / (h * Math.sqrt((l / 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 <= -2e-130:
		tmp = (-1.0 * (d * t_0)) / h
	elif t_1 <= math.inf:
		tmp = d / (l * t_0)
	else:
		tmp = -d / (h * math.sqrt((l / 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 <= -2e-130)
		tmp = Float64(Float64(-1.0 * Float64(d * t_0)) / h);
	elseif (t_1 <= Inf)
		tmp = Float64(d / Float64(l * t_0));
	else
		tmp = Float64(Float64(-d) / Float64(h * sqrt(Float64(l / 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 <= -2e-130)
		tmp = (-1.0 * (d * t_0)) / h;
	elseif (t_1 <= Inf)
		tmp = d / (l * t_0);
	else
		tmp = -d / (h * sqrt((l / 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, -2e-130], N[(N[(-1.0 * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(d / N[(l * t$95$0), $MachinePrecision]), $MachinePrecision], N[((-d) / N[(h * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\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 -2 \cdot 10^{-130}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot t\_0\right)}{h}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d}{\ell \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000002e-130

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Applied rewrites35.0%

      \[\leadsto \color{blue}{\frac{\left(\ell - \left(\left(M \cdot M\right) \cdot 0.25\right) \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \left(0.5 \cdot h\right)\right)\right) \cdot \sqrt{d \cdot \frac{d}{h \cdot \ell}}}{\ell}} \]
    3. Taylor expanded in h around 0

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{\color{blue}{h}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
      5. lower-pow.f6418.3%

        \[\leadsto \frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h} \]
    5. Applied rewrites18.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{{d}^{2} \cdot h}{\ell}}}{h}} \]
    6. Taylor expanded in d around -inf

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
      4. lower-/.f6413.7%

        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
    8. Applied rewrites13.7%

      \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]

    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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in h around inf

      \[\leadsto \frac{-d}{h \cdot \color{blue}{\sqrt{\frac{\ell}{h}}}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
      3. lower-/.f6412.6%

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
    11. Applied rewrites12.6%

      \[\leadsto \frac{-d}{h \cdot \color{blue}{\sqrt{\frac{\ell}{h}}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 48.1% accurate, 0.5× speedup?

\[\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 := \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ (- d) (* h (sqrt (/ l h))))))
   (if (<= t_0 -2e-130)
     t_1
     (if (<= t_0 INFINITY) (/ d (* l (sqrt (/ h l)))) t_1))))
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 = -d / (h * sqrt((l / h)));
	double tmp;
	if (t_0 <= -2e-130) {
		tmp = t_1;
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = d / (l * sqrt((h / l)));
	} else {
		tmp = t_1;
	}
	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 = -d / (h * Math.sqrt((l / h)));
	double tmp;
	if (t_0 <= -2e-130) {
		tmp = t_1;
	} else if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = d / (l * Math.sqrt((h / l)));
	} else {
		tmp = t_1;
	}
	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 = -d / (h * math.sqrt((l / h)))
	tmp = 0
	if t_0 <= -2e-130:
		tmp = t_1
	elif t_0 <= math.inf:
		tmp = d / (l * math.sqrt((h / l)))
	else:
		tmp = t_1
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	t_1 = Float64(Float64(-d) / Float64(h * sqrt(Float64(l / h))))
	tmp = 0.0
	if (t_0 <= -2e-130)
		tmp = t_1;
	elseif (t_0 <= Inf)
		tmp = Float64(d / Float64(l * sqrt(Float64(h / l))));
	else
		tmp = t_1;
	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 = -d / (h * sqrt((l / h)));
	tmp = 0.0;
	if (t_0 <= -2e-130)
		tmp = t_1;
	elseif (t_0 <= Inf)
		tmp = d / (l * sqrt((h / l)));
	else
		tmp = t_1;
	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[((-d) / N[(h * N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-130], t$95$1, If[LessEqual[t$95$0, Infinity], N[(d / N[(l * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\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 := \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\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)))) < -2.0000000000000002e-130 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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in h around inf

      \[\leadsto \frac{-d}{h \cdot \color{blue}{\sqrt{\frac{\ell}{h}}}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
      3. lower-/.f6412.6%

        \[\leadsto \frac{-d}{h \cdot \sqrt{\frac{\ell}{h}}} \]
    11. Applied rewrites12.6%

      \[\leadsto \frac{-d}{h \cdot \color{blue}{\sqrt{\frac{\ell}{h}}}} \]

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 44.2% accurate, 0.5× speedup?

\[\begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-130}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{elif}\;t\_0 \leq \infty:\\ \;\;\;\;\frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{-1}{\sqrt{\ell \cdot h}}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
          (-
           1.0
           (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
   (if (<= t_0 -2e-130)
     (/ d (sqrt (* h l)))
     (if (<= t_0 INFINITY)
       (/ d (* l (sqrt (/ h l))))
       (* d (/ -1.0 (sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double tmp;
	if (t_0 <= -2e-130) {
		tmp = d / sqrt((h * l));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = d / (l * sqrt((h / l)));
	} else {
		tmp = d * (-1.0 / sqrt((l * h)));
	}
	return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double tmp;
	if (t_0 <= -2e-130) {
		tmp = d / Math.sqrt((h * l));
	} else if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = d / (l * Math.sqrt((h / l)));
	} else {
		tmp = d * (-1.0 / Math.sqrt((l * h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
	tmp = 0
	if t_0 <= -2e-130:
		tmp = d / math.sqrt((h * l))
	elif t_0 <= math.inf:
		tmp = d / (l * math.sqrt((h / l)))
	else:
		tmp = d * (-1.0 / math.sqrt((l * h)))
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	tmp = 0.0
	if (t_0 <= -2e-130)
		tmp = Float64(d / sqrt(Float64(h * l)));
	elseif (t_0 <= Inf)
		tmp = Float64(d / Float64(l * sqrt(Float64(h / l))));
	else
		tmp = Float64(d * Float64(-1.0 / sqrt(Float64(l * h))));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
	tmp = 0.0;
	if (t_0 <= -2e-130)
		tmp = d / sqrt((h * l));
	elseif (t_0 <= Inf)
		tmp = d / (l * sqrt((h / l)));
	else
		tmp = d * (-1.0 / sqrt((l * h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-130], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(d / N[(l * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(-1.0 / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-130}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}}\\

\mathbf{else}:\\
\;\;\;\;d \cdot \frac{-1}{\sqrt{\ell \cdot h}}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000002e-130

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in d around inf

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      3. lower-*.f6426.2%

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
    11. Applied rewrites26.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]

    if -2.0000000000000002e-130 < (*.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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in l around -inf

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \color{blue}{\sqrt{\frac{h}{\ell}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
      4. lower-/.f6439.4%

        \[\leadsto \frac{d}{\ell \cdot \sqrt{\frac{h}{\ell}}} \]
    11. Applied rewrites39.4%

      \[\leadsto \frac{d}{\color{blue}{\ell \cdot \sqrt{\frac{h}{\ell}}}} \]

    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 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. frac-2negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(-d\right)\right)}{\color{blue}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      3. mult-flipN/A

        \[\leadsto \left(\mathsf{neg}\left(\left(-d\right)\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      4. lift-neg.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(d\right)\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)} \]
      5. remove-double-negN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)} \]
      6. lower-*.f64N/A

        \[\leadsto d \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}} \]
      7. metadata-evalN/A

        \[\leadsto d \cdot \frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{\sqrt{h \cdot \ell}}\right)} \]
      8. frac-2neg-revN/A

        \[\leadsto d \cdot \frac{-1}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      9. lower-/.f6426.7%

        \[\leadsto d \cdot \frac{-1}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      10. lift-*.f64N/A

        \[\leadsto d \cdot \frac{-1}{\sqrt{h \cdot \ell}} \]
      11. *-commutativeN/A

        \[\leadsto d \cdot \frac{-1}{\sqrt{\ell \cdot h}} \]
      12. lower-*.f6426.7%

        \[\leadsto d \cdot \frac{-1}{\sqrt{\ell \cdot h}} \]
    10. Applied rewrites26.7%

      \[\leadsto d \cdot \color{blue}{\frac{-1}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 43.0% accurate, 6.8× speedup?

\[\begin{array}{l} t_0 := \sqrt{h \cdot \ell}\\ \mathbf{if}\;d \leq -4 \cdot 10^{-253}:\\ \;\;\;\;\frac{-d}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{t\_0}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (* h l)))) (if (<= d -4e-253) (/ (- d) t_0) (/ d t_0))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((h * l));
	double tmp;
	if (d <= -4e-253) {
		tmp = -d / t_0;
	} else {
		tmp = d / t_0;
	}
	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 <= (-4d-253)) then
        tmp = -d / t_0
    else
        tmp = d / t_0
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((h * l));
	double tmp;
	if (d <= -4e-253) {
		tmp = -d / t_0;
	} else {
		tmp = d / t_0;
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = math.sqrt((h * l))
	tmp = 0
	if d <= -4e-253:
		tmp = -d / t_0
	else:
		tmp = d / t_0
	return tmp
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(h * l))
	tmp = 0.0
	if (d <= -4e-253)
		tmp = Float64(Float64(-d) / t_0);
	else
		tmp = Float64(d / t_0);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((h * l));
	tmp = 0.0;
	if (d <= -4e-253)
		tmp = -d / t_0;
	else
		tmp = d / t_0;
	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, -4e-253], N[((-d) / t$95$0), $MachinePrecision], N[(d / t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sqrt{h \cdot \ell}\\
\mathbf{if}\;d \leq -4 \cdot 10^{-253}:\\
\;\;\;\;\frac{-d}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{t\_0}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < -4.0000000000000003e-253

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]

    if -4.0000000000000003e-253 < d

    1. Initial program 65.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Step-by-step derivation
      1. 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-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) \]
      3. 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) \]
      4. pow-prod-downN/A

        \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. lift-/.f64N/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      6. metadata-evalN/A

        \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. lift-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. lift-/.f64N/A

        \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. frac-timesN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-divN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. lower-unsound-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      15. lower-unsound-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      16. lower-*.f6447.9%

        \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Applied rewrites47.9%

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Taylor expanded in d around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      3. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
      4. lower-*.f6426.7%

        \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    6. Applied rewrites26.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      6. lower-neg.f6426.7%

        \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    8. Applied rewrites26.7%

      \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    9. Taylor expanded in d around inf

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
      3. lower-*.f6426.2%

        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
    11. Applied rewrites26.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 26.2% accurate, 10.1× speedup?

\[\frac{d}{\sqrt{h \cdot \ell}} \]
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
	return d / sqrt((h * l));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = d / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
	return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D):
	return d / math.sqrt((h * l))
function code(d, h, l, M, D)
	return Float64(d / sqrt(Float64(h * l)))
end
function tmp = code(d, h, l, M, D)
	tmp = d / sqrt((h * l));
end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\frac{d}{\sqrt{h \cdot \ell}}
Derivation
  1. Initial program 65.9%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Step-by-step derivation
    1. 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-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) \]
    3. 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) \]
    4. pow-prod-downN/A

      \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    5. lift-/.f64N/A

      \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    6. metadata-evalN/A

      \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \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. unpow1/2N/A

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    8. lift-/.f64N/A

      \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    9. lift-/.f64N/A

      \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    10. frac-timesN/A

      \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    11. sqrt-divN/A

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    12. lower-unsound-/.f64N/A

      \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    13. lower-unsound-sqrt.f64N/A

      \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    14. lower-*.f64N/A

      \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    15. lower-unsound-sqrt.f64N/A

      \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    16. lower-*.f6447.9%

      \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  3. Applied rewrites47.9%

    \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  4. Taylor expanded in d around -inf

    \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
  5. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    2. lower-/.f64N/A

      \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    3. lower-sqrt.f64N/A

      \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
    4. lower-*.f6426.7%

      \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
  6. Applied rewrites26.7%

    \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
    3. lift-/.f64N/A

      \[\leadsto \mathsf{neg}\left(\frac{d}{\sqrt{h \cdot \ell}}\right) \]
    4. distribute-neg-fracN/A

      \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    5. lower-/.f64N/A

      \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    6. lower-neg.f6426.7%

      \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
  8. Applied rewrites26.7%

    \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
  9. Taylor expanded in d around inf

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  10. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    2. lower-sqrt.f64N/A

      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
    3. lower-*.f6426.2%

      \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
  11. Applied rewrites26.2%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2025205 
(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)))))