Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.4% → 89.1%
Time: 6.9s
Alternatives: 16
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.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(w0, m, d, h, l, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}

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: 81.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.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(w0, m, d, h, l, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}

Alternative 1: 89.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\ t_1 := \frac{D}{d + d}\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{+110}:\\ \;\;\;\;w0 \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(t\_1 \cdot M\right) \cdot \frac{\left(t\_1 \cdot h\right) \cdot M}{\ell}}\\ \end{array} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (let* ((t_0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
        (t_1 (/ D (+ d d))))
   (if (<= t_0 5e+110)
     (* w0 t_0)
     (* w0 (sqrt (- 1.0 (* (* t_1 M) (/ (* (* t_1 h) M) l))))))))
double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
	double t_1 = D / (d + d);
	double tmp;
	if (t_0 <= 5e+110) {
		tmp = w0 * t_0;
	} else {
		tmp = w0 * sqrt((1.0 - ((t_1 * M) * (((t_1 * h) * M) / 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(w0, m, d, h, l, d_1)
use fmin_fmax_functions
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
    t_1 = d / (d_1 + d_1)
    if (t_0 <= 5d+110) then
        tmp = w0 * t_0
    else
        tmp = w0 * sqrt((1.0d0 - ((t_1 * m) * (((t_1 * h) * m) / l))))
    end if
    code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
	double t_1 = D / (d + d);
	double tmp;
	if (t_0 <= 5e+110) {
		tmp = w0 * t_0;
	} else {
		tmp = w0 * Math.sqrt((1.0 - ((t_1 * M) * (((t_1 * h) * M) / l))));
	}
	return tmp;
}
def code(w0, M, D, h, l, d):
	t_0 = math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
	t_1 = D / (d + d)
	tmp = 0
	if t_0 <= 5e+110:
		tmp = w0 * t_0
	else:
		tmp = w0 * math.sqrt((1.0 - ((t_1 * M) * (((t_1 * h) * M) / l))))
	return tmp
function code(w0, M, D, h, l, d)
	t_0 = sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))
	t_1 = Float64(D / Float64(d + d))
	tmp = 0.0
	if (t_0 <= 5e+110)
		tmp = Float64(w0 * t_0);
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(t_1 * M) * Float64(Float64(Float64(t_1 * h) * M) / l)))));
	end
	return tmp
end
function tmp_2 = code(w0, M, D, h, l, d)
	t_0 = sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
	t_1 = D / (d + d);
	tmp = 0.0;
	if (t_0 <= 5e+110)
		tmp = w0 * t_0;
	else
		tmp = w0 * sqrt((1.0 - ((t_1 * M) * (((t_1 * h) * M) / l))));
	end
	tmp_2 = tmp;
end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(D / N[(d + d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+110], N[(w0 * t$95$0), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(t$95$1 * M), $MachinePrecision] * N[(N[(N[(t$95$1 * h), $MachinePrecision] * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.8%

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

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

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\left(M \cdot \frac{D}{d + d}\right) \cdot h\right)}{\ell}} \]
      12. lower-*.f6467.5

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\left(\color{blue}{\frac{D}{d + d}} \cdot M\right) \cdot h\right)}{\ell}} \]
      19. lift-+.f6467.5

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot h}{\ell}}} \]
      5. lower-/.f6468.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\color{blue}{\left(\frac{D}{d + d} \cdot h\right) \cdot M}}{\ell}} \]
      5. lower-*.f6467.9

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

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

Alternative 2: 88.6% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{w0} \]
    3. Step-by-step derivation
      1. Applied rewrites99.6%

        \[\leadsto \color{blue}{w0} \]

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

      1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\left(M \cdot \frac{D}{d + d}\right) \cdot h\right)}{\ell}} \]
        12. lower-*.f6467.5

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\left(\color{blue}{\frac{D}{d + d}} \cdot M\right) \cdot h\right)}{\ell}} \]
        19. lift-+.f6467.5

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot h}{\ell}}} \]
        5. lower-/.f6468.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\color{blue}{\left(\frac{D}{d + d} \cdot h\right) \cdot M}}{\ell}} \]
        5. lower-*.f6467.9

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

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

    Alternative 3: 86.5% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{D}{d + d}\\ w0 \cdot \sqrt{1 - \left(t\_0 \cdot M\right) \cdot \frac{t\_0 \cdot \left(h \cdot M\right)}{\ell}} \end{array} \end{array} \]
    (FPCore (w0 M D h l d)
     :precision binary64
     (let* ((t_0 (/ D (+ d d))))
       (* w0 (sqrt (- 1.0 (* (* t_0 M) (/ (* t_0 (* h M)) l)))))))
    double code(double w0, double M, double D, double h, double l, double d) {
    	double t_0 = D / (d + d);
    	return w0 * sqrt((1.0 - ((t_0 * M) * ((t_0 * (h * M)) / 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(w0, m, d, h, l, d_1)
    use fmin_fmax_functions
        real(8), intent (in) :: w0
        real(8), intent (in) :: m
        real(8), intent (in) :: d
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: d_1
        real(8) :: t_0
        t_0 = d / (d_1 + d_1)
        code = w0 * sqrt((1.0d0 - ((t_0 * m) * ((t_0 * (h * m)) / l))))
    end function
    
    public static double code(double w0, double M, double D, double h, double l, double d) {
    	double t_0 = D / (d + d);
    	return w0 * Math.sqrt((1.0 - ((t_0 * M) * ((t_0 * (h * M)) / l))));
    }
    
    def code(w0, M, D, h, l, d):
    	t_0 = D / (d + d)
    	return w0 * math.sqrt((1.0 - ((t_0 * M) * ((t_0 * (h * M)) / l))))
    
    function code(w0, M, D, h, l, d)
    	t_0 = Float64(D / Float64(d + d))
    	return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(t_0 * M) * Float64(Float64(t_0 * Float64(h * M)) / l)))))
    end
    
    function tmp = code(w0, M, D, h, l, d)
    	t_0 = D / (d + d);
    	tmp = w0 * sqrt((1.0 - ((t_0 * M) * ((t_0 * (h * M)) / l))));
    end
    
    code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D / N[(d + d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(t$95$0 * M), $MachinePrecision] * N[(N[(t$95$0 * N[(h * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{D}{d + d}\\
    w0 \cdot \sqrt{1 - \left(t\_0 \cdot M\right) \cdot \frac{t\_0 \cdot \left(h \cdot M\right)}{\ell}}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\left(M \cdot \frac{D}{d + d}\right) \cdot h\right)}{\ell}} \]
      12. lower-*.f6487.8

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\left(\color{blue}{\frac{D}{d + d}} \cdot M\right) \cdot h\right)}{\ell}} \]
      19. lift-+.f6487.8

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot h}{\ell}}} \]
      5. lower-/.f6488.6

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\frac{D}{d + d} \cdot \color{blue}{\left(h \cdot M\right)}}{\ell}} \]
      15. lower-*.f6485.0

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

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\frac{D}{d + d} \cdot \left(h \cdot M\right)}{\ell}}} \]
    8. Add Preprocessing

    Alternative 4: 85.6% accurate, 0.6× speedup?

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

      1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 88.8%

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

        \[\leadsto \color{blue}{w0} \]
      3. Step-by-step derivation
        1. Applied rewrites96.2%

          \[\leadsto \color{blue}{w0} \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 5: 85.0% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{0.5 \cdot \left(\left(M \cdot D\right) \cdot h\right)}{\ell \cdot d}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
      (FPCore (w0 M D h l d)
       :precision binary64
       (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e-12)
         (*
          w0
          (sqrt (- 1.0 (* (* (/ D (+ d d)) M) (/ (* 0.5 (* (* M D) h)) (* l d))))))
         w0))
      double code(double w0, double M, double D, double h, double l, double d) {
      	double tmp;
      	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e-12) {
      		tmp = w0 * sqrt((1.0 - (((D / (d + d)) * M) * ((0.5 * ((M * D) * h)) / (l * d)))));
      	} else {
      		tmp = w0;
      	}
      	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(w0, m, d, h, l, d_1)
      use fmin_fmax_functions
          real(8), intent (in) :: w0
          real(8), intent (in) :: m
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: d_1
          real(8) :: tmp
          if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-5d-12)) then
              tmp = w0 * sqrt((1.0d0 - (((d / (d_1 + d_1)) * m) * ((0.5d0 * ((m * d) * h)) / (l * d_1)))))
          else
              tmp = w0
          end if
          code = tmp
      end function
      
      public static double code(double w0, double M, double D, double h, double l, double d) {
      	double tmp;
      	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e-12) {
      		tmp = w0 * Math.sqrt((1.0 - (((D / (d + d)) * M) * ((0.5 * ((M * D) * h)) / (l * d)))));
      	} else {
      		tmp = w0;
      	}
      	return tmp;
      }
      
      def code(w0, M, D, h, l, d):
      	tmp = 0
      	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e-12:
      		tmp = w0 * math.sqrt((1.0 - (((D / (d + d)) * M) * ((0.5 * ((M * D) * h)) / (l * d)))))
      	else:
      		tmp = w0
      	return tmp
      
      function code(w0, M, D, h, l, d)
      	tmp = 0.0
      	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e-12)
      		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(D / Float64(d + d)) * M) * Float64(Float64(0.5 * Float64(Float64(M * D) * h)) / Float64(l * d))))));
      	else
      		tmp = w0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(w0, M, D, h, l, d)
      	tmp = 0.0;
      	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -5e-12)
      		tmp = w0 * sqrt((1.0 - (((D / (d + d)) * M) * ((0.5 * ((M * D) * h)) / (l * d)))));
      	else
      		tmp = w0;
      	end
      	tmp_2 = tmp;
      end
      
      code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e-12], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(D / N[(d + d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * N[(N[(0.5 * N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\
      \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{0.5 \cdot \left(\left(M \cdot D\right) \cdot h\right)}{\ell \cdot d}}\\
      
      \mathbf{else}:\\
      \;\;\;\;w0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.9999999999999997e-12

        1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{\color{blue}{d + d}} \cdot M\right) \cdot \left(\left(M \cdot \frac{D}{d + d}\right) \cdot h\right)}{\ell}} \]
          12. lower-*.f6466.3

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot \left(\left(\color{blue}{\frac{D}{d + d}} \cdot M\right) \cdot h\right)}{\ell}} \]
          19. lift-+.f6466.3

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\left(\frac{D}{d + d} \cdot M\right) \cdot h}{\ell}}} \]
          5. lower-/.f6468.7

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

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{D}{d + d} \cdot M\right) \cdot \frac{\frac{D}{d + d} \cdot \color{blue}{\left(h \cdot M\right)}}{\ell}} \]
          15. lower-*.f6464.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 88.8%

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

          \[\leadsto \color{blue}{w0} \]
        3. Step-by-step derivation
          1. Applied rewrites96.2%

            \[\leadsto \color{blue}{w0} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 6: 84.5% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
        (FPCore (w0 M D h l d)
         :precision binary64
         (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e-13)
           (* w0 (sqrt (- 1.0 (* (* (/ (/ (* (* M (* M D)) D) d) d) 0.25) (/ h l)))))
           w0))
        double code(double w0, double M, double D, double h, double l, double d) {
        	double tmp;
        	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
        		tmp = w0 * sqrt((1.0 - ((((((M * (M * D)) * D) / d) / d) * 0.25) * (h / l))));
        	} else {
        		tmp = w0;
        	}
        	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(w0, m, d, h, l, d_1)
        use fmin_fmax_functions
            real(8), intent (in) :: w0
            real(8), intent (in) :: m
            real(8), intent (in) :: d
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: d_1
            real(8) :: tmp
            if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d-13)) then
                tmp = w0 * sqrt((1.0d0 - ((((((m * (m * d)) * d) / d_1) / d_1) * 0.25d0) * (h / l))))
            else
                tmp = w0
            end if
            code = tmp
        end function
        
        public static double code(double w0, double M, double D, double h, double l, double d) {
        	double tmp;
        	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
        		tmp = w0 * Math.sqrt((1.0 - ((((((M * (M * D)) * D) / d) / d) * 0.25) * (h / l))));
        	} else {
        		tmp = w0;
        	}
        	return tmp;
        }
        
        def code(w0, M, D, h, l, d):
        	tmp = 0
        	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13:
        		tmp = w0 * math.sqrt((1.0 - ((((((M * (M * D)) * D) / d) / d) * 0.25) * (h / l))))
        	else:
        		tmp = w0
        	return tmp
        
        function code(w0, M, D, h, l, d)
        	tmp = 0.0
        	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e-13)
        		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(M * Float64(M * D)) * D) / d) / d) * 0.25) * Float64(h / l)))));
        	else
        		tmp = w0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(w0, M, D, h, l, d)
        	tmp = 0.0;
        	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e-13)
        		tmp = w0 * sqrt((1.0 - ((((((M * (M * D)) * D) / d) / d) * 0.25) * (h / l))));
        	else
        		tmp = w0;
        	end
        	tmp_2 = tmp;
        end
        
        code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e-13], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\
        \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\
        
        \mathbf{else}:\\
        \;\;\;\;w0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2.0000000000000001e-13

          1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
            11. lower-*.f6440.7

              \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
          4. Applied rewrites40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d}}{d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
            18. lift-*.f6450.9

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

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

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

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

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
          8. Applied rewrites56.7%

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

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

          1. Initial program 88.8%

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

            \[\leadsto \color{blue}{w0} \]
          3. Step-by-step derivation
            1. Applied rewrites96.2%

              \[\leadsto \color{blue}{w0} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 7: 83.8% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\left(\left(M \cdot D\right) \cdot M\right) \cdot \frac{D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
          (FPCore (w0 M D h l d)
           :precision binary64
           (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e-13)
             (* w0 (sqrt (- 1.0 (* (* (/ (* (* (* M D) M) (/ D d)) d) 0.25) (/ h l)))))
             w0))
          double code(double w0, double M, double D, double h, double l, double d) {
          	double tmp;
          	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
          		tmp = w0 * sqrt((1.0 - ((((((M * D) * M) * (D / d)) / d) * 0.25) * (h / l))));
          	} else {
          		tmp = w0;
          	}
          	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(w0, m, d, h, l, d_1)
          use fmin_fmax_functions
              real(8), intent (in) :: w0
              real(8), intent (in) :: m
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d-13)) then
                  tmp = w0 * sqrt((1.0d0 - ((((((m * d) * m) * (d / d_1)) / d_1) * 0.25d0) * (h / l))))
              else
                  tmp = w0
              end if
              code = tmp
          end function
          
          public static double code(double w0, double M, double D, double h, double l, double d) {
          	double tmp;
          	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
          		tmp = w0 * Math.sqrt((1.0 - ((((((M * D) * M) * (D / d)) / d) * 0.25) * (h / l))));
          	} else {
          		tmp = w0;
          	}
          	return tmp;
          }
          
          def code(w0, M, D, h, l, d):
          	tmp = 0
          	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13:
          		tmp = w0 * math.sqrt((1.0 - ((((((M * D) * M) * (D / d)) / d) * 0.25) * (h / l))))
          	else:
          		tmp = w0
          	return tmp
          
          function code(w0, M, D, h, l, d)
          	tmp = 0.0
          	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e-13)
          		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(Float64(M * D) * M) * Float64(D / d)) / d) * 0.25) * Float64(h / l)))));
          	else
          		tmp = w0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(w0, M, D, h, l, d)
          	tmp = 0.0;
          	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e-13)
          		tmp = w0 * sqrt((1.0 - ((((((M * D) * M) * (D / d)) / d) * 0.25) * (h / l))));
          	else
          		tmp = w0;
          	end
          	tmp_2 = tmp;
          end
          
          code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e-13], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\
          \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\left(\left(M \cdot D\right) \cdot M\right) \cdot \frac{D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2.0000000000000001e-13

            1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
              11. lower-*.f6440.7

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
            4. Applied rewrites40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(\left(M \cdot M\right) \cdot D\right) \cdot D}{d}}{d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
              18. lift-*.f6450.9

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

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

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

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

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{\left(M \cdot \left(M \cdot D\right)\right) \cdot D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
            8. Applied rewrites56.7%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(\left(M \cdot D\right) \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
              12. lower-/.f6459.0

                \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(\left(M \cdot D\right) \cdot M\right) \cdot \frac{D}{d}}{d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
            10. Applied rewrites59.0%

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

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

            1. Initial program 88.8%

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

              \[\leadsto \color{blue}{w0} \]
            3. Step-by-step derivation
              1. Applied rewrites96.2%

                \[\leadsto \color{blue}{w0} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 8: 82.5% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
            (FPCore (w0 M D h l d)
             :precision binary64
             (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e-13)
               (* w0 (sqrt (- 1.0 (* (* (/ (* (* D M) (* D M)) (* d d)) 0.25) (/ h l)))))
               w0))
            double code(double w0, double M, double D, double h, double l, double d) {
            	double tmp;
            	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
            		tmp = w0 * sqrt((1.0 - (((((D * M) * (D * M)) / (d * d)) * 0.25) * (h / l))));
            	} else {
            		tmp = w0;
            	}
            	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(w0, m, d, h, l, d_1)
            use fmin_fmax_functions
                real(8), intent (in) :: w0
                real(8), intent (in) :: m
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: d_1
                real(8) :: tmp
                if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-2d-13)) then
                    tmp = w0 * sqrt((1.0d0 - (((((d * m) * (d * m)) / (d_1 * d_1)) * 0.25d0) * (h / l))))
                else
                    tmp = w0
                end if
                code = tmp
            end function
            
            public static double code(double w0, double M, double D, double h, double l, double d) {
            	double tmp;
            	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
            		tmp = w0 * Math.sqrt((1.0 - (((((D * M) * (D * M)) / (d * d)) * 0.25) * (h / l))));
            	} else {
            		tmp = w0;
            	}
            	return tmp;
            }
            
            def code(w0, M, D, h, l, d):
            	tmp = 0
            	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13:
            		tmp = w0 * math.sqrt((1.0 - (((((D * M) * (D * M)) / (d * d)) * 0.25) * (h / l))))
            	else:
            		tmp = w0
            	return tmp
            
            function code(w0, M, D, h, l, d)
            	tmp = 0.0
            	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e-13)
            		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(D * M) * Float64(D * M)) / Float64(d * d)) * 0.25) * Float64(h / l)))));
            	else
            		tmp = w0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(w0, M, D, h, l, d)
            	tmp = 0.0;
            	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -2e-13)
            		tmp = w0 * sqrt((1.0 - (((((D * M) * (D * M)) / (d * d)) * 0.25) * (h / l))));
            	else
            		tmp = w0;
            	end
            	tmp_2 = tmp;
            end
            
            code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e-13], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(N[(D * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\
            \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}}\\
            
            \mathbf{else}:\\
            \;\;\;\;w0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2.0000000000000001e-13

              1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
                11. lower-*.f6440.7

                  \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
              4. Applied rewrites40.7%

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

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

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

                  \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
                4. unswap-sqrN/A

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d} \cdot \frac{1}{4}\right) \cdot \frac{h}{\ell}} \]
                9. lower-*.f6452.4

                  \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d} \cdot 0.25\right) \cdot \frac{h}{\ell}} \]
              6. Applied rewrites52.4%

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

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

              1. Initial program 88.8%

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

                \[\leadsto \color{blue}{w0} \]
              3. Step-by-step derivation
                1. Applied rewrites96.2%

                  \[\leadsto \color{blue}{w0} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 9: 82.0% accurate, 0.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\ \;\;\;\;w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{d \cdot d}, -0.25, \ell\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
              (FPCore (w0 M D h l d)
               :precision binary64
               (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -2e-13)
                 (* w0 (sqrt (/ (fma (* (* (* M D) (* M D)) (/ h (* d d))) -0.25 l) l)))
                 w0))
              double code(double w0, double M, double D, double h, double l, double d) {
              	double tmp;
              	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -2e-13) {
              		tmp = w0 * sqrt((fma((((M * D) * (M * D)) * (h / (d * d))), -0.25, l) / l));
              	} else {
              		tmp = w0;
              	}
              	return tmp;
              }
              
              function code(w0, M, D, h, l, d)
              	tmp = 0.0
              	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -2e-13)
              		tmp = Float64(w0 * sqrt(Float64(fma(Float64(Float64(Float64(M * D) * Float64(M * D)) * Float64(h / Float64(d * d))), -0.25, l) / l)));
              	else
              		tmp = w0;
              	end
              	return tmp
              end
              
              code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e-13], N[(w0 * N[Sqrt[N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25 + l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{-13}:\\
              \;\;\;\;w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{d \cdot d}, -0.25, \ell\right)}{\ell}}\\
              
              \mathbf{else}:\\
              \;\;\;\;w0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2.0000000000000001e-13

                1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\frac{\ell - \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}}{\ell}} \]
                  2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), \frac{-1}{4}, \ell\right)}{\ell}} \]
                  22. lift-*.f6439.4

                    \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), -0.25, \ell\right)}{\ell}} \]
                8. Applied rewrites39.4%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \frac{h}{d \cdot d}, \frac{-1}{4}, \ell\right)}{\ell}} \]
                  11. pow-prod-downN/A

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{d \cdot d}, \frac{-1}{4}, \ell\right)}{\ell}} \]
                  19. lift-*.f6450.7

                    \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{d \cdot d}, -0.25, \ell\right)}{\ell}} \]
                10. Applied rewrites50.7%

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

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

                1. Initial program 88.8%

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

                  \[\leadsto \color{blue}{w0} \]
                3. Step-by-step derivation
                  1. Applied rewrites96.2%

                    \[\leadsto \color{blue}{w0} \]
                4. Recombined 2 regimes into one program.
                5. Add Preprocessing

                Alternative 10: 81.9% accurate, 0.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.25, h, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                (FPCore (w0 M D h l d)
                 :precision binary64
                 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e-12)
                   (* w0 (sqrt (fma (* (/ (* (* M D) (* M D)) (* (* d d) l)) -0.25) h 1.0)))
                   w0))
                double code(double w0, double M, double D, double h, double l, double d) {
                	double tmp;
                	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e-12) {
                		tmp = w0 * sqrt(fma(((((M * D) * (M * D)) / ((d * d) * l)) * -0.25), h, 1.0));
                	} else {
                		tmp = w0;
                	}
                	return tmp;
                }
                
                function code(w0, M, D, h, l, d)
                	tmp = 0.0
                	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e-12)
                		tmp = Float64(w0 * sqrt(fma(Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / Float64(Float64(d * d) * l)) * -0.25), h, 1.0)));
                	else
                		tmp = w0;
                	end
                	return tmp
                end
                
                code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e-12], N[(w0 * N[Sqrt[N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\
                \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.25, h, 1\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;w0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.9999999999999997e-12

                  1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\frac{\ell - \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}}{\ell}} \]
                    2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), \frac{-1}{4}, \ell\right)}{\ell}} \]
                    22. lift-*.f6439.4

                      \[\leadsto w0 \cdot \sqrt{\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), -0.25, \ell\right)}{\ell}} \]
                  8. Applied rewrites39.4%

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

                    \[\leadsto w0 \cdot \sqrt{h \cdot \color{blue}{\left(\frac{-1}{4} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell} + \frac{1}{h}\right)}} \]
                  10. Step-by-step derivation
                    1. distribute-rgt-inN/A

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}\right) \cdot h + {h}^{0}} \]
                    5. metadata-evalN/A

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

                      \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{-1}{4} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, h, 1\right)} \]
                  11. Applied rewrites50.9%

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

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

                  1. Initial program 88.8%

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

                    \[\leadsto \color{blue}{w0} \]
                  3. Step-by-step derivation
                    1. Applied rewrites96.2%

                      \[\leadsto \color{blue}{w0} \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 11: 79.4% accurate, 0.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+229}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, -0.125, 1\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                  (FPCore (w0 M D h l d)
                   :precision binary64
                   (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+229)
                     (* w0 (fma (/ (* (* M (* M h)) (* D D)) (* d (* d l))) -0.125 1.0))
                     w0))
                  double code(double w0, double M, double D, double h, double l, double d) {
                  	double tmp;
                  	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+229) {
                  		tmp = w0 * fma((((M * (M * h)) * (D * D)) / (d * (d * l))), -0.125, 1.0);
                  	} else {
                  		tmp = w0;
                  	}
                  	return tmp;
                  }
                  
                  function code(w0, M, D, h, l, d)
                  	tmp = 0.0
                  	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+229)
                  		tmp = Float64(w0 * fma(Float64(Float64(Float64(M * Float64(M * h)) * Float64(D * D)) / Float64(d * Float64(d * l))), -0.125, 1.0));
                  	else
                  		tmp = w0;
                  	end
                  	return tmp
                  end
                  
                  code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+229], N[(w0 * N[(N[(N[(N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision]), $MachinePrecision], w0]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+229}:\\
                  \;\;\;\;w0 \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, -0.125, 1\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;w0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -5.0000000000000005e229

                    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                      14. lower-*.f6442.2

                        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                    4. Applied rewrites42.2%

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

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

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

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

                        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                      5. lower-*.f6443.5

                        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                    6. Applied rewrites43.5%

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

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

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

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

                        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, \frac{-1}{8}, 1\right) \]
                      5. lower-*.f6445.5

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

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

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

                    1. Initial program 89.6%

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

                      \[\leadsto \color{blue}{w0} \]
                    3. Step-by-step derivation
                      1. Applied rewrites89.5%

                        \[\leadsto \color{blue}{w0} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 12: 79.1% accurate, 0.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125, h, 1\right) \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                    (FPCore (w0 M D h l d)
                     :precision binary64
                     (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e-12)
                       (* (fma (* (/ (* (* M D) (* M D)) (* (* d d) l)) -0.125) h 1.0) w0)
                       w0))
                    double code(double w0, double M, double D, double h, double l, double d) {
                    	double tmp;
                    	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e-12) {
                    		tmp = fma(((((M * D) * (M * D)) / ((d * d) * l)) * -0.125), h, 1.0) * w0;
                    	} else {
                    		tmp = w0;
                    	}
                    	return tmp;
                    }
                    
                    function code(w0, M, D, h, l, d)
                    	tmp = 0.0
                    	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e-12)
                    		tmp = Float64(fma(Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / Float64(Float64(d * d) * l)) * -0.125), h, 1.0) * w0);
                    	else
                    		tmp = w0;
                    	end
                    	return tmp
                    end
                    
                    code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e-12], N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * h + 1.0), $MachinePrecision] * w0), $MachinePrecision], w0]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{-12}:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125, h, 1\right) \cdot w0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;w0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.9999999999999997e-12

                      1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                        14. lower-*.f6435.7

                          \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                      4. Applied rewrites35.7%

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(\frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot w0} \]
                      9. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot {M}^{2}}{{d}^{2} \cdot \ell}, h, 1\right) \cdot w0 \]
                      11. Applied rewrites42.5%

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

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

                      1. Initial program 88.8%

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

                        \[\leadsto \color{blue}{w0} \]
                      3. Step-by-step derivation
                        1. Applied rewrites96.2%

                          \[\leadsto \color{blue}{w0} \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 13: 78.2% accurate, 0.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+229}:\\ \;\;\;\;\left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                      (FPCore (w0 M D h l d)
                       :precision binary64
                       (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+229)
                         (* (* (/ (* (* (* M D) (* M D)) h) (* (* d d) l)) -0.125) w0)
                         w0))
                      double code(double w0, double M, double D, double h, double l, double d) {
                      	double tmp;
                      	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+229) {
                      		tmp = (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125) * w0;
                      	} else {
                      		tmp = w0;
                      	}
                      	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(w0, m, d, h, l, d_1)
                      use fmin_fmax_functions
                          real(8), intent (in) :: w0
                          real(8), intent (in) :: m
                          real(8), intent (in) :: d
                          real(8), intent (in) :: h
                          real(8), intent (in) :: l
                          real(8), intent (in) :: d_1
                          real(8) :: tmp
                          if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-5d+229)) then
                              tmp = (((((m * d) * (m * d)) * h) / ((d_1 * d_1) * l)) * (-0.125d0)) * w0
                          else
                              tmp = w0
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double w0, double M, double D, double h, double l, double d) {
                      	double tmp;
                      	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+229) {
                      		tmp = (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125) * w0;
                      	} else {
                      		tmp = w0;
                      	}
                      	return tmp;
                      }
                      
                      def code(w0, M, D, h, l, d):
                      	tmp = 0
                      	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+229:
                      		tmp = (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125) * w0
                      	else:
                      		tmp = w0
                      	return tmp
                      
                      function code(w0, M, D, h, l, d)
                      	tmp = 0.0
                      	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+229)
                      		tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) * h) / Float64(Float64(d * d) * l)) * -0.125) * w0);
                      	else
                      		tmp = w0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(w0, M, D, h, l, d)
                      	tmp = 0.0;
                      	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -5e+229)
                      		tmp = (((((M * D) * (M * D)) * h) / ((d * d) * l)) * -0.125) * w0;
                      	else
                      		tmp = w0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+229], N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * w0), $MachinePrecision], w0]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+229}:\\
                      \;\;\;\;\left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot w0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;w0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -5.0000000000000005e229

                        1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                          14. lower-*.f6442.2

                            \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                        4. Applied rewrites42.2%

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

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

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

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

                          \[\leadsto w0 \cdot \left(\frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot D\right) \cdot D}{\left(d \cdot d\right) \cdot \ell} \cdot \color{blue}{-0.125}\right) \]
                        8. Applied rewrites41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\frac{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot h}{\left(d \cdot d\right) \cdot \ell} \cdot -0.125\right) \cdot w0 \]
                        10. Applied rewrites48.7%

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

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

                        1. Initial program 89.6%

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

                          \[\leadsto \color{blue}{w0} \]
                        3. Step-by-step derivation
                          1. Applied rewrites89.5%

                            \[\leadsto \color{blue}{w0} \]
                        4. Recombined 2 regimes into one program.
                        5. Add Preprocessing

                        Alternative 14: 77.8% accurate, 0.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+270}:\\ \;\;\;\;\left(\frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}{d \cdot \left(\ell \cdot d\right)} \cdot -0.125\right) \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                        (FPCore (w0 M D h l d)
                         :precision binary64
                         (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+270)
                           (* (* (/ (* (* M M) (* (* D D) h)) (* d (* l d))) -0.125) w0)
                           w0))
                        double code(double w0, double M, double D, double h, double l, double d) {
                        	double tmp;
                        	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270) {
                        		tmp = ((((M * M) * ((D * D) * h)) / (d * (l * d))) * -0.125) * w0;
                        	} else {
                        		tmp = w0;
                        	}
                        	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(w0, m, d, h, l, d_1)
                        use fmin_fmax_functions
                            real(8), intent (in) :: w0
                            real(8), intent (in) :: m
                            real(8), intent (in) :: d
                            real(8), intent (in) :: h
                            real(8), intent (in) :: l
                            real(8), intent (in) :: d_1
                            real(8) :: tmp
                            if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-5d+270)) then
                                tmp = ((((m * m) * ((d * d) * h)) / (d_1 * (l * d_1))) * (-0.125d0)) * w0
                            else
                                tmp = w0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double w0, double M, double D, double h, double l, double d) {
                        	double tmp;
                        	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270) {
                        		tmp = ((((M * M) * ((D * D) * h)) / (d * (l * d))) * -0.125) * w0;
                        	} else {
                        		tmp = w0;
                        	}
                        	return tmp;
                        }
                        
                        def code(w0, M, D, h, l, d):
                        	tmp = 0
                        	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270:
                        		tmp = ((((M * M) * ((D * D) * h)) / (d * (l * d))) * -0.125) * w0
                        	else:
                        		tmp = w0
                        	return tmp
                        
                        function code(w0, M, D, h, l, d)
                        	tmp = 0.0
                        	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+270)
                        		tmp = Float64(Float64(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * h)) / Float64(d * Float64(l * d))) * -0.125) * w0);
                        	else
                        		tmp = w0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(w0, M, D, h, l, d)
                        	tmp = 0.0;
                        	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -5e+270)
                        		tmp = ((((M * M) * ((D * D) * h)) / (d * (l * d))) * -0.125) * w0;
                        	else
                        		tmp = w0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+270], N[(N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * w0), $MachinePrecision], w0]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+270}:\\
                        \;\;\;\;\left(\frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}{d \cdot \left(\ell \cdot d\right)} \cdot -0.125\right) \cdot w0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;w0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999976e270

                          1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                            14. lower-*.f6443.3

                              \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                          4. Applied rewrites43.3%

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

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

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

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

                            \[\leadsto w0 \cdot \left(\frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot D\right) \cdot D}{\left(d \cdot d\right) \cdot \ell} \cdot \color{blue}{-0.125}\right) \]
                          8. Applied rewrites42.9%

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

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

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

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

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

                              \[\leadsto \left(\frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}{d \cdot \left(\ell \cdot d\right)} \cdot \frac{-1}{8}\right) \cdot w0 \]
                            6. lower-*.f6444.9

                              \[\leadsto \left(\frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}{d \cdot \left(\ell \cdot d\right)} \cdot -0.125\right) \cdot w0 \]
                          10. Applied rewrites44.9%

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

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

                          1. Initial program 89.7%

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

                            \[\leadsto \color{blue}{w0} \]
                          3. Step-by-step derivation
                            1. Applied rewrites88.6%

                              \[\leadsto \color{blue}{w0} \]
                          4. Recombined 2 regimes into one program.
                          5. Add Preprocessing

                          Alternative 15: 77.4% accurate, 0.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+270}:\\ \;\;\;\;\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right) \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                          (FPCore (w0 M D h l d)
                           :precision binary64
                           (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+270)
                             (* (* (* (* M M) (* (* D D) (/ h (* (* d d) l)))) -0.125) w0)
                             w0))
                          double code(double w0, double M, double D, double h, double l, double d) {
                          	double tmp;
                          	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270) {
                          		tmp = (((M * M) * ((D * D) * (h / ((d * d) * l)))) * -0.125) * w0;
                          	} else {
                          		tmp = w0;
                          	}
                          	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(w0, m, d, h, l, d_1)
                          use fmin_fmax_functions
                              real(8), intent (in) :: w0
                              real(8), intent (in) :: m
                              real(8), intent (in) :: d
                              real(8), intent (in) :: h
                              real(8), intent (in) :: l
                              real(8), intent (in) :: d_1
                              real(8) :: tmp
                              if (((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-5d+270)) then
                                  tmp = (((m * m) * ((d * d) * (h / ((d_1 * d_1) * l)))) * (-0.125d0)) * w0
                              else
                                  tmp = w0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double w0, double M, double D, double h, double l, double d) {
                          	double tmp;
                          	if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270) {
                          		tmp = (((M * M) * ((D * D) * (h / ((d * d) * l)))) * -0.125) * w0;
                          	} else {
                          		tmp = w0;
                          	}
                          	return tmp;
                          }
                          
                          def code(w0, M, D, h, l, d):
                          	tmp = 0
                          	if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+270:
                          		tmp = (((M * M) * ((D * D) * (h / ((d * d) * l)))) * -0.125) * w0
                          	else:
                          		tmp = w0
                          	return tmp
                          
                          function code(w0, M, D, h, l, d)
                          	tmp = 0.0
                          	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+270)
                          		tmp = Float64(Float64(Float64(Float64(M * M) * Float64(Float64(D * D) * Float64(h / Float64(Float64(d * d) * l)))) * -0.125) * w0);
                          	else
                          		tmp = w0;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(w0, M, D, h, l, d)
                          	tmp = 0.0;
                          	if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -5e+270)
                          		tmp = (((M * M) * ((D * D) * (h / ((d * d) * l)))) * -0.125) * w0;
                          	else
                          		tmp = w0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+270], N[(N[(N[(N[(M * M), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(h / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * w0), $MachinePrecision], w0]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+270}:\\
                          \;\;\;\;\left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right) \cdot w0\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;w0\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.99999999999999976e270

                            1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, \frac{-1}{8}, 1\right) \]
                              14. lower-*.f6443.3

                                \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}, -0.125, 1\right) \]
                            4. Applied rewrites43.3%

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

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

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

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

                              \[\leadsto w0 \cdot \left(\frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot D\right) \cdot D}{\left(d \cdot d\right) \cdot \ell} \cdot \color{blue}{-0.125}\right) \]
                            8. Applied rewrites42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(\left(\left(M \cdot M\right) \cdot \left(\left(D \cdot D\right) \cdot \frac{h}{\left(d \cdot d\right) \cdot \ell}\right)\right) \cdot -0.125\right) \cdot w0 \]
                            10. Applied rewrites43.4%

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

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

                            1. Initial program 89.7%

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

                              \[\leadsto \color{blue}{w0} \]
                            3. Step-by-step derivation
                              1. Applied rewrites88.6%

                                \[\leadsto \color{blue}{w0} \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 16: 68.0% accurate, 39.8× speedup?

                            \[\begin{array}{l} \\ w0 \end{array} \]
                            (FPCore (w0 M D h l d) :precision binary64 w0)
                            double code(double w0, double M, double D, double h, double l, double d) {
                            	return w0;
                            }
                            
                            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(w0, m, d, h, l, d_1)
                            use fmin_fmax_functions
                                real(8), intent (in) :: w0
                                real(8), intent (in) :: m
                                real(8), intent (in) :: d
                                real(8), intent (in) :: h
                                real(8), intent (in) :: l
                                real(8), intent (in) :: d_1
                                code = w0
                            end function
                            
                            public static double code(double w0, double M, double D, double h, double l, double d) {
                            	return w0;
                            }
                            
                            def code(w0, M, D, h, l, d):
                            	return w0
                            
                            function code(w0, M, D, h, l, d)
                            	return w0
                            end
                            
                            function tmp = code(w0, M, D, h, l, d)
                            	tmp = w0;
                            end
                            
                            code[w0_, M_, D_, h_, l_, d_] := w0
                            
                            \begin{array}{l}
                            
                            \\
                            w0
                            \end{array}
                            
                            Derivation
                            1. Initial program 81.4%

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

                              \[\leadsto \color{blue}{w0} \]
                            3. Step-by-step derivation
                              1. Applied rewrites68.0%

                                \[\leadsto \color{blue}{w0} \]
                              2. Add Preprocessing

                              Reproduce

                              ?
                              herbie shell --seed 2025108 
                              (FPCore (w0 M D h l d)
                                :name "Henrywood and Agarwal, Equation (9a)"
                                :precision binary64
                                (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))