Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.4% → 84.5%
Time: 10.7s
Alternatives: 16
Speedup: 0.4×

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 16 alternatives:

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

Initial Program: 66.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: 84.5% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{0.5 \cdot t\_6}{d + d} \cdot \frac{t\_7}{t\_8}\right)\\

\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_4\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot t\_6\right) \cdot t\_7}{d \cdot t\_8}\right) \cdot \left|d\right|}{\sqrt{h \cdot \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)))) < -1e-22

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{\left(D \cdot M\right) \cdot h}{\left(d + d\right) \cdot \ell}\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)))) < 2.0000000000000001e256

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.0% accurate, 0.4× 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}\\ t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot t\_0\\ t_2 := \left(D \cdot M\right) \cdot h\\ t_3 := \left(d + d\right) \cdot \ell\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{t\_2}{t\_3}\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+256}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot t\_2}{d \cdot t\_3}\right) \cdot \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))))
        (t_1 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) t_0))
        (t_2 (* (* D M) h))
        (t_3 (* (+ d d) l)))
   (if (<= t_1 0.0)
     (*
      (fabs (/ d (sqrt (* l h))))
      (- 1.0 (* (/ (* 0.5 (* D M)) (+ d d)) (/ t_2 t_3))))
     (if (<= t_1 2e+256)
       (* (* (sqrt (/ d l)) (sqrt (/ d h))) t_0)
       (/
        (* (- 1.0 (/ (* (* 0.25 (* D M)) t_2) (* d t_3))) (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 t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * t_0;
	double t_2 = (D * M) * h;
	double t_3 = (d + d) * l;
	double tmp;
	if (t_1 <= 0.0) {
		tmp = fabs((d / sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_2 / t_3)));
	} else if (t_1 <= 2e+256) {
		tmp = (sqrt((d / l)) * sqrt((d / h))) * t_0;
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * t_2) / (d * t_3))) * fabs(d)) / sqrt((h * l));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = 1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l))
    t_1 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * t_0
    t_2 = (d_1 * m) * h
    t_3 = (d + d) * l
    if (t_1 <= 0.0d0) then
        tmp = abs((d / sqrt((l * h)))) * (1.0d0 - (((0.5d0 * (d_1 * m)) / (d + d)) * (t_2 / t_3)))
    else if (t_1 <= 2d+256) then
        tmp = (sqrt((d / l)) * sqrt((d / h))) * t_0
    else
        tmp = ((1.0d0 - (((0.25d0 * (d_1 * m)) * t_2) / (d * t_3))) * abs(d)) / sqrt((h * l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = 1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l));
	double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * t_0;
	double t_2 = (D * M) * h;
	double t_3 = (d + d) * l;
	double tmp;
	if (t_1 <= 0.0) {
		tmp = Math.abs((d / Math.sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_2 / t_3)));
	} else if (t_1 <= 2e+256) {
		tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * t_0;
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * t_2) / (d * t_3))) * Math.abs(d)) / Math.sqrt((h * l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = 1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))
	t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * t_0
	t_2 = (D * M) * h
	t_3 = (d + d) * l
	tmp = 0
	if t_1 <= 0.0:
		tmp = math.fabs((d / math.sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_2 / t_3)))
	elif t_1 <= 2e+256:
		tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * t_0
	else:
		tmp = ((1.0 - (((0.25 * (D * M)) * t_2) / (d * t_3))) * math.fabs(d)) / math.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)))
	t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * t_0)
	t_2 = Float64(Float64(D * M) * h)
	t_3 = Float64(Float64(d + d) * l)
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(D * M)) / Float64(d + d)) * Float64(t_2 / t_3))));
	elseif (t_1 <= 2e+256)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * t_0);
	else
		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.25 * Float64(D * M)) * t_2) / Float64(d * t_3))) * abs(d)) / sqrt(Float64(h * l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = 1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l));
	t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * t_0;
	t_2 = (D * M) * h;
	t_3 = (d + d) * l;
	tmp = 0.0;
	if (t_1 <= 0.0)
		tmp = abs((d / sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_2 / t_3)));
	elseif (t_1 <= 2e+256)
		tmp = (sqrt((d / l)) * sqrt((d / h))) * t_0;
	else
		tmp = ((1.0 - (((0.25 * (D * M)) * t_2) / (d * t_3))) * abs(d)) / sqrt((h * l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(D * M), $MachinePrecision] * h), $MachinePrecision]}, Block[{t$95$3 = N[(N[(d + d), $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d + d), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+256], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.25 * N[(D * M), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] / N[(d * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $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}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot t\_0\\
t_2 := \left(D \cdot M\right) \cdot h\\
t_3 := \left(d + d\right) \cdot \ell\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{t\_2}{t\_3}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot t\_2}{d \cdot t\_3}\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{\left(D \cdot M\right) \cdot h}{\left(d + d\right) \cdot \ell}\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)))) < 2.0000000000000001e256

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.7% 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 := \left(D \cdot M\right) \cdot h\\ t_2 := \left(d + d\right) \cdot \ell\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{t\_1}{t\_2}\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot t\_1}{d \cdot t\_2}\right) \cdot \left|d\right|}{\sqrt{h \cdot \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)))))
        (t_1 (* (* D M) h))
        (t_2 (* (+ d d) l)))
   (if (<= t_0 0.0)
     (*
      (fabs (/ d (sqrt (* l h))))
      (- 1.0 (* (/ (* 0.5 (* D M)) (+ d d)) (/ t_1 t_2))))
     (if (<= t_0 2e+256)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (/
        (* (- 1.0 (/ (* (* 0.25 (* D M)) t_1) (* d t_2))) (fabs d))
        (sqrt (* 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 t_1 = (D * M) * h;
	double t_2 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = fabs((d / sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_1 / t_2)));
	} else if (t_0 <= 2e+256) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * t_1) / (d * t_2))) * fabs(d)) / sqrt((h * l));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    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 = (d_1 * m) * h
    t_2 = (d + d) * l
    if (t_0 <= 0.0d0) then
        tmp = abs((d / sqrt((l * h)))) * (1.0d0 - (((0.5d0 * (d_1 * m)) / (d + d)) * (t_1 / t_2)))
    else if (t_0 <= 2d+256) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = ((1.0d0 - (((0.25d0 * (d_1 * m)) * t_1) / (d * t_2))) * abs(d)) / sqrt((h * l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double t_1 = (D * M) * h;
	double t_2 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.abs((d / Math.sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_1 / t_2)));
	} else if (t_0 <= 2e+256) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * t_1) / (d * t_2))) * Math.abs(d)) / Math.sqrt((h * l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
	t_1 = (D * M) * h
	t_2 = (d + d) * l
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.fabs((d / math.sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_1 / t_2)))
	elif t_0 <= 2e+256:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = ((1.0 - (((0.25 * (D * M)) * t_1) / (d * t_2))) * math.fabs(d)) / math.sqrt((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))))
	t_1 = Float64(Float64(D * M) * h)
	t_2 = Float64(Float64(d + d) * l)
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(D * M)) / Float64(d + d)) * Float64(t_1 / t_2))));
	elseif (t_0 <= 2e+256)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.25 * Float64(D * M)) * t_1) / Float64(d * t_2))) * abs(d)) / sqrt(Float64(h * l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
	t_1 = (D * M) * h;
	t_2 = (d + d) * l;
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = abs((d / sqrt((l * h)))) * (1.0 - (((0.5 * (D * M)) / (d + d)) * (t_1 / t_2)));
	elseif (t_0 <= 2e+256)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = ((1.0 - (((0.25 * (D * M)) * t_1) / (d * t_2))) * abs(d)) / sqrt((h * l));
	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[(D * M), $MachinePrecision] * h), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d + d), $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d + d), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+256], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.25 * N[(D * M), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(d * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \left(D \cdot M\right) \cdot h\\
t_2 := \left(d + d\right) \cdot \ell\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{t\_1}{t\_2}\right)\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot t\_1}{d \cdot t\_2}\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \cdot \left(1 - \frac{0.5 \cdot \left(D \cdot M\right)}{d + d} \cdot \frac{\left(D \cdot M\right) \cdot h}{\left(d + d\right) \cdot \ell}\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)))) < 2.0000000000000001e256

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.5% 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 := \left(d + d\right) \cdot \ell\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{h}{t\_1} \cdot \left(M \cdot D\right)\right)\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \left(\left(D \cdot M\right) \cdot h\right)}{d \cdot t\_1}\right) \cdot \left|d\right|}{\sqrt{h \cdot \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)))))
        (t_1 (* (+ d d) l)))
   (if (<= t_0 0.0)
     (*
      (fabs (/ d (sqrt (* l h))))
      (- 1.0 (* (* (/ (* M D) d) 0.25) (* (/ h t_1) (* M D)))))
     (if (<= t_0 2e+256)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (/
        (* (- 1.0 (/ (* (* 0.25 (* D M)) (* (* D M) h)) (* d t_1))) (fabs d))
        (sqrt (* 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 t_1 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = fabs((d / sqrt((l * h)))) * (1.0 - ((((M * D) / d) * 0.25) * ((h / t_1) * (M * D))));
	} else if (t_0 <= 2e+256) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * t_1))) * fabs(d)) / sqrt((h * l));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: 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 = (d + d) * l
    if (t_0 <= 0.0d0) then
        tmp = abs((d / sqrt((l * h)))) * (1.0d0 - ((((m * d_1) / d) * 0.25d0) * ((h / t_1) * (m * d_1))))
    else if (t_0 <= 2d+256) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = ((1.0d0 - (((0.25d0 * (d_1 * m)) * ((d_1 * m) * h)) / (d * t_1))) * abs(d)) / sqrt((h * l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double t_1 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.abs((d / Math.sqrt((l * h)))) * (1.0 - ((((M * D) / d) * 0.25) * ((h / t_1) * (M * D))));
	} else if (t_0 <= 2e+256) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * t_1))) * Math.abs(d)) / Math.sqrt((h * l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
	t_1 = (d + d) * l
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.fabs((d / math.sqrt((l * h)))) * (1.0 - ((((M * D) / d) * 0.25) * ((h / t_1) * (M * D))))
	elif t_0 <= 2e+256:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * t_1))) * math.fabs(d)) / math.sqrt((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))))
	t_1 = Float64(Float64(d + d) * l)
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * Float64(1.0 - Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(Float64(h / t_1) * Float64(M * D)))));
	elseif (t_0 <= 2e+256)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.25 * Float64(D * M)) * Float64(Float64(D * M) * h)) / Float64(d * t_1))) * abs(d)) / sqrt(Float64(h * l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
	t_1 = (d + d) * l;
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = abs((d / sqrt((l * h)))) * (1.0 - ((((M * D) / d) * 0.25) * ((h / t_1) * (M * D))));
	elseif (t_0 <= 2e+256)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * t_1))) * abs(d)) / sqrt((h * l));
	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[(d + d), $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(h / t$95$1), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+256], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.25 * N[(D * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \left(d + d\right) \cdot \ell\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{h}{t\_1} \cdot \left(M \cdot D\right)\right)\right)\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \left(\left(D \cdot M\right) \cdot h\right)}{d \cdot t\_1}\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \left(\frac{M \cdot D}{d} \cdot \frac{1}{4}\right) \cdot \left(\color{blue}{\frac{h}{\left(d + d\right) \cdot \ell}} \cdot \left(M \cdot D\right)\right)\right) \]
      22. lower-*.f6472.5

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

      \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \color{blue}{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(\frac{h}{\left(d + d\right) \cdot \ell} \cdot \left(M \cdot D\right)\right)}\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)))) < 2.0000000000000001e256

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.7% 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{\mathsf{min}\left(M, D\right) \cdot \mathsf{max}\left(M, D\right)}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \mathsf{max}\left(M, D\right) \cdot \mathsf{min}\left(M, D\right)\\ t_2 := \left(d + d\right) \cdot \ell\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{\left(\left(\left(\frac{h}{t\_2} \cdot \mathsf{max}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)\right) \cdot \mathsf{max}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)}{d} \cdot 0.25\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 - \frac{\left(0.25 \cdot t\_1\right) \cdot \left(t\_1 \cdot h\right)}{d \cdot t\_2}\right) \cdot \left|d\right|}{\sqrt{h \cdot \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 (/ (* (fmin M D) (fmax M D)) (* 2.0 d)) 2.0))
            (/ h l)))))
        (t_1 (* (fmax M D) (fmin M D)))
        (t_2 (* (+ d d) l)))
   (if (<= t_0 0.0)
     (*
      (fabs (/ d (sqrt (* l h))))
      (-
       1.0
       (*
        (/
         (* (* (* (* (/ h t_2) (fmax M D)) (fmin M D)) (fmax M D)) (fmin M D))
         d)
        0.25)))
     (if (<= t_0 2e+256)
       (* (sqrt (/ d h)) (sqrt (/ d l)))
       (/
        (* (- 1.0 (/ (* (* 0.25 t_1) (* t_1 h)) (* d t_2))) (fabs d))
        (sqrt (* 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(((fmin(M, D) * fmax(M, D)) / (2.0 * d)), 2.0)) * (h / l)));
	double t_1 = fmax(M, D) * fmin(M, D);
	double t_2 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = fabs((d / sqrt((l * h)))) * (1.0 - (((((((h / t_2) * fmax(M, D)) * fmin(M, D)) * fmax(M, D)) * fmin(M, D)) / d) * 0.25));
	} else if (t_0 <= 2e+256) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * t_1) * (t_1 * h)) / (d * t_2))) * fabs(d)) / sqrt((h * l));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(d, h, l, m, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((fmin(m, d_1) * fmax(m, d_1)) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
    t_1 = fmax(m, d_1) * fmin(m, d_1)
    t_2 = (d + d) * l
    if (t_0 <= 0.0d0) then
        tmp = abs((d / sqrt((l * h)))) * (1.0d0 - (((((((h / t_2) * fmax(m, d_1)) * fmin(m, d_1)) * fmax(m, d_1)) * fmin(m, d_1)) / d) * 0.25d0))
    else if (t_0 <= 2d+256) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    else
        tmp = ((1.0d0 - (((0.25d0 * t_1) * (t_1 * h)) / (d * t_2))) * abs(d)) / sqrt((h * l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double 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(((fmin(M, D) * fmax(M, D)) / (2.0 * d)), 2.0)) * (h / l)));
	double t_1 = fmax(M, D) * fmin(M, D);
	double t_2 = (d + d) * l;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.abs((d / Math.sqrt((l * h)))) * (1.0 - (((((((h / t_2) * fmax(M, D)) * fmin(M, D)) * fmax(M, D)) * fmin(M, D)) / d) * 0.25));
	} else if (t_0 <= 2e+256) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = ((1.0 - (((0.25 * t_1) * (t_1 * h)) / (d * t_2))) * Math.abs(d)) / Math.sqrt((h * l));
	}
	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(((fmin(M, D) * fmax(M, D)) / (2.0 * d)), 2.0)) * (h / l)))
	t_1 = fmax(M, D) * fmin(M, D)
	t_2 = (d + d) * l
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.fabs((d / math.sqrt((l * h)))) * (1.0 - (((((((h / t_2) * fmax(M, D)) * fmin(M, D)) * fmax(M, D)) * fmin(M, D)) / d) * 0.25))
	elif t_0 <= 2e+256:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = ((1.0 - (((0.25 * t_1) * (t_1 * h)) / (d * t_2))) * math.fabs(d)) / math.sqrt((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(fmin(M, D) * fmax(M, D)) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	t_1 = Float64(fmax(M, D) * fmin(M, D))
	t_2 = Float64(Float64(d + d) * l)
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(abs(Float64(d / sqrt(Float64(l * h)))) * Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(h / t_2) * fmax(M, D)) * fmin(M, D)) * fmax(M, D)) * fmin(M, D)) / d) * 0.25)));
	elseif (t_0 <= 2e+256)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.25 * t_1) * Float64(t_1 * h)) / Float64(d * t_2))) * abs(d)) / sqrt(Float64(h * l)));
	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) * (((min(M, D) * max(M, D)) / (2.0 * d)) ^ 2.0)) * (h / l)));
	t_1 = max(M, D) * min(M, D);
	t_2 = (d + d) * l;
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = abs((d / sqrt((l * h)))) * (1.0 - (((((((h / t_2) * max(M, D)) * min(M, D)) * max(M, D)) * min(M, D)) / d) * 0.25));
	elseif (t_0 <= 2e+256)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = ((1.0 - (((0.25 * t_1) * (t_1 * h)) / (d * t_2))) * abs(d)) / sqrt((h * l));
	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[(N[Min[M, D], $MachinePrecision] * N[Max[M, D], $MachinePrecision]), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Max[M, D], $MachinePrecision] * N[Min[M, D], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d + d), $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(N[(N[(N[(h / t$95$2), $MachinePrecision] * N[Max[M, D], $MachinePrecision]), $MachinePrecision] * N[Min[M, D], $MachinePrecision]), $MachinePrecision] * N[Max[M, D], $MachinePrecision]), $MachinePrecision] * N[Min[M, D], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+256], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(N[(N[(0.25 * t$95$1), $MachinePrecision] * N[(t$95$1 * h), $MachinePrecision]), $MachinePrecision] / N[(d * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{\mathsf{min}\left(M, D\right) \cdot \mathsf{max}\left(M, D\right)}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \mathsf{max}\left(M, D\right) \cdot \mathsf{min}\left(M, D\right)\\
t_2 := \left(d + d\right) \cdot \ell\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \frac{\left(\left(\left(\frac{h}{t\_2} \cdot \mathsf{max}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)\right) \cdot \mathsf{max}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)}{d} \cdot 0.25\right)\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \cdot \left(1 - \color{blue}{\frac{\left(\left(\left(\frac{h}{\left(d + d\right) \cdot \ell} \cdot D\right) \cdot M\right) \cdot D\right) \cdot M}{d} \cdot 0.25}\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)))) < 2.0000000000000001e256

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.8% 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(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \left(\left(D \cdot M\right) \cdot h\right)}{d \cdot \left(\left(d + d\right) \cdot \ell\right)}\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (*
          (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
          (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
        (t_1
         (/
          (*
           (- 1.0 (/ (* (* 0.25 (* D M)) (* (* D M) h)) (* d (* (+ d d) l))))
           (fabs d))
          (sqrt (* h l)))))
   (if (<= t_0 0.0)
     t_1
     (if (<= t_0 2e+256) (* (sqrt (/ d h)) (sqrt (/ d l))) t_1))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double t_1 = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * ((d + d) * l)))) * fabs(d)) / sqrt((h * l));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = t_1;
	} else if (t_0 <= 2e+256) {
		tmp = sqrt((d / h)) * sqrt((d / l));
	} 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 = ((1.0d0 - (((0.25d0 * (d_1 * m)) * ((d_1 * m) * h)) / (d * ((d + d) * l)))) * abs(d)) / sqrt((h * l))
    if (t_0 <= 0.0d0) then
        tmp = t_1
    else if (t_0 <= 2d+256) then
        tmp = sqrt((d / h)) * sqrt((d / l))
    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 = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * ((d + d) * l)))) * Math.abs(d)) / Math.sqrt((h * l));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = t_1;
	} else if (t_0 <= 2e+256) {
		tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(d, h, l, M, D):
	t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
	t_1 = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * ((d + d) * l)))) * math.fabs(d)) / math.sqrt((h * l))
	tmp = 0
	if t_0 <= 0.0:
		tmp = t_1
	elif t_0 <= 2e+256:
		tmp = math.sqrt((d / h)) * math.sqrt((d / l))
	else:
		tmp = t_1
	return tmp
function code(d, h, l, M, D)
	t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	t_1 = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(0.25 * Float64(D * M)) * Float64(Float64(D * M) * h)) / Float64(d * Float64(Float64(d + d) * l)))) * abs(d)) / sqrt(Float64(h * l)))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = t_1;
	elseif (t_0 <= 2e+256)
		tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
	t_1 = ((1.0 - (((0.25 * (D * M)) * ((D * M) * h)) / (d * ((d + d) * l)))) * abs(d)) / sqrt((h * l));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = t_1;
	elseif (t_0 <= 2e+256)
		tmp = sqrt((d / h)) * sqrt((d / l));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(1.0 - N[(N[(N[(0.25 * N[(D * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * N[(N[(d + d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+256], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \left(\left(D \cdot M\right) \cdot h\right)}{d \cdot \left(\left(d + d\right) \cdot \ell\right)}\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 2.0000000000000001e256 < (*.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 \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
      2. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(1 - \frac{\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \left(\left(D \cdot M\right) \cdot h\right)}{d \cdot \left(\left(d + d\right) \cdot \ell\right)}\right) \cdot \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)))) < 2.0000000000000001e256

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in h around inf

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

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

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

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

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

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

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

Alternative 7: 61.2% accurate, 1.5× speedup?

\[\begin{array}{l} \mathbf{if}\;\ell \leq -1.08 \cdot 10^{-305}:\\ \;\;\;\;-1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)}\\ \mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+214}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-0.25 \cdot \left(\left(\frac{\mathsf{max}\left(M, D\right)}{d} \cdot \mathsf{min}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)\right)}{\ell}, \frac{\left(0.5 \cdot h\right) \cdot \mathsf{max}\left(M, D\right)}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d} \cdot \sqrt{\frac{d}{h}}}{\ell \cdot \sqrt{\frac{1}{\ell}}}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.08e-305)
   (* -1.0 (/ (fabs d) (* l (* (sqrt (- h)) (sqrt (/ -1.0 l))))))
   (if (<= l 1.2e+214)
     (*
      (fma
       (/ (* -0.25 (* (* (/ (fmax M D) d) (fmin M D)) (fmin M D))) l)
       (/ (* (* 0.5 h) (fmax M D)) d)
       1.0)
      (/ d (sqrt (* l h))))
     (/ (* (sqrt d) (sqrt (/ d h))) (* l (sqrt (/ 1.0 l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.08e-305) {
		tmp = -1.0 * (fabs(d) / (l * (sqrt(-h) * sqrt((-1.0 / l)))));
	} else if (l <= 1.2e+214) {
		tmp = fma(((-0.25 * (((fmax(M, D) / d) * fmin(M, D)) * fmin(M, D))) / l), (((0.5 * h) * fmax(M, D)) / d), 1.0) * (d / sqrt((l * h)));
	} else {
		tmp = (sqrt(d) * sqrt((d / h))) / (l * sqrt((1.0 / l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.08e-305)
		tmp = Float64(-1.0 * Float64(abs(d) / Float64(l * Float64(sqrt(Float64(-h)) * sqrt(Float64(-1.0 / l))))));
	elseif (l <= 1.2e+214)
		tmp = Float64(fma(Float64(Float64(-0.25 * Float64(Float64(Float64(fmax(M, D) / d) * fmin(M, D)) * fmin(M, D))) / l), Float64(Float64(Float64(0.5 * h) * fmax(M, D)) / d), 1.0) * Float64(d / sqrt(Float64(l * h))));
	else
		tmp = Float64(Float64(sqrt(d) * sqrt(Float64(d / h))) / Float64(l * sqrt(Float64(1.0 / l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.08e-305], N[(-1.0 * N[(N[Abs[d], $MachinePrecision] / N[(l * N[(N[Sqrt[(-h)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+214], N[(N[(N[(N[(-0.25 * N[(N[(N[(N[Max[M, D], $MachinePrecision] / d), $MachinePrecision] * N[Min[M, D], $MachinePrecision]), $MachinePrecision] * N[Min[M, D], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * h), $MachinePrecision] * N[Max[M, D], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.08 \cdot 10^{-305}:\\
\;\;\;\;-1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)}\\

\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+214}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.25 \cdot \left(\left(\frac{\mathsf{max}\left(M, D\right)}{d} \cdot \mathsf{min}\left(M, D\right)\right) \cdot \mathsf{min}\left(M, D\right)\right)}{\ell}, \frac{\left(0.5 \cdot h\right) \cdot \mathsf{max}\left(M, D\right)}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.08000000000000004e-305

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)} \]
      9. lower-/.f6424.8

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

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

    if -1.08000000000000004e-305 < l < 1.2e214

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e214 < 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-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 61.1% accurate, 1.4× speedup?

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

\mathbf{elif}\;h \leq -3.8 \cdot 10^{-307}:\\
\;\;\;\;-1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.39999999999999996e236

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in d around inf

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

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

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

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

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

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

    if -1.39999999999999996e236 < h < -3.79999999999999985e-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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)} \]
      9. lower-/.f6424.8

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

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

    if -3.79999999999999985e-307 < 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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot t\_1\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \left(\sqrt{\frac{h}{d}} \cdot \left(-d\right)\right)}{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)))) < -4.0000000000000001e-59

    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.9

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

      \[\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-/.f6412.3

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

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

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

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

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

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

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

    if -4.0000000000000001e-59 < (*.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.0000000000000001e256

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in h around inf

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

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

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

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

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

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

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

    if 2.0000000000000001e256 < (*.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.9

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 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.9

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

      \[\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-/.f6412.3

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 49.6% accurate, 2.3× speedup?

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

\mathbf{elif}\;d \leq -8.5 \cdot 10^{-301}:\\
\;\;\;\;\frac{t\_0 \cdot t\_1}{h}\\

\mathbf{elif}\;d \leq 2.3 \cdot 10^{-123}:\\
\;\;\;\;\frac{t\_0 \cdot \left(-1 \cdot t\_1\right)}{h}\\

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


\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.60000000000000021e-255

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)} \]
      9. lower-/.f6424.8

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

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

    if -2.60000000000000021e-255 < d < -8.50000000000000046e-301

    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.9

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

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

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

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

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

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

      \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
    8. Taylor expanded in d around inf

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

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

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

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

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

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

    if -8.50000000000000046e-301 < d < 2.29999999999999987e-123

    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.9

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{d \cdot \ell}}\right)\right)}{h} \]
    10. Applied rewrites21.2%

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

    if 2.29999999999999987e-123 < 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.9

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\sqrt{h} \cdot \sqrt{d}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
      7. lower-unsound-sqrt.f6421.5

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

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

Alternative 11: 46.6% accurate, 3.5× speedup?

\[\begin{array}{l} \mathbf{if}\;d \leq -2.6 \cdot 10^{-255}:\\ \;\;\;\;-1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)}\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{-202}:\\ \;\;\;\;--1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{h} \cdot \sqrt{d}\right) \cdot \sqrt{\frac{d}{\ell}}}{h}\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.6e-255)
   (* -1.0 (/ (fabs d) (* l (* (sqrt (- h)) (sqrt (/ -1.0 l))))))
   (if (<= d 1.35e-202)
     (- (* -1.0 (/ d (sqrt (* l h)))))
     (/ (* (* (sqrt h) (sqrt d)) (sqrt (/ d l))) h))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.6e-255) {
		tmp = -1.0 * (fabs(d) / (l * (sqrt(-h) * sqrt((-1.0 / l)))));
	} else if (d <= 1.35e-202) {
		tmp = -(-1.0 * (d / sqrt((l * h))));
	} else {
		tmp = ((sqrt(h) * sqrt(d)) * sqrt((d / 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.6d-255)) then
        tmp = (-1.0d0) * (abs(d) / (l * (sqrt(-h) * sqrt(((-1.0d0) / l)))))
    else if (d <= 1.35d-202) then
        tmp = -((-1.0d0) * (d / sqrt((l * h))))
    else
        tmp = ((sqrt(h) * sqrt(d)) * sqrt((d / 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.6e-255) {
		tmp = -1.0 * (Math.abs(d) / (l * (Math.sqrt(-h) * Math.sqrt((-1.0 / l)))));
	} else if (d <= 1.35e-202) {
		tmp = -(-1.0 * (d / Math.sqrt((l * h))));
	} else {
		tmp = ((Math.sqrt(h) * Math.sqrt(d)) * Math.sqrt((d / l))) / h;
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if d <= -2.6e-255:
		tmp = -1.0 * (math.fabs(d) / (l * (math.sqrt(-h) * math.sqrt((-1.0 / l)))))
	elif d <= 1.35e-202:
		tmp = -(-1.0 * (d / math.sqrt((l * h))))
	else:
		tmp = ((math.sqrt(h) * math.sqrt(d)) * math.sqrt((d / l))) / h
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.6e-255)
		tmp = Float64(-1.0 * Float64(abs(d) / Float64(l * Float64(sqrt(Float64(-h)) * sqrt(Float64(-1.0 / l))))));
	elseif (d <= 1.35e-202)
		tmp = Float64(-Float64(-1.0 * Float64(d / sqrt(Float64(l * h)))));
	else
		tmp = Float64(Float64(Float64(sqrt(h) * sqrt(d)) * sqrt(Float64(d / l))) / h);
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (d <= -2.6e-255)
		tmp = -1.0 * (abs(d) / (l * (sqrt(-h) * sqrt((-1.0 / l)))));
	elseif (d <= 1.35e-202)
		tmp = -(-1.0 * (d / sqrt((l * h))));
	else
		tmp = ((sqrt(h) * sqrt(d)) * sqrt((d / l))) / h;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.6e-255], N[(-1.0 * N[(N[Abs[d], $MachinePrecision] / N[(l * N[(N[Sqrt[(-h)], $MachinePrecision] * N[Sqrt[N[(-1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-202], (-N[(-1.0 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;d \leq -2.6 \cdot 10^{-255}:\\
\;\;\;\;-1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)}\\

\mathbf{elif}\;d \leq 1.35 \cdot 10^{-202}:\\
\;\;\;\;--1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -2.60000000000000021e-255

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{\left|d\right|}{\ell \cdot \left(\sqrt{-h} \cdot \sqrt{\frac{-1}{\ell}}\right)} \]
      9. lower-/.f6424.8

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

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

    if -2.60000000000000021e-255 < d < 1.3499999999999999e-202

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.3499999999999999e-202 < 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.9

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\sqrt{h} \cdot \sqrt{d}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
        7. lower-unsound-sqrt.f6421.5

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

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

    Alternative 12: 46.6% accurate, 3.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{\mathsf{neg}\left(\ell\right)}} \]
        7. lower-neg.f6424.8

          \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{-\ell}} \]
      8. Applied rewrites24.8%

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

      if -2.60000000000000021e-255 < d < 1.3499999999999999e-202

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.3499999999999999e-202 < 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.9

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(\sqrt{h} \cdot \sqrt{d}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
          7. lower-unsound-sqrt.f6421.5

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

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

      Alternative 13: 46.0% accurate, 4.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{\mathsf{neg}\left(\ell\right)}} \]
          7. lower-neg.f6424.8

            \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{-\ell}} \]
        8. Applied rewrites24.8%

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

        if -5.50000000000000035e-304 < l < 1.05e251

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.05e251 < 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.9

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

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

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

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

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

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

            \[\leadsto \frac{\left(d \cdot \sqrt{\frac{h}{d}}\right) \cdot \sqrt{\frac{d}{\ell}}}{h} \]
          8. Taylor expanded in h around inf

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

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

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

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

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

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

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

        Alternative 14: 45.9% accurate, 5.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{\mathsf{neg}\left(\ell\right)}} \]
            7. lower-neg.f6424.8

              \[\leadsto \frac{\left|d\right|}{\sqrt{-h} \cdot \sqrt{-\ell}} \]
          8. Applied rewrites24.8%

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

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

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

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

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

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\frac{M \cdot D}{2 \cdot d}}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
            8. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
            9. lift-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{\color{blue}{2 \cdot d}}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
            10. times-fracN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
            11. associate-*r*N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \frac{D}{d}\right)} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
            12. 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(1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \left(\frac{D}{d} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right)}\right) \]
            13. lower-*.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \left(\frac{D}{d} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right)}\right) \]
          3. Applied rewrites59.9%

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{D}{d} \cdot \left(\left(M \cdot M\right) \cdot 0.25\right)\right) \cdot \left(\frac{D}{d} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}\right) \]
          4. Applied rewrites26.7%

            \[\leadsto \color{blue}{-\mathsf{fma}\left(\frac{\left(\left(0.25 \cdot \left(M \cdot M\right)\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{h}{\ell}, 0.5, -1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
          5. Taylor expanded in d around inf

            \[\leadsto -\color{blue}{-1} \cdot \frac{d}{\sqrt{\ell \cdot h}} \]
          6. Step-by-step derivation
            1. Applied rewrites26.1%

              \[\leadsto -\color{blue}{-1} \cdot \frac{d}{\sqrt{\ell \cdot h}} \]
          7. Recombined 2 regimes into one program.
          8. Add Preprocessing

          Alternative 15: 42.2% accurate, 5.5× speedup?

          \[\begin{array}{l} \mathbf{if}\;d \leq 3.7 \cdot 10^{-262}:\\ \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;--1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
          (FPCore (d h l M D)
           :precision binary64
           (if (<= d 3.7e-262)
             (/ (- d) (sqrt (* h l)))
             (- (* -1.0 (/ d (sqrt (* l h)))))))
          double code(double d, double h, double l, double M, double D) {
          	double tmp;
          	if (d <= 3.7e-262) {
          		tmp = -d / sqrt((h * l));
          	} else {
          		tmp = -(-1.0 * (d / 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 <= 3.7d-262) then
                  tmp = -d / sqrt((h * l))
              else
                  tmp = -((-1.0d0) * (d / 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 <= 3.7e-262) {
          		tmp = -d / Math.sqrt((h * l));
          	} else {
          		tmp = -(-1.0 * (d / Math.sqrt((l * h))));
          	}
          	return tmp;
          }
          
          def code(d, h, l, M, D):
          	tmp = 0
          	if d <= 3.7e-262:
          		tmp = -d / math.sqrt((h * l))
          	else:
          		tmp = -(-1.0 * (d / math.sqrt((l * h))))
          	return tmp
          
          function code(d, h, l, M, D)
          	tmp = 0.0
          	if (d <= 3.7e-262)
          		tmp = Float64(Float64(-d) / sqrt(Float64(h * l)));
          	else
          		tmp = Float64(-Float64(-1.0 * Float64(d / sqrt(Float64(l * h)))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(d, h, l, M, D)
          	tmp = 0.0;
          	if (d <= 3.7e-262)
          		tmp = -d / sqrt((h * l));
          	else
          		tmp = -(-1.0 * (d / sqrt((l * h))));
          	end
          	tmp_2 = tmp;
          end
          
          code[d_, h_, l_, M_, D_] := If[LessEqual[d, 3.7e-262], N[((-d) / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[(-1.0 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]
          
          \begin{array}{l}
          \mathbf{if}\;d \leq 3.7 \cdot 10^{-262}:\\
          \;\;\;\;\frac{-d}{\sqrt{h \cdot \ell}}\\
          
          \mathbf{else}:\\
          \;\;\;\;--1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if d < 3.7e-262

            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. lift-pow.f64N/A

                \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              3. lift-pow.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              4. pow-prod-downN/A

                \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              5. lift-/.f64N/A

                \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              6. metadata-evalN/A

                \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              7. unpow1/2N/A

                \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              8. lift-/.f64N/A

                \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              9. lift-/.f64N/A

                \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              10. frac-timesN/A

                \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              11. sqrt-divN/A

                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              12. lower-unsound-/.f64N/A

                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              13. lower-unsound-sqrt.f64N/A

                \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              14. lower-*.f64N/A

                \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              15. lower-unsound-sqrt.f64N/A

                \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              16. lower-*.f6448.9

                \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            3. Applied rewrites48.9%

              \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            4. Taylor expanded in d around -inf

              \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
              2. lower-/.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              3. lower-sqrt.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
              4. lower-*.f6425.9

                \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
            6. Applied rewrites25.9%

              \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
              2. lift-/.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              3. associate-*r/N/A

                \[\leadsto \frac{-1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              4. mul-1-negN/A

                \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              5. lift-neg.f64N/A

                \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              6. lower-/.f6425.9

                \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
            8. Applied rewrites25.9%

              \[\leadsto \color{blue}{\frac{-d}{\sqrt{h \cdot \ell}}} \]

            if 3.7e-262 < 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. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right) \]
              2. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)} \cdot \frac{h}{\ell}\right) \]
              3. *-commutativeN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) \]
              4. 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(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) \]
              5. lift-pow.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              6. 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(1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              7. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\frac{M \cdot D}{2 \cdot d}}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              8. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{\color{blue}{M \cdot D}}{2 \cdot d}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              9. lift-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{\color{blue}{2 \cdot d}}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              10. times-fracN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}\right) \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              11. associate-*r*N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \frac{D}{d}\right)} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right) \]
              12. 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(1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \left(\frac{D}{d} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right)}\right) \]
              13. lower-*.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right) \cdot \left(\frac{D}{d} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)\right)}\right) \]
            3. Applied rewrites59.9%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(\frac{D}{d} \cdot \left(\left(M \cdot M\right) \cdot 0.25\right)\right) \cdot \left(\frac{D}{d} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)\right)}\right) \]
            4. Applied rewrites26.7%

              \[\leadsto \color{blue}{-\mathsf{fma}\left(\frac{\left(\left(0.25 \cdot \left(M \cdot M\right)\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \frac{h}{\ell}, 0.5, -1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
            5. Taylor expanded in d around inf

              \[\leadsto -\color{blue}{-1} \cdot \frac{d}{\sqrt{\ell \cdot h}} \]
            6. Step-by-step derivation
              1. Applied rewrites26.1%

                \[\leadsto -\color{blue}{-1} \cdot \frac{d}{\sqrt{\ell \cdot h}} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 16: 25.9% accurate, 9.2× speedup?

            \[\frac{-d}{\sqrt{h \cdot \ell}} \]
            (FPCore (d h l M D) :precision binary64 (/ (- d) (sqrt (* h l))))
            double code(double d, double h, double l, double M, double D) {
            	return -d / sqrt((h * l));
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(d, h, l, m, d_1)
            use fmin_fmax_functions
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: m
                real(8), intent (in) :: d_1
                code = -d / sqrt((h * l))
            end function
            
            public static double code(double d, double h, double l, double M, double D) {
            	return -d / Math.sqrt((h * l));
            }
            
            def code(d, h, l, M, D):
            	return -d / math.sqrt((h * l))
            
            function code(d, h, l, M, D)
            	return Float64(Float64(-d) / sqrt(Float64(h * l)))
            end
            
            function tmp = code(d, h, l, M, D)
            	tmp = -d / sqrt((h * l));
            end
            
            code[d_, h_, l_, M_, D_] := N[((-d) / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
            
            \frac{-d}{\sqrt{h \cdot \ell}}
            
            Derivation
            1. Initial program 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. lift-pow.f64N/A

                \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              3. lift-pow.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{{\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              4. pow-prod-downN/A

                \[\leadsto \color{blue}{{\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              5. lift-/.f64N/A

                \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              6. metadata-evalN/A

                \[\leadsto {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              7. unpow1/2N/A

                \[\leadsto \color{blue}{\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              8. lift-/.f64N/A

                \[\leadsto \sqrt{\color{blue}{\frac{d}{h}} \cdot \frac{d}{\ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              9. lift-/.f64N/A

                \[\leadsto \sqrt{\frac{d}{h} \cdot \color{blue}{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              10. frac-timesN/A

                \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              11. sqrt-divN/A

                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              12. lower-unsound-/.f64N/A

                \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              13. lower-unsound-sqrt.f64N/A

                \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              14. lower-*.f64N/A

                \[\leadsto \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{h \cdot \ell}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              15. lower-unsound-sqrt.f64N/A

                \[\leadsto \frac{\sqrt{d \cdot d}}{\color{blue}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
              16. lower-*.f6448.9

                \[\leadsto \frac{\sqrt{d \cdot d}}{\sqrt{\color{blue}{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            3. Applied rewrites48.9%

              \[\leadsto \color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
            4. Taylor expanded in d around -inf

              \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
              2. lower-/.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              3. lower-sqrt.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
              4. lower-*.f6425.9

                \[\leadsto -1 \cdot \frac{d}{\sqrt{h \cdot \ell}} \]
            6. Applied rewrites25.9%

              \[\leadsto \color{blue}{-1 \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto -1 \cdot \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
              2. lift-/.f64N/A

                \[\leadsto -1 \cdot \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              3. associate-*r/N/A

                \[\leadsto \frac{-1 \cdot d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
              4. mul-1-negN/A

                \[\leadsto \frac{\mathsf{neg}\left(d\right)}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              5. lift-neg.f64N/A

                \[\leadsto \frac{-d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
              6. lower-/.f6425.9

                \[\leadsto \frac{-d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
            8. Applied rewrites25.9%

              \[\leadsto \color{blue}{\frac{-d}{\sqrt{h \cdot \ell}}} \]
            9. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025178 
            (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)))))