Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.7% → 47.6%
Time: 20.6s
Alternatives: 13
Speedup: 156.0×

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))));
}
real(8) function code(c0, w, h, d, d_1, m)
    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 13 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: 24.7% 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))));
}
real(8) function code(c0, w, h, d, d_1, m)
    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.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot d}{D}\\ \mathbf{if}\;c0 \leq -7.5 \cdot 10^{+18}:\\ \;\;\;\;t\_0 \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\ \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\ \;\;\;\;\frac{t\_1}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\ \;\;\;\;0\\ \mathbf{elif}\;c0 \leq 1.82 \cdot 10^{+118}:\\ \;\;\;\;t\_1 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\frac{d}{D} \cdot \left(\left(d \cdot \frac{c0}{w}\right) \cdot \frac{2}{h \cdot D}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 d) D)))
   (if (<= c0 -7.5e+18)
     (* t_0 (* (* d (/ (* c0 2.0) (* w (* h D)))) (/ d D)))
     (if (<= c0 3.4e-273)
       (* (/ t_1 (* w D)) (/ (* c0 d) (* w h)))
       (if (<= c0 4e-144)
         0.0
         (if (<= c0 1.82e+118)
           (* t_1 (/ (* c0 d) (* D (* w (* w h)))))
           (* t_0 (* (/ d D) (* (* d (/ c0 w)) (/ 2.0 (* h D)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * d) / D;
	double tmp;
	if (c0 <= -7.5e+18) {
		tmp = t_0 * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
	} else if (c0 <= 3.4e-273) {
		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
	} else if (c0 <= 4e-144) {
		tmp = 0.0;
	} else if (c0 <= 1.82e+118) {
		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
	} else {
		tmp = t_0 * ((d / D) * ((d * (c0 / w)) * (2.0 / (h * D))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    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
    real(8) :: t_1
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = (c0 * d_1) / d
    if (c0 <= (-7.5d+18)) then
        tmp = t_0 * ((d_1 * ((c0 * 2.0d0) / (w * (h * d)))) * (d_1 / d))
    else if (c0 <= 3.4d-273) then
        tmp = (t_1 / (w * d)) * ((c0 * d_1) / (w * h))
    else if (c0 <= 4d-144) then
        tmp = 0.0d0
    else if (c0 <= 1.82d+118) then
        tmp = t_1 * ((c0 * d_1) / (d * (w * (w * h))))
    else
        tmp = t_0 * ((d_1 / d) * ((d_1 * (c0 / w)) * (2.0d0 / (h * d))))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * d) / D;
	double tmp;
	if (c0 <= -7.5e+18) {
		tmp = t_0 * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
	} else if (c0 <= 3.4e-273) {
		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
	} else if (c0 <= 4e-144) {
		tmp = 0.0;
	} else if (c0 <= 1.82e+118) {
		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
	} else {
		tmp = t_0 * ((d / D) * ((d * (c0 / w)) * (2.0 / (h * D))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = (c0 * d) / D
	tmp = 0
	if c0 <= -7.5e+18:
		tmp = t_0 * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D))
	elif c0 <= 3.4e-273:
		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h))
	elif c0 <= 4e-144:
		tmp = 0.0
	elif c0 <= 1.82e+118:
		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))))
	else:
		tmp = t_0 * ((d / D) * ((d * (c0 / w)) * (2.0 / (h * D))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(c0 * d) / D)
	tmp = 0.0
	if (c0 <= -7.5e+18)
		tmp = Float64(t_0 * Float64(Float64(d * Float64(Float64(c0 * 2.0) / Float64(w * Float64(h * D)))) * Float64(d / D)));
	elseif (c0 <= 3.4e-273)
		tmp = Float64(Float64(t_1 / Float64(w * D)) * Float64(Float64(c0 * d) / Float64(w * h)));
	elseif (c0 <= 4e-144)
		tmp = 0.0;
	elseif (c0 <= 1.82e+118)
		tmp = Float64(t_1 * Float64(Float64(c0 * d) / Float64(D * Float64(w * Float64(w * h)))));
	else
		tmp = Float64(t_0 * Float64(Float64(d / D) * Float64(Float64(d * Float64(c0 / w)) * Float64(2.0 / Float64(h * D)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = (c0 * d) / D;
	tmp = 0.0;
	if (c0 <= -7.5e+18)
		tmp = t_0 * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
	elseif (c0 <= 3.4e-273)
		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
	elseif (c0 <= 4e-144)
		tmp = 0.0;
	elseif (c0 <= 1.82e+118)
		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
	else
		tmp = t_0 * ((d / D) * ((d * (c0 / w)) * (2.0 / (h * D))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]}, If[LessEqual[c0, -7.5e+18], N[(t$95$0 * N[(N[(d * N[(N[(c0 * 2.0), $MachinePrecision] / N[(w * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 3.4e-273], N[(N[(t$95$1 / N[(w * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 4e-144], 0.0, If[LessEqual[c0, 1.82e+118], N[(t$95$1 * N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(N[(d * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\
\;\;\;\;\frac{t\_1}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\

\mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\
\;\;\;\;0\\

\mathbf{elif}\;c0 \leq 1.82 \cdot 10^{+118}:\\
\;\;\;\;t\_1 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c0 < -7.5e18

    1. Initial program 29.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 \color{blue}{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
      2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}} \]
    6. Step-by-step derivation
      1. Applied rewrites56.7%

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

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

        if -7.5e18 < c0 < 3.39999999999999991e-273

        1. Initial program 34.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
        6. Step-by-step derivation
          1. Applied rewrites52.1%

            \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
          2. Step-by-step derivation
            1. Applied rewrites58.3%

              \[\leadsto \frac{\frac{c0 \cdot d}{D}}{D \cdot w} \cdot \color{blue}{\frac{c0 \cdot d}{w \cdot h}} \]

            if 3.39999999999999991e-273 < c0 < 3.9999999999999998e-144

            1. Initial program 23.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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
              2. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
              3. distribute-lft1-inN/A

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

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

                \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
              6. mul0-rgtN/A

                \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
              7. metadata-evalN/A

                \[\leadsto \frac{\color{blue}{0}}{w} \]
              8. div071.6

                \[\leadsto \color{blue}{0} \]
            5. Applied rewrites71.6%

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

            if 3.9999999999999998e-144 < c0 < 1.8200000000000001e118

            1. Initial program 33.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
            6. Step-by-step derivation
              1. Applied rewrites61.7%

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

              if 1.8200000000000001e118 < c0

              1. Initial program 26.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 \color{blue}{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
                2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}} \]
              6. Step-by-step derivation
                1. Applied rewrites56.0%

                  \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)} \cdot \color{blue}{\frac{d \cdot d}{D}}\right) \]
                2. Step-by-step derivation
                  1. Applied rewrites67.2%

                    \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)} \cdot d\right) \cdot \color{blue}{\frac{d}{D}}\right) \]
                  2. Step-by-step derivation
                    1. Applied rewrites67.3%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -7.5 \cdot 10^{+18}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\ \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\ \;\;\;\;\frac{\frac{c0 \cdot d}{D}}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\ \;\;\;\;0\\ \mathbf{elif}\;c0 \leq 1.82 \cdot 10^{+118}:\\ \;\;\;\;\frac{c0 \cdot d}{D} \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\left(d \cdot \frac{c0}{w}\right) \cdot \frac{2}{h \cdot D}\right)\right)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 2: 55.1% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\left(c0 \cdot \frac{c0 \cdot d}{D}\right) \cdot \frac{d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                  (FPCore (c0 w h D d M)
                   :precision binary64
                   (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                     (if (<=
                          (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                          INFINITY)
                       (* (* c0 (/ (* c0 d) D)) (/ d (* w (* D (* w h)))))
                       0.0)))
                  double code(double c0, double w, double h, double D, double d, double M) {
                  	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                  	double tmp;
                  	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                  		tmp = (c0 * ((c0 * d) / D)) * (d / (w * (D * (w * h))));
                  	} else {
                  		tmp = 0.0;
                  	}
                  	return tmp;
                  }
                  
                  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));
                  	double tmp;
                  	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                  		tmp = (c0 * ((c0 * d) / D)) * (d / (w * (D * (w * h))));
                  	} else {
                  		tmp = 0.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(c0, w, h, D, d, M):
                  	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                  	tmp = 0
                  	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                  		tmp = (c0 * ((c0 * d) / D)) * (d / (w * (D * (w * h))))
                  	else:
                  		tmp = 0.0
                  	return tmp
                  
                  function code(c0, w, h, D, d, M)
                  	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                  	tmp = 0.0
                  	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                  		tmp = Float64(Float64(c0 * Float64(Float64(c0 * d) / D)) * Float64(d / Float64(w * Float64(D * Float64(w * h)))));
                  	else
                  		tmp = 0.0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(c0, w, h, D, d, M)
                  	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                  	tmp = 0.0;
                  	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                  		tmp = (c0 * ((c0 * d) / D)) * (d / (w * (D * (w * h))));
                  	else
                  		tmp = 0.0;
                  	end
                  	tmp_2 = tmp;
                  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]}, If[LessEqual[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], Infinity], N[(N[(c0 * N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] * N[(d / N[(w * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                  
                  \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)}\\
                  \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                  \;\;\;\;\left(c0 \cdot \frac{c0 \cdot d}{D}\right) \cdot \frac{d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;0\\
                  
                  
                  \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites84.8%

                        \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites85.1%

                          \[\leadsto \left(\frac{c0 \cdot d}{D} \cdot c0\right) \cdot \color{blue}{\frac{d}{w \cdot \left(D \cdot \left(w \cdot h\right)\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                          2. associate-*l/N/A

                            \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                          3. distribute-lft1-inN/A

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

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

                            \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                          6. mul0-rgtN/A

                            \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                          7. metadata-evalN/A

                            \[\leadsto \frac{\color{blue}{0}}{w} \]
                          8. div038.9

                            \[\leadsto \color{blue}{0} \]
                        5. Applied rewrites38.9%

                          \[\leadsto \color{blue}{0} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification55.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;\left(c0 \cdot \frac{c0 \cdot d}{D}\right) \cdot \frac{d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 3: 54.9% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)} \cdot \left(d \cdot \frac{c0}{D}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                      (FPCore (c0 w h D d M)
                       :precision binary64
                       (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                         (if (<=
                              (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                              INFINITY)
                           (* (/ (* c0 d) (* D (* w (* w h)))) (* d (/ c0 D)))
                           0.0)))
                      double code(double c0, double w, double h, double D, double d, double M) {
                      	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                      	double tmp;
                      	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                      		tmp = ((c0 * d) / (D * (w * (w * h)))) * (d * (c0 / D));
                      	} else {
                      		tmp = 0.0;
                      	}
                      	return tmp;
                      }
                      
                      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));
                      	double tmp;
                      	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                      		tmp = ((c0 * d) / (D * (w * (w * h)))) * (d * (c0 / D));
                      	} else {
                      		tmp = 0.0;
                      	}
                      	return tmp;
                      }
                      
                      def code(c0, w, h, D, d, M):
                      	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                      	tmp = 0
                      	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                      		tmp = ((c0 * d) / (D * (w * (w * h)))) * (d * (c0 / D))
                      	else:
                      		tmp = 0.0
                      	return tmp
                      
                      function code(c0, w, h, D, d, M)
                      	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                      	tmp = 0.0
                      	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                      		tmp = Float64(Float64(Float64(c0 * d) / Float64(D * Float64(w * Float64(w * h)))) * Float64(d * Float64(c0 / D)));
                      	else
                      		tmp = 0.0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(c0, w, h, D, d, M)
                      	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                      	tmp = 0.0;
                      	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                      		tmp = ((c0 * d) / (D * (w * (w * h)))) * (d * (c0 / D));
                      	else
                      		tmp = 0.0;
                      	end
                      	tmp_2 = tmp;
                      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]}, If[LessEqual[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], Infinity], N[(N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * N[(c0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                      
                      \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)}\\
                      \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                      \;\;\;\;\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)} \cdot \left(d \cdot \frac{c0}{D}\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;0\\
                      
                      
                      \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites84.8%

                            \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                          2. Step-by-step derivation
                            1. Applied rewrites84.9%

                              \[\leadsto \left(d \cdot \frac{c0}{D}\right) \cdot \frac{\color{blue}{c0 \cdot d}}{D \cdot \left(w \cdot \left(w \cdot h\right)\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                              2. associate-*l/N/A

                                \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                              3. distribute-lft1-inN/A

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

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

                                \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                              6. mul0-rgtN/A

                                \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                              7. metadata-evalN/A

                                \[\leadsto \frac{\color{blue}{0}}{w} \]
                              8. div038.9

                                \[\leadsto \color{blue}{0} \]
                            5. Applied rewrites38.9%

                              \[\leadsto \color{blue}{0} \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification55.8%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)} \cdot \left(d \cdot \frac{c0}{D}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 4: 55.7% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;c0 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                          (FPCore (c0 w h D d M)
                           :precision binary64
                           (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                             (if (<=
                                  (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                                  INFINITY)
                               (* c0 (* (/ d D) (/ (* c0 d) (* w (* D (* w h))))))
                               0.0)))
                          double code(double c0, double w, double h, double D, double d, double M) {
                          	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                          	double tmp;
                          	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                          		tmp = c0 * ((d / D) * ((c0 * d) / (w * (D * (w * h)))));
                          	} else {
                          		tmp = 0.0;
                          	}
                          	return tmp;
                          }
                          
                          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));
                          	double tmp;
                          	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                          		tmp = c0 * ((d / D) * ((c0 * d) / (w * (D * (w * h)))));
                          	} else {
                          		tmp = 0.0;
                          	}
                          	return tmp;
                          }
                          
                          def code(c0, w, h, D, d, M):
                          	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                          	tmp = 0
                          	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                          		tmp = c0 * ((d / D) * ((c0 * d) / (w * (D * (w * h)))))
                          	else:
                          		tmp = 0.0
                          	return tmp
                          
                          function code(c0, w, h, D, d, M)
                          	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                          	tmp = 0.0
                          	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                          		tmp = Float64(c0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(w * Float64(D * Float64(w * h))))));
                          	else
                          		tmp = 0.0;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(c0, w, h, D, d, M)
                          	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                          	tmp = 0.0;
                          	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                          		tmp = c0 * ((d / D) * ((c0 * d) / (w * (D * (w * h)))));
                          	else
                          		tmp = 0.0;
                          	end
                          	tmp_2 = tmp;
                          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]}, If[LessEqual[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], Infinity], N[(c0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(w * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                          
                          \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)}\\
                          \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                          \;\;\;\;c0 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0\\
                          
                          
                          \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                            6. Step-by-step derivation
                              1. Applied rewrites81.4%

                                \[\leadsto c0 \cdot \color{blue}{\left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)} \]
                              2. Step-by-step derivation
                                1. Applied rewrites84.3%

                                  \[\leadsto c0 \cdot \left(\frac{c0 \cdot d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)} \cdot \color{blue}{\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                  2. associate-*l/N/A

                                    \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                  3. distribute-lft1-inN/A

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

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

                                    \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                  6. mul0-rgtN/A

                                    \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                  7. metadata-evalN/A

                                    \[\leadsto \frac{\color{blue}{0}}{w} \]
                                  8. div038.9

                                    \[\leadsto \color{blue}{0} \]
                                5. Applied rewrites38.9%

                                  \[\leadsto \color{blue}{0} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification55.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;c0 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{w \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 5: 54.4% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\left(c0 \cdot d\right) \cdot \frac{c0 \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                              (FPCore (c0 w h D d M)
                               :precision binary64
                               (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                                 (if (<=
                                      (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                                      INFINITY)
                                   (* (* c0 d) (/ (* c0 d) (* D (* D (* w (* w h))))))
                                   0.0)))
                              double code(double c0, double w, double h, double D, double d, double M) {
                              	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                              	double tmp;
                              	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                              		tmp = (c0 * d) * ((c0 * d) / (D * (D * (w * (w * h)))));
                              	} else {
                              		tmp = 0.0;
                              	}
                              	return tmp;
                              }
                              
                              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));
                              	double tmp;
                              	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                              		tmp = (c0 * d) * ((c0 * d) / (D * (D * (w * (w * h)))));
                              	} else {
                              		tmp = 0.0;
                              	}
                              	return tmp;
                              }
                              
                              def code(c0, w, h, D, d, M):
                              	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                              	tmp = 0
                              	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                              		tmp = (c0 * d) * ((c0 * d) / (D * (D * (w * (w * h)))))
                              	else:
                              		tmp = 0.0
                              	return tmp
                              
                              function code(c0, w, h, D, d, M)
                              	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                              	tmp = 0.0
                              	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                              		tmp = Float64(Float64(c0 * d) * Float64(Float64(c0 * d) / Float64(D * Float64(D * Float64(w * Float64(w * h))))));
                              	else
                              		tmp = 0.0;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(c0, w, h, D, d, M)
                              	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                              	tmp = 0.0;
                              	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                              		tmp = (c0 * d) * ((c0 * d) / (D * (D * (w * (w * h)))));
                              	else
                              		tmp = 0.0;
                              	end
                              	tmp_2 = tmp;
                              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]}, If[LessEqual[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], Infinity], N[(N[(c0 * d), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                              
                              \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)}\\
                              \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                              \;\;\;\;\left(c0 \cdot d\right) \cdot \frac{c0 \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;0\\
                              
                              
                              \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites83.8%

                                    \[\leadsto \left(c0 \cdot d\right) \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                  4. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                    2. associate-*l/N/A

                                      \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                    3. distribute-lft1-inN/A

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

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

                                      \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                    6. mul0-rgtN/A

                                      \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                    7. metadata-evalN/A

                                      \[\leadsto \frac{\color{blue}{0}}{w} \]
                                    8. div038.9

                                      \[\leadsto \color{blue}{0} \]
                                  5. Applied rewrites38.9%

                                    \[\leadsto \color{blue}{0} \]
                                7. Recombined 2 regimes into one program.
                                8. Add Preprocessing

                                Alternative 6: 53.4% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(h \cdot \left(w \cdot \left(w \cdot D\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                                (FPCore (c0 w h D d M)
                                 :precision binary64
                                 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                                   (if (<=
                                        (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                                        INFINITY)
                                     (* c0 (* c0 (/ (* d d) (* D (* h (* w (* w D)))))))
                                     0.0)))
                                double code(double c0, double w, double h, double D, double d, double M) {
                                	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                	double tmp;
                                	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                                		tmp = c0 * (c0 * ((d * d) / (D * (h * (w * (w * D))))));
                                	} else {
                                		tmp = 0.0;
                                	}
                                	return tmp;
                                }
                                
                                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));
                                	double tmp;
                                	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                                		tmp = c0 * (c0 * ((d * d) / (D * (h * (w * (w * D))))));
                                	} else {
                                		tmp = 0.0;
                                	}
                                	return tmp;
                                }
                                
                                def code(c0, w, h, D, d, M):
                                	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                                	tmp = 0
                                	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                                		tmp = c0 * (c0 * ((d * d) / (D * (h * (w * (w * D))))))
                                	else:
                                		tmp = 0.0
                                	return tmp
                                
                                function code(c0, w, h, D, d, M)
                                	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                                	tmp = 0.0
                                	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                                		tmp = Float64(c0 * Float64(c0 * Float64(Float64(d * d) / Float64(D * Float64(h * Float64(w * Float64(w * D)))))));
                                	else
                                		tmp = 0.0;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(c0, w, h, D, d, M)
                                	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                	tmp = 0.0;
                                	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                                		tmp = c0 * (c0 * ((d * d) / (D * (h * (w * (w * D))))));
                                	else
                                		tmp = 0.0;
                                	end
                                	tmp_2 = tmp;
                                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]}, If[LessEqual[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], Infinity], N[(c0 * N[(c0 * N[(N[(d * d), $MachinePrecision] / N[(D * N[(h * N[(w * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                                
                                \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)}\\
                                \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                                \;\;\;\;c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(h \cdot \left(w \cdot \left(w \cdot D\right)\right)\right)}\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;0\\
                                
                                
                                \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                  4. Step-by-step derivation
                                    1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites81.4%

                                      \[\leadsto c0 \cdot \color{blue}{\left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites82.3%

                                        \[\leadsto c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(\left(\left(D \cdot w\right) \cdot w\right) \cdot \color{blue}{h}\right)}\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                      4. Step-by-step derivation
                                        1. *-commutativeN/A

                                          \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                        2. associate-*l/N/A

                                          \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                        3. distribute-lft1-inN/A

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

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

                                          \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                        6. mul0-rgtN/A

                                          \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                        7. metadata-evalN/A

                                          \[\leadsto \frac{\color{blue}{0}}{w} \]
                                        8. div038.9

                                          \[\leadsto \color{blue}{0} \]
                                      5. Applied rewrites38.9%

                                        \[\leadsto \color{blue}{0} \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification54.9%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(h \cdot \left(w \cdot \left(w \cdot D\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 7: 52.8% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                                    (FPCore (c0 w h D d M)
                                     :precision binary64
                                     (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                                       (if (<=
                                            (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                                            INFINITY)
                                         (* c0 (* c0 (/ (* d d) (* D (* D (* w (* w h)))))))
                                         0.0)))
                                    double code(double c0, double w, double h, double D, double d, double M) {
                                    	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                    	double tmp;
                                    	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                                    		tmp = c0 * (c0 * ((d * d) / (D * (D * (w * (w * h))))));
                                    	} else {
                                    		tmp = 0.0;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    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));
                                    	double tmp;
                                    	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                                    		tmp = c0 * (c0 * ((d * d) / (D * (D * (w * (w * h))))));
                                    	} else {
                                    		tmp = 0.0;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(c0, w, h, D, d, M):
                                    	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                                    	tmp = 0
                                    	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                                    		tmp = c0 * (c0 * ((d * d) / (D * (D * (w * (w * h))))))
                                    	else:
                                    		tmp = 0.0
                                    	return tmp
                                    
                                    function code(c0, w, h, D, d, M)
                                    	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                                    	tmp = 0.0
                                    	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                                    		tmp = Float64(c0 * Float64(c0 * Float64(Float64(d * d) / Float64(D * Float64(D * Float64(w * Float64(w * h)))))));
                                    	else
                                    		tmp = 0.0;
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(c0, w, h, D, d, M)
                                    	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                    	tmp = 0.0;
                                    	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                                    		tmp = c0 * (c0 * ((d * d) / (D * (D * (w * (w * h))))));
                                    	else
                                    		tmp = 0.0;
                                    	end
                                    	tmp_2 = tmp;
                                    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]}, If[LessEqual[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], Infinity], N[(c0 * N[(c0 * N[(N[(d * d), $MachinePrecision] / N[(D * N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                                    
                                    \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)}\\
                                    \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                                    \;\;\;\;c0 \cdot \left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;0\\
                                    
                                    
                                    \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                      4. Step-by-step derivation
                                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites81.4%

                                          \[\leadsto c0 \cdot \color{blue}{\left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                        4. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                          2. associate-*l/N/A

                                            \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                          3. distribute-lft1-inN/A

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

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

                                            \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                          6. mul0-rgtN/A

                                            \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                          7. metadata-evalN/A

                                            \[\leadsto \frac{\color{blue}{0}}{w} \]
                                          8. div038.9

                                            \[\leadsto \color{blue}{0} \]
                                        5. Applied rewrites38.9%

                                          \[\leadsto \color{blue}{0} \]
                                      7. Recombined 2 regimes into one program.
                                      8. Add Preprocessing

                                      Alternative 8: 54.6% accurate, 0.7× 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)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;c0 \cdot \left(c0 \cdot \left(d \cdot \frac{d}{w \cdot \left(D \cdot \left(D \cdot \left(w \cdot h\right)\right)\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                                      (FPCore (c0 w h D d M)
                                       :precision binary64
                                       (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
                                         (if (<=
                                              (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
                                              INFINITY)
                                           (* c0 (* c0 (* d (/ d (* w (* D (* D (* w h))))))))
                                           0.0)))
                                      double code(double c0, double w, double h, double D, double d, double M) {
                                      	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                      	double tmp;
                                      	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
                                      		tmp = c0 * (c0 * (d * (d / (w * (D * (D * (w * h)))))));
                                      	} else {
                                      		tmp = 0.0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      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));
                                      	double tmp;
                                      	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
                                      		tmp = c0 * (c0 * (d * (d / (w * (D * (D * (w * h)))))));
                                      	} else {
                                      		tmp = 0.0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(c0, w, h, D, d, M):
                                      	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
                                      	tmp = 0
                                      	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf:
                                      		tmp = c0 * (c0 * (d * (d / (w * (D * (D * (w * h)))))))
                                      	else:
                                      		tmp = 0.0
                                      	return tmp
                                      
                                      function code(c0, w, h, D, d, M)
                                      	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
                                      	tmp = 0.0
                                      	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf)
                                      		tmp = Float64(c0 * Float64(c0 * Float64(d * Float64(d / Float64(w * Float64(D * Float64(D * Float64(w * h))))))));
                                      	else
                                      		tmp = 0.0;
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(c0, w, h, D, d, M)
                                      	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
                                      	tmp = 0.0;
                                      	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf)
                                      		tmp = c0 * (c0 * (d * (d / (w * (D * (D * (w * h)))))));
                                      	else
                                      		tmp = 0.0;
                                      	end
                                      	tmp_2 = tmp;
                                      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]}, If[LessEqual[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], Infinity], N[(c0 * N[(c0 * N[(d * N[(d / N[(w * N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
                                      
                                      \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)}\\
                                      \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
                                      \;\;\;\;c0 \cdot \left(c0 \cdot \left(d \cdot \frac{d}{w \cdot \left(D \cdot \left(D \cdot \left(w \cdot h\right)\right)\right)}\right)\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;0\\
                                      
                                      
                                      \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 83.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                        4. Step-by-step derivation
                                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites81.4%

                                            \[\leadsto c0 \cdot \color{blue}{\left(c0 \cdot \frac{d \cdot d}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites81.2%

                                              \[\leadsto c0 \cdot \left(c0 \cdot \left(\frac{d}{\left(D \cdot \left(D \cdot \left(w \cdot h\right)\right)\right) \cdot w} \cdot \color{blue}{d}\right)\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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                            4. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                              2. associate-*l/N/A

                                                \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                              3. distribute-lft1-inN/A

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

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

                                                \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                              6. mul0-rgtN/A

                                                \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                              7. metadata-evalN/A

                                                \[\leadsto \frac{\color{blue}{0}}{w} \]
                                              8. div038.9

                                                \[\leadsto \color{blue}{0} \]
                                            5. Applied rewrites38.9%

                                              \[\leadsto \color{blue}{0} \]
                                          3. Recombined 2 regimes into one program.
                                          4. Final simplification54.5%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;c0 \cdot \left(c0 \cdot \left(d \cdot \frac{d}{w \cdot \left(D \cdot \left(D \cdot \left(w \cdot h\right)\right)\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                                          5. Add Preprocessing

                                          Alternative 9: 47.6% accurate, 1.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\ t_1 := \frac{c0 \cdot d}{D}\\ \mathbf{if}\;c0 \leq -7.5 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\ \;\;\;\;\frac{t\_1}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\ \;\;\;\;0\\ \mathbf{elif}\;c0 \leq 1.28 \cdot 10^{+98}:\\ \;\;\;\;t\_1 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                          (FPCore (c0 w h D d M)
                                           :precision binary64
                                           (let* ((t_0
                                                   (* (/ c0 (* 2.0 w)) (* (* d (/ (* c0 2.0) (* w (* h D)))) (/ d D))))
                                                  (t_1 (/ (* c0 d) D)))
                                             (if (<= c0 -7.5e+18)
                                               t_0
                                               (if (<= c0 3.4e-273)
                                                 (* (/ t_1 (* w D)) (/ (* c0 d) (* w h)))
                                                 (if (<= c0 4e-144)
                                                   0.0
                                                   (if (<= c0 1.28e+98)
                                                     (* t_1 (/ (* c0 d) (* D (* w (* w h)))))
                                                     t_0))))))
                                          double code(double c0, double w, double h, double D, double d, double M) {
                                          	double t_0 = (c0 / (2.0 * w)) * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
                                          	double t_1 = (c0 * d) / D;
                                          	double tmp;
                                          	if (c0 <= -7.5e+18) {
                                          		tmp = t_0;
                                          	} else if (c0 <= 3.4e-273) {
                                          		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
                                          	} else if (c0 <= 4e-144) {
                                          		tmp = 0.0;
                                          	} else if (c0 <= 1.28e+98) {
                                          		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          real(8) function code(c0, w, h, d, d_1, m)
                                              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
                                              real(8) :: t_1
                                              real(8) :: tmp
                                              t_0 = (c0 / (2.0d0 * w)) * ((d_1 * ((c0 * 2.0d0) / (w * (h * d)))) * (d_1 / d))
                                              t_1 = (c0 * d_1) / d
                                              if (c0 <= (-7.5d+18)) then
                                                  tmp = t_0
                                              else if (c0 <= 3.4d-273) then
                                                  tmp = (t_1 / (w * d)) * ((c0 * d_1) / (w * h))
                                              else if (c0 <= 4d-144) then
                                                  tmp = 0.0d0
                                              else if (c0 <= 1.28d+98) then
                                                  tmp = t_1 * ((c0 * d_1) / (d * (w * (w * h))))
                                              else
                                                  tmp = t_0
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double c0, double w, double h, double D, double d, double M) {
                                          	double t_0 = (c0 / (2.0 * w)) * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
                                          	double t_1 = (c0 * d) / D;
                                          	double tmp;
                                          	if (c0 <= -7.5e+18) {
                                          		tmp = t_0;
                                          	} else if (c0 <= 3.4e-273) {
                                          		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
                                          	} else if (c0 <= 4e-144) {
                                          		tmp = 0.0;
                                          	} else if (c0 <= 1.28e+98) {
                                          		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(c0, w, h, D, d, M):
                                          	t_0 = (c0 / (2.0 * w)) * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D))
                                          	t_1 = (c0 * d) / D
                                          	tmp = 0
                                          	if c0 <= -7.5e+18:
                                          		tmp = t_0
                                          	elif c0 <= 3.4e-273:
                                          		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h))
                                          	elif c0 <= 4e-144:
                                          		tmp = 0.0
                                          	elif c0 <= 1.28e+98:
                                          		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))))
                                          	else:
                                          		tmp = t_0
                                          	return tmp
                                          
                                          function code(c0, w, h, D, d, M)
                                          	t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(d * Float64(Float64(c0 * 2.0) / Float64(w * Float64(h * D)))) * Float64(d / D)))
                                          	t_1 = Float64(Float64(c0 * d) / D)
                                          	tmp = 0.0
                                          	if (c0 <= -7.5e+18)
                                          		tmp = t_0;
                                          	elseif (c0 <= 3.4e-273)
                                          		tmp = Float64(Float64(t_1 / Float64(w * D)) * Float64(Float64(c0 * d) / Float64(w * h)));
                                          	elseif (c0 <= 4e-144)
                                          		tmp = 0.0;
                                          	elseif (c0 <= 1.28e+98)
                                          		tmp = Float64(t_1 * Float64(Float64(c0 * d) / Float64(D * Float64(w * Float64(w * h)))));
                                          	else
                                          		tmp = t_0;
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(c0, w, h, D, d, M)
                                          	t_0 = (c0 / (2.0 * w)) * ((d * ((c0 * 2.0) / (w * (h * D)))) * (d / D));
                                          	t_1 = (c0 * d) / D;
                                          	tmp = 0.0;
                                          	if (c0 <= -7.5e+18)
                                          		tmp = t_0;
                                          	elseif (c0 <= 3.4e-273)
                                          		tmp = (t_1 / (w * D)) * ((c0 * d) / (w * h));
                                          	elseif (c0 <= 4e-144)
                                          		tmp = 0.0;
                                          	elseif (c0 <= 1.28e+98)
                                          		tmp = t_1 * ((c0 * d) / (D * (w * (w * h))));
                                          	else
                                          		tmp = t_0;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(d * N[(N[(c0 * 2.0), $MachinePrecision] / N[(w * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]}, If[LessEqual[c0, -7.5e+18], t$95$0, If[LessEqual[c0, 3.4e-273], N[(N[(t$95$1 / N[(w * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 4e-144], 0.0, If[LessEqual[c0, 1.28e+98], N[(t$95$1 * N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\
                                          t_1 := \frac{c0 \cdot d}{D}\\
                                          \mathbf{if}\;c0 \leq -7.5 \cdot 10^{+18}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\
                                          \;\;\;\;\frac{t\_1}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\
                                          
                                          \mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\
                                          \;\;\;\;0\\
                                          
                                          \mathbf{elif}\;c0 \leq 1.28 \cdot 10^{+98}:\\
                                          \;\;\;\;t\_1 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 4 regimes
                                          2. if c0 < -7.5e18 or 1.28000000000000006e98 < c0

                                            1. Initial program 30.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 \color{blue}{\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}} \]
                                              2. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites57.8%

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

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

                                                if -7.5e18 < c0 < 3.39999999999999991e-273

                                                1. Initial program 34.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites52.1%

                                                    \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites58.3%

                                                      \[\leadsto \frac{\frac{c0 \cdot d}{D}}{D \cdot w} \cdot \color{blue}{\frac{c0 \cdot d}{w \cdot h}} \]

                                                    if 3.39999999999999991e-273 < c0 < 3.9999999999999998e-144

                                                    1. Initial program 23.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 \color{blue}{\frac{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                                      2. associate-*l/N/A

                                                        \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                                      3. distribute-lft1-inN/A

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

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

                                                        \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                                      6. mul0-rgtN/A

                                                        \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                                      7. metadata-evalN/A

                                                        \[\leadsto \frac{\color{blue}{0}}{w} \]
                                                      8. div071.6

                                                        \[\leadsto \color{blue}{0} \]
                                                    5. Applied rewrites71.6%

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

                                                    if 3.9999999999999998e-144 < c0 < 1.28000000000000006e98

                                                    1. Initial program 30.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. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites59.3%

                                                        \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                    7. Recombined 4 regimes into one program.
                                                    8. Final simplification63.4%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -7.5 \cdot 10^{+18}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\ \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{-273}:\\ \;\;\;\;\frac{\frac{c0 \cdot d}{D}}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;c0 \leq 4 \cdot 10^{-144}:\\ \;\;\;\;0\\ \mathbf{elif}\;c0 \leq 1.28 \cdot 10^{+98}:\\ \;\;\;\;\frac{c0 \cdot d}{D} \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \frac{c0 \cdot 2}{w \cdot \left(h \cdot D\right)}\right) \cdot \frac{d}{D}\right)\\ \end{array} \]
                                                    9. Add Preprocessing

                                                    Alternative 10: 40.8% accurate, 1.8× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot d}{D}\\ t_1 := t\_0 \cdot \frac{\frac{t\_0}{w \cdot h}}{w}\\ \mathbf{if}\;M \leq 1.12 \cdot 10^{-272}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 6.5 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;M \leq 1.45 \cdot 10^{-110}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{\left(d \cdot \left(c0 \cdot \frac{d}{w \cdot \left(w \cdot h\right)}\right)\right) \cdot \frac{c0}{D}}{D}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                    (FPCore (c0 w h D d M)
                                                     :precision binary64
                                                     (let* ((t_0 (/ (* c0 d) D)) (t_1 (* t_0 (/ (/ t_0 (* w h)) w))))
                                                       (if (<= M 1.12e-272)
                                                         0.0
                                                         (if (<= M 6.5e-196)
                                                           t_1
                                                           (if (<= M 1.45e-110)
                                                             0.0
                                                             (if (<= M 1.8e+46)
                                                               (/ (* (* d (* c0 (/ d (* w (* w h))))) (/ c0 D)) D)
                                                               t_1))))))
                                                    double code(double c0, double w, double h, double D, double d, double M) {
                                                    	double t_0 = (c0 * d) / D;
                                                    	double t_1 = t_0 * ((t_0 / (w * h)) / w);
                                                    	double tmp;
                                                    	if (M <= 1.12e-272) {
                                                    		tmp = 0.0;
                                                    	} else if (M <= 6.5e-196) {
                                                    		tmp = t_1;
                                                    	} else if (M <= 1.45e-110) {
                                                    		tmp = 0.0;
                                                    	} else if (M <= 1.8e+46) {
                                                    		tmp = ((d * (c0 * (d / (w * (w * h))))) * (c0 / D)) / D;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    real(8) function code(c0, w, h, d, d_1, m)
                                                        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
                                                        real(8) :: t_1
                                                        real(8) :: tmp
                                                        t_0 = (c0 * d_1) / d
                                                        t_1 = t_0 * ((t_0 / (w * h)) / w)
                                                        if (m <= 1.12d-272) then
                                                            tmp = 0.0d0
                                                        else if (m <= 6.5d-196) then
                                                            tmp = t_1
                                                        else if (m <= 1.45d-110) then
                                                            tmp = 0.0d0
                                                        else if (m <= 1.8d+46) then
                                                            tmp = ((d_1 * (c0 * (d_1 / (w * (w * h))))) * (c0 / d)) / d
                                                        else
                                                            tmp = t_1
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double c0, double w, double h, double D, double d, double M) {
                                                    	double t_0 = (c0 * d) / D;
                                                    	double t_1 = t_0 * ((t_0 / (w * h)) / w);
                                                    	double tmp;
                                                    	if (M <= 1.12e-272) {
                                                    		tmp = 0.0;
                                                    	} else if (M <= 6.5e-196) {
                                                    		tmp = t_1;
                                                    	} else if (M <= 1.45e-110) {
                                                    		tmp = 0.0;
                                                    	} else if (M <= 1.8e+46) {
                                                    		tmp = ((d * (c0 * (d / (w * (w * h))))) * (c0 / D)) / D;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(c0, w, h, D, d, M):
                                                    	t_0 = (c0 * d) / D
                                                    	t_1 = t_0 * ((t_0 / (w * h)) / w)
                                                    	tmp = 0
                                                    	if M <= 1.12e-272:
                                                    		tmp = 0.0
                                                    	elif M <= 6.5e-196:
                                                    		tmp = t_1
                                                    	elif M <= 1.45e-110:
                                                    		tmp = 0.0
                                                    	elif M <= 1.8e+46:
                                                    		tmp = ((d * (c0 * (d / (w * (w * h))))) * (c0 / D)) / D
                                                    	else:
                                                    		tmp = t_1
                                                    	return tmp
                                                    
                                                    function code(c0, w, h, D, d, M)
                                                    	t_0 = Float64(Float64(c0 * d) / D)
                                                    	t_1 = Float64(t_0 * Float64(Float64(t_0 / Float64(w * h)) / w))
                                                    	tmp = 0.0
                                                    	if (M <= 1.12e-272)
                                                    		tmp = 0.0;
                                                    	elseif (M <= 6.5e-196)
                                                    		tmp = t_1;
                                                    	elseif (M <= 1.45e-110)
                                                    		tmp = 0.0;
                                                    	elseif (M <= 1.8e+46)
                                                    		tmp = Float64(Float64(Float64(d * Float64(c0 * Float64(d / Float64(w * Float64(w * h))))) * Float64(c0 / D)) / D);
                                                    	else
                                                    		tmp = t_1;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(c0, w, h, D, d, M)
                                                    	t_0 = (c0 * d) / D;
                                                    	t_1 = t_0 * ((t_0 / (w * h)) / w);
                                                    	tmp = 0.0;
                                                    	if (M <= 1.12e-272)
                                                    		tmp = 0.0;
                                                    	elseif (M <= 6.5e-196)
                                                    		tmp = t_1;
                                                    	elseif (M <= 1.45e-110)
                                                    		tmp = 0.0;
                                                    	elseif (M <= 1.8e+46)
                                                    		tmp = ((d * (c0 * (d / (w * (w * h))))) * (c0 / D)) / D;
                                                    	else
                                                    		tmp = t_1;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(t$95$0 / N[(w * h), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 1.12e-272], 0.0, If[LessEqual[M, 6.5e-196], t$95$1, If[LessEqual[M, 1.45e-110], 0.0, If[LessEqual[M, 1.8e+46], N[(N[(N[(d * N[(c0 * N[(d / N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision], t$95$1]]]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \frac{c0 \cdot d}{D}\\
                                                    t_1 := t\_0 \cdot \frac{\frac{t\_0}{w \cdot h}}{w}\\
                                                    \mathbf{if}\;M \leq 1.12 \cdot 10^{-272}:\\
                                                    \;\;\;\;0\\
                                                    
                                                    \mathbf{elif}\;M \leq 6.5 \cdot 10^{-196}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    \mathbf{elif}\;M \leq 1.45 \cdot 10^{-110}:\\
                                                    \;\;\;\;0\\
                                                    
                                                    \mathbf{elif}\;M \leq 1.8 \cdot 10^{+46}:\\
                                                    \;\;\;\;\frac{\left(d \cdot \left(c0 \cdot \frac{d}{w \cdot \left(w \cdot h\right)}\right)\right) \cdot \frac{c0}{D}}{D}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if M < 1.11999999999999994e-272 or 6.5000000000000004e-196 < M < 1.4500000000000001e-110

                                                      1. Initial program 27.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{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                                      4. Step-by-step derivation
                                                        1. *-commutativeN/A

                                                          \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                                        2. associate-*l/N/A

                                                          \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                                        3. distribute-lft1-inN/A

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

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

                                                          \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                                        6. mul0-rgtN/A

                                                          \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                                        7. metadata-evalN/A

                                                          \[\leadsto \frac{\color{blue}{0}}{w} \]
                                                        8. div037.6

                                                          \[\leadsto \color{blue}{0} \]
                                                      5. Applied rewrites37.6%

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

                                                      if 1.11999999999999994e-272 < M < 6.5000000000000004e-196 or 1.7999999999999999e46 < M

                                                      1. Initial program 30.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. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites61.8%

                                                          \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites69.0%

                                                            \[\leadsto \frac{c0 \cdot d}{D} \cdot \frac{\frac{\frac{c0 \cdot d}{D}}{w \cdot h}}{\color{blue}{w}} \]

                                                          if 1.4500000000000001e-110 < M < 1.7999999999999999e46

                                                          1. Initial program 47.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites60.0%

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

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

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.12 \cdot 10^{-272}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 6.5 \cdot 10^{-196}:\\ \;\;\;\;\frac{c0 \cdot d}{D} \cdot \frac{\frac{\frac{c0 \cdot d}{D}}{w \cdot h}}{w}\\ \mathbf{elif}\;M \leq 1.45 \cdot 10^{-110}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{\left(d \cdot \left(c0 \cdot \frac{d}{w \cdot \left(w \cdot h\right)}\right)\right) \cdot \frac{c0}{D}}{D}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot d}{D} \cdot \frac{\frac{\frac{c0 \cdot d}{D}}{w \cdot h}}{w}\\ \end{array} \]
                                                            5. Add Preprocessing

                                                            Alternative 11: 40.1% accurate, 2.2× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot d}{D}\\ \mathbf{if}\;M \leq 3.3 \cdot 10^{-270}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 3.2 \cdot 10^{-225}:\\ \;\;\;\;\frac{t\_0}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;M \leq 1.9 \cdot 10^{-108}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \end{array} \end{array} \]
                                                            (FPCore (c0 w h D d M)
                                                             :precision binary64
                                                             (let* ((t_0 (/ (* c0 d) D)))
                                                               (if (<= M 3.3e-270)
                                                                 0.0
                                                                 (if (<= M 3.2e-225)
                                                                   (* (/ t_0 (* w D)) (/ (* c0 d) (* w h)))
                                                                   (if (<= M 1.9e-108) 0.0 (* t_0 (/ (* c0 d) (* D (* w (* w h))))))))))
                                                            double code(double c0, double w, double h, double D, double d, double M) {
                                                            	double t_0 = (c0 * d) / D;
                                                            	double tmp;
                                                            	if (M <= 3.3e-270) {
                                                            		tmp = 0.0;
                                                            	} else if (M <= 3.2e-225) {
                                                            		tmp = (t_0 / (w * D)) * ((c0 * d) / (w * h));
                                                            	} else if (M <= 1.9e-108) {
                                                            		tmp = 0.0;
                                                            	} else {
                                                            		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            real(8) function code(c0, w, h, d, d_1, m)
                                                                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
                                                                real(8) :: tmp
                                                                t_0 = (c0 * d_1) / d
                                                                if (m <= 3.3d-270) then
                                                                    tmp = 0.0d0
                                                                else if (m <= 3.2d-225) then
                                                                    tmp = (t_0 / (w * d)) * ((c0 * d_1) / (w * h))
                                                                else if (m <= 1.9d-108) then
                                                                    tmp = 0.0d0
                                                                else
                                                                    tmp = t_0 * ((c0 * d_1) / (d * (w * (w * h))))
                                                                end if
                                                                code = tmp
                                                            end function
                                                            
                                                            public static double code(double c0, double w, double h, double D, double d, double M) {
                                                            	double t_0 = (c0 * d) / D;
                                                            	double tmp;
                                                            	if (M <= 3.3e-270) {
                                                            		tmp = 0.0;
                                                            	} else if (M <= 3.2e-225) {
                                                            		tmp = (t_0 / (w * D)) * ((c0 * d) / (w * h));
                                                            	} else if (M <= 1.9e-108) {
                                                            		tmp = 0.0;
                                                            	} else {
                                                            		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(c0, w, h, D, d, M):
                                                            	t_0 = (c0 * d) / D
                                                            	tmp = 0
                                                            	if M <= 3.3e-270:
                                                            		tmp = 0.0
                                                            	elif M <= 3.2e-225:
                                                            		tmp = (t_0 / (w * D)) * ((c0 * d) / (w * h))
                                                            	elif M <= 1.9e-108:
                                                            		tmp = 0.0
                                                            	else:
                                                            		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))))
                                                            	return tmp
                                                            
                                                            function code(c0, w, h, D, d, M)
                                                            	t_0 = Float64(Float64(c0 * d) / D)
                                                            	tmp = 0.0
                                                            	if (M <= 3.3e-270)
                                                            		tmp = 0.0;
                                                            	elseif (M <= 3.2e-225)
                                                            		tmp = Float64(Float64(t_0 / Float64(w * D)) * Float64(Float64(c0 * d) / Float64(w * h)));
                                                            	elseif (M <= 1.9e-108)
                                                            		tmp = 0.0;
                                                            	else
                                                            		tmp = Float64(t_0 * Float64(Float64(c0 * d) / Float64(D * Float64(w * Float64(w * h)))));
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(c0, w, h, D, d, M)
                                                            	t_0 = (c0 * d) / D;
                                                            	tmp = 0.0;
                                                            	if (M <= 3.3e-270)
                                                            		tmp = 0.0;
                                                            	elseif (M <= 3.2e-225)
                                                            		tmp = (t_0 / (w * D)) * ((c0 * d) / (w * h));
                                                            	elseif (M <= 1.9e-108)
                                                            		tmp = 0.0;
                                                            	else
                                                            		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]}, If[LessEqual[M, 3.3e-270], 0.0, If[LessEqual[M, 3.2e-225], N[(N[(t$95$0 / N[(w * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.9e-108], 0.0, N[(t$95$0 * N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            t_0 := \frac{c0 \cdot d}{D}\\
                                                            \mathbf{if}\;M \leq 3.3 \cdot 10^{-270}:\\
                                                            \;\;\;\;0\\
                                                            
                                                            \mathbf{elif}\;M \leq 3.2 \cdot 10^{-225}:\\
                                                            \;\;\;\;\frac{t\_0}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\
                                                            
                                                            \mathbf{elif}\;M \leq 1.9 \cdot 10^{-108}:\\
                                                            \;\;\;\;0\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;t\_0 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 3 regimes
                                                            2. if M < 3.30000000000000018e-270 or 3.19999999999999975e-225 < M < 1.89999999999999987e-108

                                                              1. Initial program 27.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{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                                              4. Step-by-step derivation
                                                                1. *-commutativeN/A

                                                                  \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                                                2. associate-*l/N/A

                                                                  \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                                                3. distribute-lft1-inN/A

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

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

                                                                  \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                                                6. mul0-rgtN/A

                                                                  \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                                                7. metadata-evalN/A

                                                                  \[\leadsto \frac{\color{blue}{0}}{w} \]
                                                                8. div037.6

                                                                  \[\leadsto \color{blue}{0} \]
                                                              5. Applied rewrites37.6%

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

                                                              if 3.30000000000000018e-270 < M < 3.19999999999999975e-225

                                                              1. Initial program 44.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                              4. Step-by-step derivation
                                                                1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites67.1%

                                                                  \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites66.9%

                                                                    \[\leadsto \frac{\frac{c0 \cdot d}{D}}{D \cdot w} \cdot \color{blue}{\frac{c0 \cdot d}{w \cdot h}} \]

                                                                  if 1.89999999999999987e-108 < M

                                                                  1. Initial program 35.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                                  6. Step-by-step derivation
                                                                    1. Applied rewrites60.5%

                                                                      \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                                  7. Recombined 3 regimes into one program.
                                                                  8. Final simplification46.1%

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.3 \cdot 10^{-270}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 3.2 \cdot 10^{-225}:\\ \;\;\;\;\frac{\frac{c0 \cdot d}{D}}{w \cdot D} \cdot \frac{c0 \cdot d}{w \cdot h}\\ \mathbf{elif}\;M \leq 1.9 \cdot 10^{-108}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot d}{D} \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \end{array} \]
                                                                  9. Add Preprocessing

                                                                  Alternative 12: 40.1% accurate, 2.2× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot d}{D}\\ \mathbf{if}\;M \leq 3.3 \cdot 10^{-270}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 3.2 \cdot 10^{-225}:\\ \;\;\;\;t\_0 \cdot \frac{c0 \cdot \frac{d}{w}}{D \cdot \left(w \cdot h\right)}\\ \mathbf{elif}\;M \leq 1.9 \cdot 10^{-108}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\ \end{array} \end{array} \]
                                                                  (FPCore (c0 w h D d M)
                                                                   :precision binary64
                                                                   (let* ((t_0 (/ (* c0 d) D)))
                                                                     (if (<= M 3.3e-270)
                                                                       0.0
                                                                       (if (<= M 3.2e-225)
                                                                         (* t_0 (/ (* c0 (/ d w)) (* D (* w h))))
                                                                         (if (<= M 1.9e-108) 0.0 (* t_0 (/ (* c0 d) (* D (* w (* w h))))))))))
                                                                  double code(double c0, double w, double h, double D, double d, double M) {
                                                                  	double t_0 = (c0 * d) / D;
                                                                  	double tmp;
                                                                  	if (M <= 3.3e-270) {
                                                                  		tmp = 0.0;
                                                                  	} else if (M <= 3.2e-225) {
                                                                  		tmp = t_0 * ((c0 * (d / w)) / (D * (w * h)));
                                                                  	} else if (M <= 1.9e-108) {
                                                                  		tmp = 0.0;
                                                                  	} else {
                                                                  		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  real(8) function code(c0, w, h, d, d_1, m)
                                                                      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
                                                                      real(8) :: tmp
                                                                      t_0 = (c0 * d_1) / d
                                                                      if (m <= 3.3d-270) then
                                                                          tmp = 0.0d0
                                                                      else if (m <= 3.2d-225) then
                                                                          tmp = t_0 * ((c0 * (d_1 / w)) / (d * (w * h)))
                                                                      else if (m <= 1.9d-108) then
                                                                          tmp = 0.0d0
                                                                      else
                                                                          tmp = t_0 * ((c0 * d_1) / (d * (w * (w * h))))
                                                                      end if
                                                                      code = tmp
                                                                  end function
                                                                  
                                                                  public static double code(double c0, double w, double h, double D, double d, double M) {
                                                                  	double t_0 = (c0 * d) / D;
                                                                  	double tmp;
                                                                  	if (M <= 3.3e-270) {
                                                                  		tmp = 0.0;
                                                                  	} else if (M <= 3.2e-225) {
                                                                  		tmp = t_0 * ((c0 * (d / w)) / (D * (w * h)));
                                                                  	} else if (M <= 1.9e-108) {
                                                                  		tmp = 0.0;
                                                                  	} else {
                                                                  		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(c0, w, h, D, d, M):
                                                                  	t_0 = (c0 * d) / D
                                                                  	tmp = 0
                                                                  	if M <= 3.3e-270:
                                                                  		tmp = 0.0
                                                                  	elif M <= 3.2e-225:
                                                                  		tmp = t_0 * ((c0 * (d / w)) / (D * (w * h)))
                                                                  	elif M <= 1.9e-108:
                                                                  		tmp = 0.0
                                                                  	else:
                                                                  		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))))
                                                                  	return tmp
                                                                  
                                                                  function code(c0, w, h, D, d, M)
                                                                  	t_0 = Float64(Float64(c0 * d) / D)
                                                                  	tmp = 0.0
                                                                  	if (M <= 3.3e-270)
                                                                  		tmp = 0.0;
                                                                  	elseif (M <= 3.2e-225)
                                                                  		tmp = Float64(t_0 * Float64(Float64(c0 * Float64(d / w)) / Float64(D * Float64(w * h))));
                                                                  	elseif (M <= 1.9e-108)
                                                                  		tmp = 0.0;
                                                                  	else
                                                                  		tmp = Float64(t_0 * Float64(Float64(c0 * d) / Float64(D * Float64(w * Float64(w * h)))));
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(c0, w, h, D, d, M)
                                                                  	t_0 = (c0 * d) / D;
                                                                  	tmp = 0.0;
                                                                  	if (M <= 3.3e-270)
                                                                  		tmp = 0.0;
                                                                  	elseif (M <= 3.2e-225)
                                                                  		tmp = t_0 * ((c0 * (d / w)) / (D * (w * h)));
                                                                  	elseif (M <= 1.9e-108)
                                                                  		tmp = 0.0;
                                                                  	else
                                                                  		tmp = t_0 * ((c0 * d) / (D * (w * (w * h))));
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision]}, If[LessEqual[M, 3.3e-270], 0.0, If[LessEqual[M, 3.2e-225], N[(t$95$0 * N[(N[(c0 * N[(d / w), $MachinePrecision]), $MachinePrecision] / N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.9e-108], 0.0, N[(t$95$0 * N[(N[(c0 * d), $MachinePrecision] / N[(D * N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  t_0 := \frac{c0 \cdot d}{D}\\
                                                                  \mathbf{if}\;M \leq 3.3 \cdot 10^{-270}:\\
                                                                  \;\;\;\;0\\
                                                                  
                                                                  \mathbf{elif}\;M \leq 3.2 \cdot 10^{-225}:\\
                                                                  \;\;\;\;t\_0 \cdot \frac{c0 \cdot \frac{d}{w}}{D \cdot \left(w \cdot h\right)}\\
                                                                  
                                                                  \mathbf{elif}\;M \leq 1.9 \cdot 10^{-108}:\\
                                                                  \;\;\;\;0\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;t\_0 \cdot \frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if M < 3.30000000000000018e-270 or 3.19999999999999975e-225 < M < 1.89999999999999987e-108

                                                                    1. Initial program 27.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{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                                                    4. Step-by-step derivation
                                                                      1. *-commutativeN/A

                                                                        \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                                                      2. associate-*l/N/A

                                                                        \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                                                      3. distribute-lft1-inN/A

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

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

                                                                        \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                                                      6. mul0-rgtN/A

                                                                        \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                                                      7. metadata-evalN/A

                                                                        \[\leadsto \frac{\color{blue}{0}}{w} \]
                                                                      8. div037.6

                                                                        \[\leadsto \color{blue}{0} \]
                                                                    5. Applied rewrites37.6%

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

                                                                    if 3.30000000000000018e-270 < M < 3.19999999999999975e-225

                                                                    1. Initial program 44.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites67.1%

                                                                        \[\leadsto \frac{c0 \cdot d}{D} \cdot \color{blue}{\frac{c0 \cdot d}{D \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites66.9%

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

                                                                        if 1.89999999999999987e-108 < M

                                                                        1. Initial program 35.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 \color{blue}{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \color{blue}{\frac{\left(c0 \cdot c0\right) \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}} \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites60.5%

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

                                                                        Alternative 13: 33.7% accurate, 156.0× speedup?

                                                                        \[\begin{array}{l} \\ 0 \end{array} \]
                                                                        (FPCore (c0 w h D d M) :precision binary64 0.0)
                                                                        double code(double c0, double w, double h, double D, double d, double M) {
                                                                        	return 0.0;
                                                                        }
                                                                        
                                                                        real(8) function code(c0, w, h, d, d_1, m)
                                                                            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
                                                                            code = 0.0d0
                                                                        end function
                                                                        
                                                                        public static double code(double c0, double w, double h, double D, double d, double M) {
                                                                        	return 0.0;
                                                                        }
                                                                        
                                                                        def code(c0, w, h, D, d, M):
                                                                        	return 0.0
                                                                        
                                                                        function code(c0, w, h, D, d, M)
                                                                        	return 0.0
                                                                        end
                                                                        
                                                                        function tmp = code(c0, w, h, D, d, M)
                                                                        	tmp = 0.0;
                                                                        end
                                                                        
                                                                        code[c0_, w_, h_, D_, d_, M_] := 0.0
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        0
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Initial program 30.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{-1}{2} \cdot \frac{{c0}^{2} \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)}{w}} \]
                                                                        4. Step-by-step derivation
                                                                          1. *-commutativeN/A

                                                                            \[\leadsto \color{blue}{\frac{{c0}^{2} \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)}{w} \cdot \frac{-1}{2}} \]
                                                                          2. associate-*l/N/A

                                                                            \[\leadsto \color{blue}{\frac{\left({c0}^{2} \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) \cdot \frac{-1}{2}}{w}} \]
                                                                          3. distribute-lft1-inN/A

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

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

                                                                            \[\leadsto \frac{\left({c0}^{2} \cdot \color{blue}{0}\right) \cdot \frac{-1}{2}}{w} \]
                                                                          6. mul0-rgtN/A

                                                                            \[\leadsto \frac{\color{blue}{0} \cdot \frac{-1}{2}}{w} \]
                                                                          7. metadata-evalN/A

                                                                            \[\leadsto \frac{\color{blue}{0}}{w} \]
                                                                          8. div030.4

                                                                            \[\leadsto \color{blue}{0} \]
                                                                        5. Applied rewrites30.4%

                                                                          \[\leadsto \color{blue}{0} \]
                                                                        6. Add Preprocessing

                                                                        Reproduce

                                                                        ?
                                                                        herbie shell --seed 2024231 
                                                                        (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))))))