Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.4% → 83.7%
Time: 10.3s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 66.4% 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: 83.7% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+187}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{t\_0 \cdot \left(M \cdot D\right)}{d}, 1\right)\\

\mathbf{else}:\\
\;\;\;\;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)))) < -2.00000000000000013e-158

    1. Initial program 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. metadata-eval66.9

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

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

    if -2.00000000000000013e-158 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0 or 5.0000000000000001e187 < (*.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 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. metadata-eval66.9

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

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

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

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

    1. Initial program 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

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

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

Alternative 2: 81.4% accurate, 0.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot \frac{\left|d\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.0000000000000001e187

    1. Initial program 66.4%

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

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

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

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

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

    if 5.0000000000000001e187 < (*.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 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. metadata-eval66.9

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot 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)))) < -0.0

    1. Initial program 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. metadata-eval66.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      15. rem-sqrt-square-revN/A

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

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

        \[\leadsto \frac{\color{blue}{\left|d\right|}}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{d} \cdot \frac{1}{4}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      18. lower-unsound-sqrt.f6469.8

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

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

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

    1. Initial program 66.4%

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      3. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
      5. distribute-lft-neg-outN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
      6. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
      9. unpow2N/A

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

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
    3. Applied rewrites66.9%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. metadata-eval66.9

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      10. metadata-eval66.9

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

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

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      13. lower-sqrt.f6466.9

        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
    5. Applied rewrites66.9%

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

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

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

      if 5.0000000000000001e187 < (*.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 66.4%

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
        6. distribute-rgt-neg-inN/A

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
        9. unpow2N/A

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
      3. Applied rewrites66.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. metadata-eval66.9

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        10. metadata-eval66.9

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. lower-sqrt.f6466.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. Applied rewrites66.9%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. metadata-eval66.9

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

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

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

    Alternative 4: 81.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^{+187}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{\frac{M \cdot D}{d} \cdot \left(M \cdot D\right)}{d}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot \frac{\left|d\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+187)
       (*
        (* (sqrt (/ d l)) (sqrt (/ d h)))
        (fma (/ h l) (* -0.125 (/ (* (/ (* M D) d) (* M D)) d)) 1.0))
       (*
        (fma (/ (* h (* D M)) (* (- l) (+ d d))) (* 0.25 (/ (* D M) d)) 1.0)
        (/ (fabs d) (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+187) {
    		tmp = (sqrt((d / l)) * sqrt((d / h))) * fma((h / l), (-0.125 * ((((M * D) / d) * (M * D)) / d)), 1.0);
    	} else {
    		tmp = fma(((h * (D * M)) / (-l * (d + d))), (0.25 * ((D * M) / d)), 1.0) * (fabs(d) / 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+187)
    		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * fma(Float64(h / l), Float64(-0.125 * Float64(Float64(Float64(Float64(M * D) / d) * Float64(M * D)) / d)), 1.0));
    	else
    		tmp = Float64(fma(Float64(Float64(h * Float64(D * M)) / Float64(Float64(-l) * Float64(d + d))), Float64(0.25 * Float64(Float64(D * M) / d)), 1.0) * Float64(abs(d) / 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+187], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * N[(-0.125 * N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(h * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[((-l) * N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $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^{+187}:\\
    \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\frac{h}{\ell}, -0.125 \cdot \frac{\frac{M \cdot D}{d} \cdot \left(M \cdot D\right)}{d}, 1\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot \frac{\left|d\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.0000000000000001e187

      1. Initial program 66.4%

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
        6. distribute-rgt-neg-inN/A

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
        9. unpow2N/A

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
      3. Applied rewrites66.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. metadata-eval66.9

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        10. metadata-eval66.9

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. lower-sqrt.f6466.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. Applied rewrites66.9%

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

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

      if 5.0000000000000001e187 < (*.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 66.4%

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
        6. distribute-rgt-neg-inN/A

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
        9. unpow2N/A

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
      3. Applied rewrites66.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. metadata-eval66.9

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        10. metadata-eval66.9

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. lower-sqrt.f6466.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. Applied rewrites66.9%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. metadata-eval66.9

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

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

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

    Alternative 5: 80.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 := \mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+187}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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
             (*
              (fma (/ (* h (* D M)) (* (- l) (+ d d))) (* 0.25 (/ (* D M) d)) 1.0)
              (/ (fabs d) (sqrt (* h l))))))
       (if (<= t_0 0.0)
         t_1
         (if (<= t_0 5e+187) (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0) 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 = fma(((h * (D * M)) / (-l * (d + d))), (0.25 * ((D * M) / d)), 1.0) * (fabs(d) / sqrt((h * l)));
    	double tmp;
    	if (t_0 <= 0.0) {
    		tmp = t_1;
    	} else if (t_0 <= 5e+187) {
    		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
    	} 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(fma(Float64(Float64(h * Float64(D * M)) / Float64(Float64(-l) * Float64(d + d))), Float64(0.25 * Float64(Float64(D * M) / d)), 1.0) * Float64(abs(d) / sqrt(Float64(h * l))))
    	tmp = 0.0
    	if (t_0 <= 0.0)
    		tmp = t_1;
    	elseif (t_0 <= 5e+187)
    		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(h * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[((-l) * N[(d + d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 5e+187], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $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 := \mathsf{fma}\left(\frac{h \cdot \left(D \cdot M\right)}{\left(-\ell\right) \cdot \left(d + d\right)}, 0.25 \cdot \frac{D \cdot M}{d}, 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}\\
    \mathbf{if}\;t\_0 \leq 0:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+187}:\\
    \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
    
    \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)))) < -0.0 or 5.0000000000000001e187 < (*.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 66.4%

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
        6. distribute-rgt-neg-inN/A

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
        9. unpow2N/A

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
      3. Applied rewrites66.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. metadata-eval66.9

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        10. metadata-eval66.9

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. lower-sqrt.f6466.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. Applied rewrites66.9%

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)} \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      6. 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}{\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{M \cdot D}{d} \cdot \frac{\frac{1}{2}}{2}}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. metadata-eval66.9

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

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

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

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

      1. Initial program 66.4%

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
        3. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
        6. distribute-rgt-neg-inN/A

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
        9. unpow2N/A

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

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

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

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
      3. Applied rewrites66.9%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. metadata-eval66.9

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

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

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        10. metadata-eval66.9

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        13. lower-sqrt.f6466.9

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
      5. Applied rewrites66.9%

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

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

          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 6: 73.0% accurate, 0.3× 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 -5 \cdot 10^{-151}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \frac{\frac{M \cdot D}{d} \cdot \left(M \cdot D\right)}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h \cdot \ell} \cdot d}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+213}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}\\ \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 -5e-151)
           (*
            (fma (* -0.125 (/ (* (/ (* M D) d) (* M D)) d)) (/ h l) 1.0)
            (sqrt (* (/ d (* h l)) d)))
           (if (<= t_0 0.0)
             (/ (* -1.0 (* d (* l (sqrt (/ 1.0 (* h l)))))) l)
             (if (<= t_0 5e+213)
               (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
               (*
                (/ (fabs d) (sqrt (* h l)))
                (/ (- l (* (* (* 0.125 (/ (* (* D M) D) (* d d))) M) h)) l)))))))
      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 <= -5e-151) {
      		tmp = fma((-0.125 * ((((M * D) / d) * (M * D)) / d)), (h / l), 1.0) * sqrt(((d / (h * l)) * d));
      	} else if (t_0 <= 0.0) {
      		tmp = (-1.0 * (d * (l * sqrt((1.0 / (h * l)))))) / l;
      	} else if (t_0 <= 5e+213) {
      		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
      	} else {
      		tmp = (fabs(d) / sqrt((h * l))) * ((l - (((0.125 * (((D * M) * D) / (d * d))) * M) * h)) / l);
      	}
      	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 <= -5e-151)
      		tmp = Float64(fma(Float64(-0.125 * Float64(Float64(Float64(Float64(M * D) / d) * Float64(M * D)) / d)), Float64(h / l), 1.0) * sqrt(Float64(Float64(d / Float64(h * l)) * d)));
      	elseif (t_0 <= 0.0)
      		tmp = Float64(Float64(-1.0 * Float64(d * Float64(l * sqrt(Float64(1.0 / Float64(h * l)))))) / l);
      	elseif (t_0 <= 5e+213)
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(h * l))) * Float64(Float64(l - Float64(Float64(Float64(0.125 * Float64(Float64(Float64(D * M) * D) / Float64(d * d))) * M) * h)) / l));
      	end
      	return tmp
      end
      
      code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-151], N[(N[(N[(-0.125 * N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(-1.0 * N[(d * N[(l * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t$95$0, 5e+213], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(l - N[(N[(N[(0.125 * N[(N[(N[(D * M), $MachinePrecision] * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / l), $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 -5 \cdot 10^{-151}:\\
      \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \frac{\frac{M \cdot D}{d} \cdot \left(M \cdot D\right)}{d}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{h \cdot \ell} \cdot d}\\
      
      \mathbf{elif}\;t\_0 \leq 0:\\
      \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+213}:\\
      \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.00000000000000003e-151

        1. Initial program 66.4%

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
          3. fp-cancel-sub-sign-invN/A

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
          5. distribute-lft-neg-outN/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
          6. distribute-rgt-neg-inN/A

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
          9. unpow2N/A

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
        3. Applied rewrites66.9%

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          5. metadata-eval66.9

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

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

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

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          10. metadata-eval66.9

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

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          13. lower-sqrt.f6466.9

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. Applied rewrites66.9%

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

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

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

        1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 66.4%

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
          3. fp-cancel-sub-sign-invN/A

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
          5. distribute-lft-neg-outN/A

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
          6. distribute-rgt-neg-inN/A

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
          9. unpow2N/A

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

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

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

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
        3. Applied rewrites66.9%

          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          5. metadata-eval66.9

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

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

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

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          10. metadata-eval66.9

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

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

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          13. lower-sqrt.f6466.9

            \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
        5. Applied rewrites66.9%

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

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

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

          if 4.9999999999999998e213 < (*.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 66.4%

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

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

            \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}} \]
        8. Recombined 4 regimes into one program.
        9. Add Preprocessing

        Alternative 7: 70.9% accurate, 0.3× speedup?

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

          1. Initial program 66.4%

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

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

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

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

          1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 66.4%

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
            3. fp-cancel-sub-sign-invN/A

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
            5. distribute-lft-neg-outN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
            6. distribute-rgt-neg-inN/A

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
            9. unpow2N/A

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
          3. Applied rewrites66.9%

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
          4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            5. metadata-eval66.9

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

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

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            10. metadata-eval66.9

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

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

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            13. lower-sqrt.f6466.9

              \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
          5. Applied rewrites66.9%

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

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

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

            if 4.9999999999999998e213 < (*.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 66.4%

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

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

              \[\leadsto \color{blue}{\frac{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}} \]
          8. Recombined 4 regimes into one program.
          9. Add Preprocessing

          Alternative 8: 70.8% accurate, 0.3× 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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-151}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+213}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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
                   (*
                    (/ (fabs d) (sqrt (* h l)))
                    (/ (- l (* (* (* 0.125 (/ (* (* D M) D) (* d d))) M) h)) l))))
             (if (<= t_0 -5e-151)
               t_1
               (if (<= t_0 0.0)
                 (/ (* -1.0 (* d (* l (sqrt (/ 1.0 (* h l)))))) l)
                 (if (<= t_0 5e+213) (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0) 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 = (fabs(d) / sqrt((h * l))) * ((l - (((0.125 * (((D * M) * D) / (d * d))) * M) * h)) / l);
          	double tmp;
          	if (t_0 <= -5e-151) {
          		tmp = t_1;
          	} else if (t_0 <= 0.0) {
          		tmp = (-1.0 * (d * (l * sqrt((1.0 / (h * l)))))) / l;
          	} else if (t_0 <= 5e+213) {
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
          	} else {
          		tmp = t_1;
          	}
          	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) :: t_1
              real(8) :: tmp
              t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
              t_1 = (abs(d) / sqrt((h * l))) * ((l - (((0.125d0 * (((d_1 * m) * d_1) / (d * d))) * m) * h)) / l)
              if (t_0 <= (-5d-151)) then
                  tmp = t_1
              else if (t_0 <= 0.0d0) then
                  tmp = ((-1.0d0) * (d * (l * sqrt((1.0d0 / (h * l)))))) / l
              else if (t_0 <= 5d+213) then
                  tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double d, double h, double l, double M, double D) {
          	double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
          	double t_1 = (Math.abs(d) / Math.sqrt((h * l))) * ((l - (((0.125 * (((D * M) * D) / (d * d))) * M) * h)) / l);
          	double tmp;
          	if (t_0 <= -5e-151) {
          		tmp = t_1;
          	} else if (t_0 <= 0.0) {
          		tmp = (-1.0 * (d * (l * Math.sqrt((1.0 / (h * l)))))) / l;
          	} else if (t_0 <= 5e+213) {
          		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
          	} 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 = (math.fabs(d) / math.sqrt((h * l))) * ((l - (((0.125 * (((D * M) * D) / (d * d))) * M) * h)) / l)
          	tmp = 0
          	if t_0 <= -5e-151:
          		tmp = t_1
          	elif t_0 <= 0.0:
          		tmp = (-1.0 * (d * (l * math.sqrt((1.0 / (h * l)))))) / l
          	elif t_0 <= 5e+213:
          		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
          	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(abs(d) / sqrt(Float64(h * l))) * Float64(Float64(l - Float64(Float64(Float64(0.125 * Float64(Float64(Float64(D * M) * D) / Float64(d * d))) * M) * h)) / l))
          	tmp = 0.0
          	if (t_0 <= -5e-151)
          		tmp = t_1;
          	elseif (t_0 <= 0.0)
          		tmp = Float64(Float64(-1.0 * Float64(d * Float64(l * sqrt(Float64(1.0 / Float64(h * l)))))) / l);
          	elseif (t_0 <= 5e+213)
          		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
          	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 = (abs(d) / sqrt((h * l))) * ((l - (((0.125 * (((D * M) * D) / (d * d))) * M) * h)) / l);
          	tmp = 0.0;
          	if (t_0 <= -5e-151)
          		tmp = t_1;
          	elseif (t_0 <= 0.0)
          		tmp = (-1.0 * (d * (l * sqrt((1.0 / (h * l)))))) / l;
          	elseif (t_0 <= 5e+213)
          		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
          	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[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(l - N[(N[(N[(0.125 * N[(N[(N[(D * M), $MachinePrecision] * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-151], t$95$1, If[LessEqual[t$95$0, 0.0], N[(N[(-1.0 * N[(d * N[(l * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], If[LessEqual[t$95$0, 5e+213], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $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{\left|d\right|}{\sqrt{h \cdot \ell}} \cdot \frac{\ell - \left(\left(0.125 \cdot \frac{\left(D \cdot M\right) \cdot D}{d \cdot d}\right) \cdot M\right) \cdot h}{\ell}\\
          \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-151}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t\_0 \leq 0:\\
          \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\
          
          \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+213}:\\
          \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
          
          \mathbf{else}:\\
          \;\;\;\;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)))) < -5.00000000000000003e-151 or 4.9999999999999998e213 < (*.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 66.4%

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

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

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

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

            1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 66.4%

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
              3. fp-cancel-sub-sign-invN/A

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
              5. distribute-lft-neg-outN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
              6. distribute-rgt-neg-inN/A

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
              9. unpow2N/A

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
            3. Applied rewrites66.9%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
            4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              5. metadata-eval66.9

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

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

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

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

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              10. metadata-eval66.9

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

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

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              13. lower-sqrt.f6466.9

                \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
            5. Applied rewrites66.9%

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

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

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

            Alternative 9: 52.3% accurate, 0.3× speedup?

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

              1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 66.4%

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

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
                3. fp-cancel-sub-sign-invN/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
                5. distribute-lft-neg-outN/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
                6. distribute-rgt-neg-inN/A

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

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
                9. unpow2N/A

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

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

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
              3. Applied rewrites66.9%

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
              4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                5. metadata-eval66.9

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

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

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

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

                  \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                10. metadata-eval66.9

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

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

                  \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                13. lower-sqrt.f6466.9

                  \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
              5. Applied rewrites66.9%

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

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

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

                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 66.4%

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

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

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

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

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

              Alternative 10: 52.2% accurate, 0.3× speedup?

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

                1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\mathsf{neg}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot h\right)}{h} \]
                  8. distribute-rgt-neg-inN/A

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

                    \[\leadsto \frac{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(-h\right)}{h} \]
                  10. lower-*.f649.6

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

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

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

                1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 66.4%

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

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
                  3. fp-cancel-sub-sign-invN/A

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
                  5. distribute-lft-neg-outN/A

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
                  6. distribute-rgt-neg-inN/A

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

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
                  9. unpow2N/A

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

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

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
                3. Applied rewrites66.9%

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
                4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  5. metadata-eval66.9

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

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

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

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

                    \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  10. metadata-eval66.9

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

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

                    \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  13. lower-sqrt.f6466.9

                    \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                5. Applied rewrites66.9%

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

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

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

                  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 66.4%

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

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

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

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

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

                Alternative 11: 49.6% 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 -5 \cdot 10^{-151}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h \cdot \ell} \cdot d} \cdot \left(-h\right)}{h}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 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))))))
                   (if (<= t_0 -5e-151)
                     (/ (* (sqrt (* (/ d (* h l)) d)) (- h)) h)
                     (if (<= t_0 0.0)
                       (/ (* -1.0 (* d (* l (sqrt (/ 1.0 (* h l)))))) l)
                       (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)))))
                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 <= -5e-151) {
                		tmp = (sqrt(((d / (h * l)) * d)) * -h) / h;
                	} else if (t_0 <= 0.0) {
                		tmp = (-1.0 * (d * (l * sqrt((1.0 / (h * l)))))) / l;
                	} else {
                		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.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 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                    if (t_0 <= (-5d-151)) then
                        tmp = (sqrt(((d / (h * l)) * d)) * -h) / h
                    else if (t_0 <= 0.0d0) then
                        tmp = ((-1.0d0) * (d * (l * sqrt((1.0d0 / (h * l)))))) / l
                    else
                        tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
                    end if
                    code = tmp
                end function
                
                public static double code(double d, double h, double l, double M, double D) {
                	double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
                	double tmp;
                	if (t_0 <= -5e-151) {
                		tmp = (Math.sqrt(((d / (h * l)) * d)) * -h) / h;
                	} else if (t_0 <= 0.0) {
                		tmp = (-1.0 * (d * (l * Math.sqrt((1.0 / (h * l)))))) / l;
                	} else {
                		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
                	}
                	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 <= -5e-151:
                		tmp = (math.sqrt(((d / (h * l)) * d)) * -h) / h
                	elif t_0 <= 0.0:
                		tmp = (-1.0 * (d * (l * math.sqrt((1.0 / (h * l)))))) / l
                	else:
                		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
                	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 <= -5e-151)
                		tmp = Float64(Float64(sqrt(Float64(Float64(d / Float64(h * l)) * d)) * Float64(-h)) / h);
                	elseif (t_0 <= 0.0)
                		tmp = Float64(Float64(-1.0 * Float64(d * Float64(l * sqrt(Float64(1.0 / Float64(h * l)))))) / l);
                	else
                		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
                	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 <= -5e-151)
                		tmp = (sqrt(((d / (h * l)) * d)) * -h) / h;
                	elseif (t_0 <= 0.0)
                		tmp = (-1.0 * (d * (l * sqrt((1.0 / (h * l)))))) / l;
                	else
                		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
                	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, -5e-151], N[(N[(N[Sqrt[N[(N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision] * (-h)), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(-1.0 * N[(d * N[(l * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $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 -5 \cdot 10^{-151}:\\
                \;\;\;\;\frac{\sqrt{\frac{d}{h \cdot \ell} \cdot d} \cdot \left(-h\right)}{h}\\
                
                \mathbf{elif}\;t\_0 \leq 0:\\
                \;\;\;\;\frac{-1 \cdot \left(d \cdot \left(\ell \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\right)}{\ell}\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 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)))) < -5.00000000000000003e-151

                  1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\mathsf{neg}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot h\right)}{h} \]
                    8. distribute-rgt-neg-inN/A

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

                      \[\leadsto \frac{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(-h\right)}{h} \]
                    10. lower-*.f649.6

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

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

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

                  1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 66.4%

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

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

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
                    3. fp-cancel-sub-sign-invN/A

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

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
                    5. distribute-lft-neg-outN/A

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
                    6. distribute-rgt-neg-inN/A

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

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

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
                    9. unpow2N/A

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

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

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

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
                  3. Applied rewrites66.9%

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
                  4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    5. metadata-eval66.9

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

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

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

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

                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    10. metadata-eval66.9

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

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

                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    13. lower-sqrt.f6466.9

                      \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                  5. Applied rewrites66.9%

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

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

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

                  Alternative 12: 48.6% accurate, 0.8× 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 -2 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h \cdot \ell} \cdot d} \cdot \left(-h\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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))))
                        -2e-158)
                     (/ (* (sqrt (* (/ d (* h l)) d)) (- h)) h)
                     (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)))
                  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)))) <= -2e-158) {
                  		tmp = (sqrt(((d / (h * l)) * d)) * -h) / h;
                  	} else {
                  		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.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) :: tmp
                      if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-2d-158)) then
                          tmp = (sqrt(((d / (h * l)) * d)) * -h) / h
                      else
                          tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double d, double h, double l, double M, double D) {
                  	double tmp;
                  	if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2e-158) {
                  		tmp = (Math.sqrt(((d / (h * l)) * d)) * -h) / h;
                  	} else {
                  		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(d, h, l, M, D):
                  	tmp = 0
                  	if ((math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2e-158:
                  		tmp = (math.sqrt(((d / (h * l)) * d)) * -h) / h
                  	else:
                  		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
                  	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)))) <= -2e-158)
                  		tmp = Float64(Float64(sqrt(Float64(Float64(d / Float64(h * l)) * d)) * Float64(-h)) / h);
                  	else
                  		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(d, h, l, M, D)
                  	tmp = 0.0;
                  	if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -2e-158)
                  		tmp = (sqrt(((d / (h * l)) * d)) * -h) / h;
                  	else
                  		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-158], N[(N[(N[Sqrt[N[(N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision] * (-h)), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $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 -2 \cdot 10^{-158}:\\
                  \;\;\;\;\frac{\sqrt{\frac{d}{h \cdot \ell} \cdot d} \cdot \left(-h\right)}{h}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 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.00000000000000013e-158

                    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{\mathsf{neg}\left(\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot h\right)}{h} \]
                      8. distribute-rgt-neg-inN/A

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

                        \[\leadsto \frac{\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(-h\right)}{h} \]
                      10. lower-*.f649.6

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

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

                    if -2.00000000000000013e-158 < (*.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 66.4%

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

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
                      3. fp-cancel-sub-sign-invN/A

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
                      5. distribute-lft-neg-outN/A

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
                      6. distribute-rgt-neg-inN/A

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

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
                      9. unpow2N/A

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

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

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

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
                    3. Applied rewrites66.9%

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
                    4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      5. metadata-eval66.9

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

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

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

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

                        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      10. metadata-eval66.9

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

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

                        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      13. lower-sqrt.f6466.9

                        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                    5. Applied rewrites66.9%

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

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

                        \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
                    8. Recombined 2 regimes into one program.
                    9. Add Preprocessing

                    Alternative 13: 46.4% accurate, 0.8× 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 0:\\ \;\;\;\;\frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\ \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))))
                          0.0)
                       (/ (* -1.0 (* d (sqrt (/ h l)))) h)
                       (* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)))
                    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)))) <= 0.0) {
                    		tmp = (-1.0 * (d * sqrt((h / l)))) / h;
                    	} else {
                    		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.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) :: tmp
                        if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= 0.0d0) then
                            tmp = ((-1.0d0) * (d * sqrt((h / l)))) / h
                        else
                            tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0d0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double d, double h, double l, double M, double D) {
                    	double tmp;
                    	if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 0.0) {
                    		tmp = (-1.0 * (d * Math.sqrt((h / l)))) / h;
                    	} else {
                    		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
                    	}
                    	return tmp;
                    }
                    
                    def code(d, h, l, M, D):
                    	tmp = 0
                    	if ((math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= 0.0:
                    		tmp = (-1.0 * (d * math.sqrt((h / l)))) / h
                    	else:
                    		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0
                    	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)))) <= 0.0)
                    		tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / l)))) / h);
                    	else
                    		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(d, h, l, M, D)
                    	tmp = 0.0;
                    	if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= 0.0)
                    		tmp = (-1.0 * (d * sqrt((h / l)))) / h;
                    	else
                    		tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $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 0:\\
                    \;\;\;\;\frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 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)))) < -0.0

                      1. Initial program 66.4%

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

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

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

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

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

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

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

                          \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. lower-*.f6421.2

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

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

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        9. lower-*.f6421.2

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                      6. Applied rewrites21.2%

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

                        \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
                      8. 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.3

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

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

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

                      1. Initial program 66.4%

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
                        3. fp-cancel-sub-sign-invN/A

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell} + 1\right)} \]
                        5. distribute-lft-neg-outN/A

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)} + 1\right) \]
                        6. distribute-rgt-neg-inN/A

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left(\frac{1}{2} \cdot \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right) \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right) + 1\right) \]
                        9. unpow2N/A

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

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}, \frac{M \cdot D}{2 \cdot d} \cdot \left(\mathsf{neg}\left(\frac{h}{\ell}\right)\right), 1\right)} \]
                      3. Applied rewrites66.9%

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right)} \]
                      4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                        3. lower-*.f6466.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 \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                        4. 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 \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                        5. metadata-eval66.9

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

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

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

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

                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                        10. metadata-eval66.9

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

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

                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{\frac{1}{2} \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                        13. lower-sqrt.f6466.9

                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \mathsf{fma}\left(\frac{0.5 \cdot \left(D \cdot M\right)}{d + d}, \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{-h}{\ell}, 1\right) \]
                      5. Applied rewrites66.9%

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

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

                          \[\leadsto \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{1} \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 14: 46.1% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                          6. lower-*.f6421.2

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

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

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                          9. lower-*.f6421.2

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. Applied rewrites21.2%

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

                          \[\leadsto \frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h} \]
                        8. 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.3

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

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

                        if -2.00000000000000013e-158 < (*.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 66.4%

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                          6. lower-*.f6421.2

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

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

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                          9. lower-*.f6421.2

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. Applied rewrites21.2%

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        7. Taylor expanded in d around 0

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

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

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

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

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

                      Alternative 15: 42.6% accurate, 4.9× speedup?

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

                        1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

                        if 5.00000000000000008e-295 < h

                        1. Initial program 66.4%

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                          6. lower-*.f6421.2

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

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

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                          9. lower-*.f6421.2

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. Applied rewrites21.2%

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        7. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{d \cdot \frac{\sqrt{h}}{\sqrt{\ell}}}{h} \]
                          6. lower-unsound-sqrt.f6422.0

                            \[\leadsto \frac{d \cdot \frac{\sqrt{h}}{\sqrt{\ell}}}{h} \]
                        11. Applied rewrites22.0%

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

                      Alternative 16: 40.7% accurate, 5.1× speedup?

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

                        1. Initial program 66.4%

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                          6. lower-*.f6421.2

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

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

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                          9. lower-*.f6421.2

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. Applied rewrites21.2%

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        7. Taylor expanded in d around 0

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

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

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

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

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

                        if 2.2999999999999999e-307 < d

                        1. Initial program 66.4%

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                          6. lower-*.f6421.2

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

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

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                          9. lower-*.f6421.2

                            \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. Applied rewrites21.2%

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        7. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{d \cdot \frac{\sqrt{h}}{\sqrt{\ell}}}{h} \]
                          6. lower-unsound-sqrt.f6422.0

                            \[\leadsto \frac{d \cdot \frac{\sqrt{h}}{\sqrt{\ell}}}{h} \]
                        11. Applied rewrites22.0%

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

                      Alternative 17: 36.9% accurate, 7.4× speedup?

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\sqrt{\left(d \cdot h\right) \cdot \frac{d}{\ell}}}{h} \]
                        6. lower-*.f6421.2

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

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

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                        9. lower-*.f6421.2

                          \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                      6. Applied rewrites21.2%

                        \[\leadsto \frac{\sqrt{\left(h \cdot d\right) \cdot \frac{d}{\ell}}}{h} \]
                      7. Taylor expanded in d around 0

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

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

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

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

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

                      Reproduce

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