Henrywood and Agarwal, Equation (13)

Percentage Accurate: 25.0% → 47.8%
Time: 12.8s
Alternatives: 10
Speedup: N/A×

Specification

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

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 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: 25.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}

Alternative 1: 47.8% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3 \cdot 10^{-192} \lor \neg \left(M\_m \leq 1.65 \cdot 10^{-86}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot 0\right)}{w \cdot 2}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (or (<= M_m 3e-192) (not (<= M_m 1.65e-86)))
   (* (/ c0 (* 2.0 w)) (/ (/ (* (* (/ c0 h) d) (* (/ d w) 2.0)) D) D))
   (/ (* c0 (* (* -1.0 c0) 0.0)) (* w 2.0))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if ((M_m <= 3e-192) || !(M_m <= 1.65e-86)) {
		tmp = (c0 / (2.0 * w)) * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	} else {
		tmp = (c0 * ((-1.0 * c0) * 0.0)) / (w * 2.0);
	}
	return tmp;
}
M_m =     private
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(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m_m
    real(8) :: tmp
    if ((m_m <= 3d-192) .or. (.not. (m_m <= 1.65d-86))) then
        tmp = (c0 / (2.0d0 * w)) * (((((c0 / h) * d_1) * ((d_1 / w) * 2.0d0)) / d) / d)
    else
        tmp = (c0 * (((-1.0d0) * c0) * 0.0d0)) / (w * 2.0d0)
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if ((M_m <= 3e-192) || !(M_m <= 1.65e-86)) {
		tmp = (c0 / (2.0 * w)) * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	} else {
		tmp = (c0 * ((-1.0 * c0) * 0.0)) / (w * 2.0);
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if (M_m <= 3e-192) or not (M_m <= 1.65e-86):
		tmp = (c0 / (2.0 * w)) * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D)
	else:
		tmp = (c0 * ((-1.0 * c0) * 0.0)) / (w * 2.0)
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if ((M_m <= 3e-192) || !(M_m <= 1.65e-86))
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(Float64(Float64(c0 / h) * d) * Float64(Float64(d / w) * 2.0)) / D) / D));
	else
		tmp = Float64(Float64(c0 * Float64(Float64(-1.0 * c0) * 0.0)) / Float64(w * 2.0));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if ((M_m <= 3e-192) || ~((M_m <= 1.65e-86)))
		tmp = (c0 / (2.0 * w)) * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	else
		tmp = (c0 * ((-1.0 * c0) * 0.0)) / (w * 2.0);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[Or[LessEqual[M$95$m, 3e-192], N[Not[LessEqual[M$95$m, 1.65e-86]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(c0 / h), $MachinePrecision] * d), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[(N[(-1.0 * c0), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision] / N[(w * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 3 \cdot 10^{-192} \lor \neg \left(M\_m \leq 1.65 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot 0\right)}{w \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 2.9999999999999999e-192 or 1.64999999999999993e-86 < M

    1. Initial program 20.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6436.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites36.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6439.5

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites39.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      8. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      10. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{h \cdot w}}{D}}{D} \]
      11. associate-*r/N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
    9. Applied rewrites46.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      11. lift-*.f6450.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
    11. Applied rewrites50.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]

    if 2.9999999999999999e-192 < M < 1.64999999999999993e-86

    1. Initial program 14.1%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around -inf

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(\color{blue}{-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      4. distribute-lft1-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(\left(-1 + 1\right) \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      6. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}}\right)\right) \]
      7. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}}\right)\right) \]
      8. pow2N/A

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}}\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}}\right)\right) \]
      12. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot \color{blue}{D}\right)}\right)\right) \]
      13. associate-*r*N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}}\right)\right) \]
    5. Applied rewrites14.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w}} \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}\right)\right)}{2 \cdot w}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot \left(0 \cdot \frac{d \cdot d}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}\right)\right)}{2 \cdot w}} \]
    7. Applied rewrites56.9%

      \[\leadsto \color{blue}{\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot 0\right)}{w \cdot 2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3 \cdot 10^{-192} \lor \neg \left(M \leq 1.65 \cdot 10^{-86}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \left(\left(-1 \cdot c0\right) \cdot 0\right)}{w \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 46.4% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := c0 \cdot \frac{d}{\left(h \cdot w\right) \cdot D}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;t\_1 \cdot \left(t\_2 + \sqrt{t\_2 \cdot t\_2 - M\_m \cdot M\_m}\right) \leq \infty:\\ \;\;\;\;t\_1 \cdot \mathsf{fma}\left(t\_0, \frac{d}{D}, t\_0 \cdot \frac{d}{D}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (* c0 (/ d (* (* h w) D))))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M_m M_m))))) INFINITY)
     (* t_1 (fma t_0 (/ d D) (* t_0 (/ d D))))
     (* t_1 (/ (/ (* (* (/ c0 h) d) (* (/ d w) 2.0)) D) D)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 * (d / ((h * w) * D));
	double t_1 = c0 / (2.0 * w);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m))))) <= ((double) INFINITY)) {
		tmp = t_1 * fma(t_0, (d / D), (t_0 * (d / D)));
	} else {
		tmp = t_1 * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	}
	return tmp;
}
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 * Float64(d / Float64(Float64(h * w) * D)))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M_m * M_m))))) <= Inf)
		tmp = Float64(t_1 * fma(t_0, Float64(d / D), Float64(t_0 * Float64(d / D))));
	else
		tmp = Float64(t_1 * Float64(Float64(Float64(Float64(Float64(c0 / h) * d) * Float64(Float64(d / w) * 2.0)) / D) / D));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 * N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(t$95$0 * N[(d / D), $MachinePrecision] + N[(t$95$0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[(N[(N[(c0 / h), $MachinePrecision] * d), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := c0 \cdot \frac{d}{\left(h \cdot w\right) \cdot D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_1 \cdot \left(t\_2 + \sqrt{t\_2 \cdot t\_2 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(t\_0, \frac{d}{D}, t\_0 \cdot \frac{d}{D}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 72.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6471.3

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites71.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      3. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \]
      4. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. lower-*.f6472.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    7. Applied rewrites72.2%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      3. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      5. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      8. lower-*.f6476.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    9. Applied rewrites76.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\color{blue}{\left(\left(D \cdot h\right) \cdot w\right)} \cdot D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      10. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      12. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot D} \]
      13. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(w \cdot h\right) \cdot \color{blue}{\left(D \cdot D\right)}} \]
      14. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot {\color{blue}{D}}^{2}} \]
      16. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \color{blue}{\left(h \cdot w\right)}} \]
      17. associate-*r/N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \color{blue}{\frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}}\right) \]
    11. Applied rewrites82.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(c0 \cdot \frac{d}{\left(h \cdot w\right) \cdot D}, \color{blue}{\frac{d}{D}}, \left(c0 \cdot \frac{d}{\left(h \cdot w\right) \cdot D}\right) \cdot \frac{d}{D}\right) \]

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 0.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6419.8

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites19.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6422.6

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites22.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      8. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      10. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{h \cdot w}}{D}}{D} \]
      11. associate-*r/N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
    9. Applied rewrites35.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      11. lift-*.f6438.0

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
    11. Applied rewrites38.0%

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

Alternative 3: 45.1% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq 4 \cdot 10^{-219}:\\ \;\;\;\;t\_0 \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) 4e-219)
     (* t_0 (/ (/ (* (* (* c0 d) d) 2.0) (* (* h w) D)) D))
     (* t_0 (/ (/ (* (* (/ c0 h) d) (* (/ d w) 2.0)) D) D)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= 4e-219) {
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	} else {
		tmp = t_0 * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	}
	return tmp;
}
M_m =     private
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(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (m_m * m_m))))) <= 4d-219) then
        tmp = t_0 * (((((c0 * d_1) * d_1) * 2.0d0) / ((h * w) * d)) / d)
    else
        tmp = t_0 * (((((c0 / h) * d_1) * ((d_1 / w) * 2.0d0)) / d) / d)
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= 4e-219) {
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	} else {
		tmp = t_0 * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = c0 / (2.0 * w)
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= 4e-219:
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D)
	else:
		tmp = t_0 * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D)
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= 4e-219)
		tmp = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(c0 * d) * d) * 2.0) / Float64(Float64(h * w) * D)) / D));
	else
		tmp = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(c0 / h) * d) * Float64(Float64(d / w) * 2.0)) / D) / D));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = c0 / (2.0 * w);
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= 4e-219)
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	else
		tmp = t_0 * (((((c0 / h) * d) * ((d / w) * 2.0)) / D) / D);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e-219], N[(t$95$0 * N[(N[(N[(N[(N[(c0 * d), $MachinePrecision] * d), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(N[(N[(c0 / h), $MachinePrecision] * d), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq 4 \cdot 10^{-219}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 4.0000000000000001e-219

    1. Initial program 64.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6462.9

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites62.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6467.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites67.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot \left(d \cdot d\right)\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      8. lower-*.f6473.6

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    9. Applied rewrites73.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]

    if 4.0000000000000001e-219 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 10.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6427.9

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites27.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6430.4

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites30.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      8. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      10. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{h \cdot w}}{D}}{D} \]
      11. associate-*r/N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
    9. Applied rewrites41.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      5. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      11. lift-*.f6444.3

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\frac{c0}{h} \cdot d\right) \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
    11. Applied rewrites44.3%

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

Alternative 4: 45.0% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;c0 \leq 1.8 \cdot 10^{+23}:\\ \;\;\;\;t\_0 \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D}\\ \mathbf{elif}\;c0 \leq 5.3 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))))
   (if (<= c0 1.8e+23)
     (* t_0 (/ (* (/ c0 h) (/ (* (* (/ d w) 2.0) d) D)) D))
     (if (<= c0 5.3e+70)
       (*
        (fma
         (* (/ (* D D) (* c0 c0)) (* (* M_m M_m) (/ h (* d d))))
         0.25
         (/ 0.0 w))
        (* c0 c0))
       (* t_0 (/ (* 2.0 (* (* c0 d) d)) (* (* (* D h) w) D)))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double tmp;
	if (c0 <= 1.8e+23) {
		tmp = t_0 * (((c0 / h) * ((((d / w) * 2.0) * d) / D)) / D);
	} else if (c0 <= 5.3e+70) {
		tmp = fma((((D * D) / (c0 * c0)) * ((M_m * M_m) * (h / (d * d)))), 0.25, (0.0 / w)) * (c0 * c0);
	} else {
		tmp = t_0 * ((2.0 * ((c0 * d) * d)) / (((D * h) * w) * D));
	}
	return tmp;
}
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(2.0 * w))
	tmp = 0.0
	if (c0 <= 1.8e+23)
		tmp = Float64(t_0 * Float64(Float64(Float64(c0 / h) * Float64(Float64(Float64(Float64(d / w) * 2.0) * d) / D)) / D));
	elseif (c0 <= 5.3e+70)
		tmp = Float64(fma(Float64(Float64(Float64(D * D) / Float64(c0 * c0)) * Float64(Float64(M_m * M_m) * Float64(h / Float64(d * d)))), 0.25, Float64(0.0 / w)) * Float64(c0 * c0));
	else
		tmp = Float64(t_0 * Float64(Float64(2.0 * Float64(Float64(c0 * d) * d)) / Float64(Float64(Float64(D * h) * w) * D)));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, 1.8e+23], N[(t$95$0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(N[(N[(N[(d / w), $MachinePrecision] * 2.0), $MachinePrecision] * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 5.3e+70], N[(N[(N[(N[(N[(D * D), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25 + N[(0.0 / w), $MachinePrecision]), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(2.0 * N[(N[(c0 * d), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(D * h), $MachinePrecision] * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;c0 \leq 1.8 \cdot 10^{+23}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D}\\

\mathbf{elif}\;c0 \leq 5.3 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c0 < 1.7999999999999999e23

    1. Initial program 17.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6433.1

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites33.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6436.9

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites36.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      8. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      10. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{h \cdot w}}{D}}{D} \]
      11. associate-*r/N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
    9. Applied rewrites47.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      7. associate-/l*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      14. lift-*.f6448.6

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
    11. Applied rewrites48.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{\color{blue}{D}} \]

    if 1.7999999999999999e23 < c0 < 5.3e70

    1. Initial program 15.8%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6417.5

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites17.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Taylor expanded in c0 around -inf

      \[\leadsto \color{blue}{{c0}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}}{w} + \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{c0}^{2} \cdot {d}^{2}}\right)} \]
    7. Applied rewrites61.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)} \]

    if 5.3e70 < c0

    1. Initial program 28.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6440.4

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites40.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      3. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \]
      4. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. lower-*.f6444.0

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    7. Applied rewrites44.0%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      3. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      5. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      8. lower-*.f6447.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    9. Applied rewrites47.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 41.8% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\ \;\;\;\;t\_0 \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) INFINITY)
     (* t_0 (/ (/ (* (* (* c0 d) d) 2.0) (* (* h w) D)) D))
     (* t_0 (/ (* (/ c0 h) (/ (* (* (/ d w) 2.0) d) D)) D)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= ((double) INFINITY)) {
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	} else {
		tmp = t_0 * (((c0 / h) * ((((d / w) * 2.0) * d) / D)) / D);
	}
	return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	} else {
		tmp = t_0 * (((c0 / h) * ((((d / w) * 2.0) * d) / D)) / D);
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = c0 / (2.0 * w)
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= math.inf:
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D)
	else:
		tmp = t_0 * (((c0 / h) * ((((d / w) * 2.0) * d) / D)) / D)
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= Inf)
		tmp = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(c0 * d) * d) * 2.0) / Float64(Float64(h * w) * D)) / D));
	else
		tmp = Float64(t_0 * Float64(Float64(Float64(c0 / h) * Float64(Float64(Float64(Float64(d / w) * 2.0) * d) / D)) / D));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = c0 / (2.0 * w);
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Inf)
		tmp = t_0 * (((((c0 * d) * d) * 2.0) / ((h * w) * D)) / D);
	else
		tmp = t_0 * (((c0 / h) * ((((d / w) * 2.0) * d) / D)) / D);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(N[(N[(N[(N[(c0 * d), $MachinePrecision] * d), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(N[(N[(N[(d / w), $MachinePrecision] * 2.0), $MachinePrecision] * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_0 \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 72.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6471.3

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites71.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6474.1

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites74.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot \left(d \cdot d\right)\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      8. lower-*.f6478.5

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    9. Applied rewrites78.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(c0 \cdot d\right) \cdot d\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 0.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6419.8

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites19.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot \color{blue}{D}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      5. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      10. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(h \cdot w\right) \cdot D}}{D} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      15. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      16. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      18. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      19. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      20. lift-*.f6422.6

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
    7. Applied rewrites22.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{\color{blue}{D}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \]
      7. associate-/r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(\left(d \cdot d\right) \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      8. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left({d}^{2} \cdot c0\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{\left(c0 \cdot {d}^{2}\right) \cdot 2}{h \cdot w}}{D}}{D} \]
      10. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{h \cdot w}}{D}}{D} \]
      11. associate-*r/N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{2 \cdot \frac{c0 \cdot {d}^{2}}{h \cdot w}}{D}}{D} \]
    9. Applied rewrites35.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      6. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{\frac{c0}{h} \cdot \left(d \cdot \left(\frac{d}{w} \cdot 2\right)\right)}{D}}{D} \]
      7. associate-/l*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      9. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{d \cdot \left(\frac{d}{w} \cdot 2\right)}{D}}{D} \]
      11. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
      14. lift-*.f6436.3

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{D} \]
    11. Applied rewrites36.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{\frac{c0}{h} \cdot \frac{\left(\frac{d}{w} \cdot 2\right) \cdot d}{D}}{\color{blue}{D}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 41.8% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;w \leq 1.08 \cdot 10^{-26}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\ \mathbf{elif}\;w \leq 1.35 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (<= w 1.08e-26)
   (* (/ c0 (* 2.0 w)) (/ (* 2.0 (* (* c0 d) d)) (* (* (* D h) w) D)))
   (if (<= w 1.35e+146)
     (*
      (fma
       (* (/ (* D D) (* c0 c0)) (* (* M_m M_m) (/ h (* d d))))
       0.25
       (/ 0.0 w))
      (* c0 c0))
     (* (* c0 c0) (* d (/ d (* (* (* D h) (* D w)) w)))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (w <= 1.08e-26) {
		tmp = (c0 / (2.0 * w)) * ((2.0 * ((c0 * d) * d)) / (((D * h) * w) * D));
	} else if (w <= 1.35e+146) {
		tmp = fma((((D * D) / (c0 * c0)) * ((M_m * M_m) * (h / (d * d)))), 0.25, (0.0 / w)) * (c0 * c0);
	} else {
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	}
	return tmp;
}
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if (w <= 1.08e-26)
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(2.0 * Float64(Float64(c0 * d) * d)) / Float64(Float64(Float64(D * h) * w) * D)));
	elseif (w <= 1.35e+146)
		tmp = Float64(fma(Float64(Float64(Float64(D * D) / Float64(c0 * c0)) * Float64(Float64(M_m * M_m) * Float64(h / Float64(d * d)))), 0.25, Float64(0.0 / w)) * Float64(c0 * c0));
	else
		tmp = Float64(Float64(c0 * c0) * Float64(d * Float64(d / Float64(Float64(Float64(D * h) * Float64(D * w)) * w))));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[w, 1.08e-26], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * N[(N[(c0 * d), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(D * h), $MachinePrecision] * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 1.35e+146], N[(N[(N[(N[(N[(D * D), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25 + N[(0.0 / w), $MachinePrecision]), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * c0), $MachinePrecision] * N[(d * N[(d / N[(N[(N[(D * h), $MachinePrecision] * N[(D * w), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.08 \cdot 10^{-26}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\

\mathbf{elif}\;w \leq 1.35 \cdot 10^{+146}:\\
\;\;\;\;\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)\\

\mathbf{else}:\\
\;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if w < 1.07999999999999996e-26

    1. Initial program 24.2%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6440.1

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites40.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      3. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \]
      4. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. lower-*.f6441.0

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    7. Applied rewrites41.0%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      3. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      5. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]
      8. lower-*.f6444.0

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    9. Applied rewrites44.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(c0 \cdot d\right) \cdot d\right)}{\left(\left(D \cdot h\right) \cdot \color{blue}{w}\right) \cdot D} \]

    if 1.07999999999999996e-26 < w < 1.34999999999999994e146

    1. Initial program 0.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f647.4

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites7.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Taylor expanded in c0 around -inf

      \[\leadsto \color{blue}{{c0}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}}{w} + \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{c0}^{2} \cdot {d}^{2}}\right)} \]
    7. Applied rewrites32.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{D \cdot D}{c0 \cdot c0} \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right), 0.25, \frac{0}{w}\right) \cdot \left(c0 \cdot c0\right)} \]

    if 1.34999999999999994e146 < w

    1. Initial program 12.8%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

      \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      3. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      6. pow2N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
      9. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      13. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
      14. lower-*.f649.4

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    5. Applied rewrites9.4%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
      3. associate-/l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      7. pow2N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
      10. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
      11. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
      12. lower-/.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
      14. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      17. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      19. lift-*.f6418.7

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    7. Applied rewrites18.7%

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      6. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      7. associate-*r*N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      13. lift-*.f6434.9

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    9. Applied rewrites34.9%

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(\left(D \cdot D\right) \cdot h\right)\right) \cdot w}\right) \]
      5. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left({D}^{2} \cdot h\right)\right) \cdot w}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(h \cdot {D}^{2}\right)\right) \cdot w}\right) \]
      7. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot {D}^{2}\right) \cdot w}\right) \]
      8. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot \left(D \cdot D\right)\right) \cdot w}\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(w \cdot h\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot \left(h \cdot w\right)\right) \cdot D\right) \cdot w}\right) \]
      12. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot h\right) \cdot w\right) \cdot D\right) \cdot w}\right) \]
      13. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      16. lift-*.f6444.2

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      17. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      18. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
      19. lower-*.f6444.2

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
    11. Applied rewrites44.2%

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

Alternative 7: 39.2% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := {\left(d \cdot c0\right)}^{1}\\ \mathbf{if}\;c0 \leq -3.2 \cdot 10^{-158} \lor \neg \left(c0 \leq 3.7 \cdot 10^{-177}\right):\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_0 \cdot t\_0}{D \cdot D}}{\left(w \cdot w\right) \cdot h}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (pow (* d c0) 1.0)))
   (if (or (<= c0 -3.2e-158) (not (<= c0 3.7e-177)))
     (* (* c0 c0) (* d (/ d (* (* (* D h) (* D w)) w))))
     (/ (/ (* t_0 t_0) (* D D)) (* (* w w) h)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = pow((d * c0), 1.0);
	double tmp;
	if ((c0 <= -3.2e-158) || !(c0 <= 3.7e-177)) {
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	} else {
		tmp = ((t_0 * t_0) / (D * D)) / ((w * w) * h);
	}
	return tmp;
}
M_m =     private
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(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (d_1 * c0) ** 1.0d0
    if ((c0 <= (-3.2d-158)) .or. (.not. (c0 <= 3.7d-177))) then
        tmp = (c0 * c0) * (d_1 * (d_1 / (((d * h) * (d * w)) * w)))
    else
        tmp = ((t_0 * t_0) / (d * d)) / ((w * w) * h)
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = Math.pow((d * c0), 1.0);
	double tmp;
	if ((c0 <= -3.2e-158) || !(c0 <= 3.7e-177)) {
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	} else {
		tmp = ((t_0 * t_0) / (D * D)) / ((w * w) * h);
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = math.pow((d * c0), 1.0)
	tmp = 0
	if (c0 <= -3.2e-158) or not (c0 <= 3.7e-177):
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)))
	else:
		tmp = ((t_0 * t_0) / (D * D)) / ((w * w) * h)
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(d * c0) ^ 1.0
	tmp = 0.0
	if ((c0 <= -3.2e-158) || !(c0 <= 3.7e-177))
		tmp = Float64(Float64(c0 * c0) * Float64(d * Float64(d / Float64(Float64(Float64(D * h) * Float64(D * w)) * w))));
	else
		tmp = Float64(Float64(Float64(t_0 * t_0) / Float64(D * D)) / Float64(Float64(w * w) * h));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = (d * c0) ^ 1.0;
	tmp = 0.0;
	if ((c0 <= -3.2e-158) || ~((c0 <= 3.7e-177)))
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	else
		tmp = ((t_0 * t_0) / (D * D)) / ((w * w) * h);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[Power[N[(d * c0), $MachinePrecision], 1.0], $MachinePrecision]}, If[Or[LessEqual[c0, -3.2e-158], N[Not[LessEqual[c0, 3.7e-177]], $MachinePrecision]], N[(N[(c0 * c0), $MachinePrecision] * N[(d * N[(d / N[(N[(N[(D * h), $MachinePrecision] * N[(D * w), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(N[(w * w), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := {\left(d \cdot c0\right)}^{1}\\
\mathbf{if}\;c0 \leq -3.2 \cdot 10^{-158} \lor \neg \left(c0 \leq 3.7 \cdot 10^{-177}\right):\\
\;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c0 < -3.19999999999999996e-158 or 3.69999999999999993e-177 < c0

    1. Initial program 20.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

      \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      3. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      6. pow2N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
      9. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      13. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
      14. lower-*.f6427.4

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    5. Applied rewrites27.4%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
      3. associate-/l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      7. pow2N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
      10. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
      11. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
      12. lower-/.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
      14. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      17. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      19. lift-*.f6432.8

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    7. Applied rewrites32.8%

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      6. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      7. associate-*r*N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      13. lift-*.f6436.4

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    9. Applied rewrites36.4%

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(\left(D \cdot D\right) \cdot h\right)\right) \cdot w}\right) \]
      5. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left({D}^{2} \cdot h\right)\right) \cdot w}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(h \cdot {D}^{2}\right)\right) \cdot w}\right) \]
      7. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot {D}^{2}\right) \cdot w}\right) \]
      8. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot \left(D \cdot D\right)\right) \cdot w}\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(w \cdot h\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot \left(h \cdot w\right)\right) \cdot D\right) \cdot w}\right) \]
      12. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot h\right) \cdot w\right) \cdot D\right) \cdot w}\right) \]
      13. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      16. lift-*.f6441.1

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      17. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      18. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
      19. lower-*.f6441.1

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
    11. Applied rewrites41.1%

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]

    if -3.19999999999999996e-158 < c0 < 3.69999999999999993e-177

    1. Initial program 16.2%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

      \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      3. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      6. pow2N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
      9. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      13. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
      14. lower-*.f640.0

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    5. Applied rewrites0.0%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
      3. associate-/l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      7. pow2N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
      10. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
      11. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
      12. lower-/.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
      14. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      17. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      19. lift-*.f642.5

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    7. Applied rewrites2.5%

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      6. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      7. associate-*r*N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      13. lift-*.f644.8

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    9. Applied rewrites4.8%

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \color{blue}{\left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right)} \]
      3. pow2N/A

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

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

        \[\leadsto {c0}^{2} \cdot \left(d \cdot \frac{d}{\color{blue}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}}\right) \]
      6. associate-*r/N/A

        \[\leadsto {c0}^{2} \cdot \frac{d \cdot d}{\color{blue}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}} \]
      7. pow2N/A

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

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

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \]
      10. lift-*.f64N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \]
      11. lift-*.f64N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \]
      12. associate-*l*N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}} \]
      13. pow2N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left({D}^{2} \cdot h\right) \cdot \left(w \cdot w\right)} \]
      14. unpow2N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{\left({D}^{2} \cdot h\right) \cdot {w}^{\color{blue}{2}}} \]
      15. associate-*r*N/A

        \[\leadsto {c0}^{2} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}} \]
      16. associate-/l*N/A

        \[\leadsto \frac{{c0}^{2} \cdot {d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    11. Applied rewrites29.9%

      \[\leadsto \frac{\frac{{\left(d \cdot c0\right)}^{1} \cdot {\left(d \cdot c0\right)}^{1}}{D \cdot D}}{\color{blue}{\left(w \cdot w\right) \cdot h}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -3.2 \cdot 10^{-158} \lor \neg \left(c0 \leq 3.7 \cdot 10^{-177}\right):\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{\left(d \cdot c0\right)}^{1} \cdot {\left(d \cdot c0\right)}^{1}}{D \cdot D}}{\left(w \cdot w\right) \cdot h}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 37.8% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\ \;\;\;\;t\_0 \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) INFINITY)
     (* t_0 (/ (* 2.0 (* (exp (* (log d) 2.0)) c0)) (* (* (* D h) w) D)))
     (* (* c0 c0) (* d (/ d (* (* (* D h) (* D w)) w)))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= ((double) INFINITY)) {
		tmp = t_0 * ((2.0 * (exp((log(d) * 2.0)) * c0)) / (((D * h) * w) * D));
	} else {
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	}
	return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
		tmp = t_0 * ((2.0 * (Math.exp((Math.log(d) * 2.0)) * c0)) / (((D * h) * w) * D));
	} else {
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = c0 / (2.0 * w)
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= math.inf:
		tmp = t_0 * ((2.0 * (math.exp((math.log(d) * 2.0)) * c0)) / (((D * h) * w) * D))
	else:
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)))
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= Inf)
		tmp = Float64(t_0 * Float64(Float64(2.0 * Float64(exp(Float64(log(d) * 2.0)) * c0)) / Float64(Float64(Float64(D * h) * w) * D)));
	else
		tmp = Float64(Float64(c0 * c0) * Float64(d * Float64(d / Float64(Float64(Float64(D * h) * Float64(D * w)) * w))));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = c0 / (2.0 * w);
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Inf)
		tmp = t_0 * ((2.0 * (exp((log(d) * 2.0)) * c0)) / (((D * h) * w) * D));
	else
		tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(N[(2.0 * N[(N[Exp[N[(N[Log[d], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(D * h), $MachinePrecision] * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * c0), $MachinePrecision] * N[(d * N[(d / N[(N[(N[(D * h), $MachinePrecision] * N[(D * w), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_0 \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D}\\

\mathbf{else}:\\
\;\;\;\;\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 72.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{\color{blue}{{D}^{2}} \cdot \left(h \cdot w\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{\color{blue}{2}} \cdot \left(h \cdot w\right)} \]
      6. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{{D}^{2} \cdot \left(h \cdot w\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(h \cdot w\right) \cdot \color{blue}{{D}^{2}}} \]
      9. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(w \cdot h\right) \cdot {\color{blue}{D}}^{2}} \]
      10. pow2N/A

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(w \cdot h\right) \cdot D\right) \cdot \color{blue}{D}} \]
      13. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      15. lower-*.f6471.3

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
    5. Applied rewrites71.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \]
      3. *-commutativeN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \]
      4. associate-*r*N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. lower-*.f6472.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    7. Applied rewrites72.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      2. pow2N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      3. pow-to-expN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      4. lower-exp.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
      6. lower-log.f6434.8

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]
    9. Applied rewrites34.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(e^{\log d \cdot 2} \cdot c0\right)}{\left(\left(D \cdot h\right) \cdot w\right) \cdot D} \]

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 0.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in c0 around inf

      \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      3. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
      4. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
      6. pow2N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
      9. lower-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
      13. unpow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
      14. lower-*.f6412.6

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    5. Applied rewrites12.6%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
      3. associate-/l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      7. pow2N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
      10. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
      11. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
      12. lower-/.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
      13. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
      14. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      15. lift-*.f64N/A

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
      17. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
      18. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      19. lift-*.f6418.8

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    7. Applied rewrites18.8%

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
      3. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      5. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      6. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      7. associate-*r*N/A

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

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

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
      11. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      13. lift-*.f6421.3

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    9. Applied rewrites21.3%

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(\left(D \cdot D\right) \cdot h\right)\right) \cdot w}\right) \]
      5. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left({D}^{2} \cdot h\right)\right) \cdot w}\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(h \cdot {D}^{2}\right)\right) \cdot w}\right) \]
      7. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot {D}^{2}\right) \cdot w}\right) \]
      8. pow2N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot \left(D \cdot D\right)\right) \cdot w}\right) \]
      9. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(w \cdot h\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
      11. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot \left(h \cdot w\right)\right) \cdot D\right) \cdot w}\right) \]
      12. associate-*r*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot h\right) \cdot w\right) \cdot D\right) \cdot w}\right) \]
      13. associate-*l*N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      16. lift-*.f6426.7

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      17. lift-*.f64N/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
      18. *-commutativeN/A

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
      19. lower-*.f6426.7

        \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
    11. Applied rewrites26.7%

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

Alternative 9: 32.2% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (* (* c0 c0) (* d (/ d (* (* (* D h) (* D w)) w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	return (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
}
M_m =     private
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(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m_m
    code = (c0 * c0) * (d_1 * (d_1 / (((d * h) * (d * w)) * w)))
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	return (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	return (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)))
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	return Float64(Float64(c0 * c0) * Float64(d * Float64(d / Float64(Float64(Float64(D * h) * Float64(D * w)) * w))))
end
M_m = abs(M);
function tmp = code(c0, w, h, D, d, M_m)
	tmp = (c0 * c0) * (d * (d / (((D * h) * (D * w)) * w)));
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := N[(N[(c0 * c0), $MachinePrecision] * N[(d * N[(d / N[(N[(N[(D * h), $MachinePrecision] * N[(D * w), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|

\\
\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right)
\end{array}
Derivation
  1. Initial program 19.8%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in c0 around inf

    \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
  4. Step-by-step derivation
    1. associate-/l*N/A

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

      \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    3. unpow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
    4. lower-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    6. pow2N/A

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

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
    9. lower-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
    11. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
    12. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
    13. unpow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    14. lower-*.f6422.7

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
  5. Applied rewrites22.7%

    \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    3. associate-/l*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
    7. pow2N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    9. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
    10. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
    11. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
    12. lower-/.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
    13. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
    14. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    15. lift-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    17. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
    19. lift-*.f6427.6

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
  7. Applied rewrites27.6%

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

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
    3. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    6. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
    7. associate-*r*N/A

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

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
    10. lower-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left({D}^{2} \cdot h\right) \cdot w\right) \cdot w}\right) \]
    11. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    12. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    13. lift-*.f6431.0

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
  9. Applied rewrites31.0%

    \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot \color{blue}{w}}\right) \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    3. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w}\right) \]
    4. *-commutativeN/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(\left(D \cdot D\right) \cdot h\right)\right) \cdot w}\right) \]
    5. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left({D}^{2} \cdot h\right)\right) \cdot w}\right) \]
    6. *-commutativeN/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(w \cdot \left(h \cdot {D}^{2}\right)\right) \cdot w}\right) \]
    7. associate-*l*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot {D}^{2}\right) \cdot w}\right) \]
    8. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(w \cdot h\right) \cdot \left(D \cdot D\right)\right) \cdot w}\right) \]
    9. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(w \cdot h\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
    10. *-commutativeN/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w}\right) \]
    11. *-commutativeN/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot \left(h \cdot w\right)\right) \cdot D\right) \cdot w}\right) \]
    12. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(\left(D \cdot h\right) \cdot w\right) \cdot D\right) \cdot w}\right) \]
    13. associate-*l*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
    14. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
    15. lower-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
    16. lift-*.f6435.6

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
    17. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(w \cdot D\right)\right) \cdot w}\right) \]
    18. *-commutativeN/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
    19. lower-*.f6435.6

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
  11. Applied rewrites35.6%

    \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot h\right) \cdot \left(D \cdot w\right)\right) \cdot w}\right) \]
  12. Add Preprocessing

Alternative 10: 29.5% accurate, N/A× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}\right) \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (* (* c0 c0) (* d (/ d (* (* (* D D) h) (* w w))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	return (c0 * c0) * (d * (d / (((D * D) * h) * (w * w))));
}
M_m =     private
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(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m_m
    code = (c0 * c0) * (d_1 * (d_1 / (((d * d) * h) * (w * w))))
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	return (c0 * c0) * (d * (d / (((D * D) * h) * (w * w))));
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	return (c0 * c0) * (d * (d / (((D * D) * h) * (w * w))))
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	return Float64(Float64(c0 * c0) * Float64(d * Float64(d / Float64(Float64(Float64(D * D) * h) * Float64(w * w)))))
end
M_m = abs(M);
function tmp = code(c0, w, h, D, d, M_m)
	tmp = (c0 * c0) * (d * (d / (((D * D) * h) * (w * w))));
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := N[(N[(c0 * c0), $MachinePrecision] * N[(d * N[(d / N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|

\\
\left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}\right)
\end{array}
Derivation
  1. Initial program 19.8%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in c0 around inf

    \[\leadsto \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
  4. Step-by-step derivation
    1. associate-/l*N/A

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

      \[\leadsto {c0}^{2} \cdot \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    3. unpow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{\color{blue}{{d}^{2}}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)} \]
    4. lower-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{{d}^{2}}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
    6. pow2N/A

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

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}} \]
    9. lower-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left({D}^{2} \cdot h\right) \cdot {\color{blue}{w}}^{2}} \]
    11. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
    12. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}} \]
    13. unpow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
    14. lower-*.f6422.7

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)} \]
  5. Applied rewrites22.7%

    \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \frac{d \cdot d}{\color{blue}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}} \]
    3. associate-/l*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
    4. lower-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
    7. pow2N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    9. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {\color{blue}{w}}^{2}}\right) \]
    10. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot {w}^{2}}\right) \]
    11. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{{D}^{2} \cdot \color{blue}{\left(h \cdot {w}^{2}\right)}}\right) \]
    12. lower-/.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\color{blue}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}}\right) \]
    13. associate-*r*N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left({D}^{2} \cdot h\right) \cdot \color{blue}{{w}^{2}}}\right) \]
    14. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    15. lift-*.f64N/A

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

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot {w}^{2}}\right) \]
    17. pow2N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
    18. lift-*.f64N/A

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \color{blue}{\left(w \cdot w\right)}}\right) \]
    19. lift-*.f6427.6

      \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot \color{blue}{w}\right)}\right) \]
  7. Applied rewrites27.6%

    \[\leadsto \left(c0 \cdot c0\right) \cdot \left(d \cdot \color{blue}{\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot \left(w \cdot w\right)}}\right) \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2025064 
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  :precision binary64
  (* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))