Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.8% → 45.2%
Time: 17.5s
Alternatives: 12
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 12 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.8% 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: 45.2% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;w \leq 2 \cdot 10^{+189}:\\
\;\;\;\;\left(\left(\left(--0.5\right) \cdot \left(\left(\frac{h}{t\_0 \cdot d} \cdot \left(D \cdot w\right)\right) \cdot \left(\left(M \cdot D\right) \cdot M\right)\right)\right) \cdot c0\right) \cdot \frac{c0}{2 \cdot w}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if w < 3.90000000000000011e92

    1. Initial program 27.7%

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 3.90000000000000011e92 < w < 2e189

        1. Initial program 11.1%

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

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

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

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

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

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

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

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

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

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

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

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

            if 2e189 < w

            1. Initial program 14.3%

              \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 3.9 \cdot 10^{+92}:\\ \;\;\;\;\frac{\left(\frac{\frac{\frac{2 \cdot \left(d \cdot c0\right)}{w}}{D \cdot h}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\ \mathbf{elif}\;w \leq 2 \cdot 10^{+189}:\\ \;\;\;\;\left(\left(\left(--0.5\right) \cdot \left(\left(\frac{h}{\left(\left(d \cdot c0\right) \cdot c0\right) \cdot d} \cdot \left(D \cdot w\right)\right) \cdot \left(\left(M \cdot D\right) \cdot M\right)\right)\right) \cdot c0\right) \cdot \frac{c0}{2 \cdot w}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w} \cdot d\\ \end{array} \]
              5. Add Preprocessing

              Alternative 2: 55.7% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\ \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{d \cdot c0}{w} \cdot \frac{d \cdot c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
              (FPCore (c0 w h D d M)
               :precision binary64
               (let* ((t_0 (/ (* (* d d) c0) (* (* D D) (* h w)))))
                 (if (<=
                      (* (+ (sqrt (- (* t_0 t_0) (* M M))) t_0) (/ c0 (* 2.0 w)))
                      INFINITY)
                   (* (/ (* d c0) w) (/ (* d c0) (* (* (* D D) h) w)))
                   0.0)))
              double code(double c0, double w, double h, double D, double d, double M) {
              	double t_0 = ((d * d) * c0) / ((D * D) * (h * w));
              	double tmp;
              	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= ((double) INFINITY)) {
              		tmp = ((d * c0) / w) * ((d * c0) / (((D * D) * h) * w));
              	} 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 = ((d * d) * c0) / ((D * D) * (h * w));
              	double tmp;
              	if (((Math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Double.POSITIVE_INFINITY) {
              		tmp = ((d * c0) / w) * ((d * c0) / (((D * D) * h) * w));
              	} else {
              		tmp = 0.0;
              	}
              	return tmp;
              }
              
              def code(c0, w, h, D, d, M):
              	t_0 = ((d * d) * c0) / ((D * D) * (h * w))
              	tmp = 0
              	if ((math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= math.inf:
              		tmp = ((d * c0) / w) * ((d * c0) / (((D * D) * h) * w))
              	else:
              		tmp = 0.0
              	return tmp
              
              function code(c0, w, h, D, d, M)
              	t_0 = Float64(Float64(Float64(d * d) * c0) / Float64(Float64(D * D) * Float64(h * w)))
              	tmp = 0.0
              	if (Float64(Float64(sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))) + t_0) * Float64(c0 / Float64(2.0 * w))) <= Inf)
              		tmp = Float64(Float64(Float64(d * c0) / w) * Float64(Float64(d * c0) / Float64(Float64(Float64(D * D) * h) * w)));
              	else
              		tmp = 0.0;
              	end
              	return tmp
              end
              
              function tmp_2 = code(c0, w, h, D, d, M)
              	t_0 = ((d * d) * c0) / ((D * D) * (h * w));
              	tmp = 0.0;
              	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Inf)
              		tmp = ((d * c0) / w) * ((d * c0) / (((D * D) * h) * w));
              	else
              		tmp = 0.0;
              	end
              	tmp_2 = tmp;
              end
              
              code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(d * d), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(d * c0), $MachinePrecision] / w), $MachinePrecision] * N[(N[(d * c0), $MachinePrecision] / N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\
              \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\
              \;\;\;\;\frac{d \cdot c0}{w} \cdot \frac{d \cdot c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w}\\
              
              \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 73.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  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. associate-/l*N/A

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

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

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

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

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

                      \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                    7. metadata-eval36.9

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

                    \[\leadsto \color{blue}{0} \]
                7. Recombined 2 regimes into one program.
                8. Final simplification52.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M} + \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{d \cdot c0}{w} \cdot \frac{d \cdot c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                9. Add Preprocessing

                Alternative 3: 55.1% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\ \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\left(\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)\right) \cdot \frac{c0}{w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                (FPCore (c0 w h D d M)
                 :precision binary64
                 (let* ((t_0 (/ (* (* d d) c0) (* (* D D) (* h w)))))
                   (if (<=
                        (* (+ (sqrt (- (* t_0 t_0) (* M M))) t_0) (/ c0 (* 2.0 w)))
                        INFINITY)
                     (* (* (/ d (* (* (* D D) h) w)) (* d c0)) (/ c0 w))
                     0.0)))
                double code(double c0, double w, double h, double D, double d, double M) {
                	double t_0 = ((d * d) * c0) / ((D * D) * (h * w));
                	double tmp;
                	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= ((double) INFINITY)) {
                		tmp = ((d / (((D * D) * h) * w)) * (d * c0)) * (c0 / w);
                	} 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 = ((d * d) * c0) / ((D * D) * (h * w));
                	double tmp;
                	if (((Math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Double.POSITIVE_INFINITY) {
                		tmp = ((d / (((D * D) * h) * w)) * (d * c0)) * (c0 / w);
                	} else {
                		tmp = 0.0;
                	}
                	return tmp;
                }
                
                def code(c0, w, h, D, d, M):
                	t_0 = ((d * d) * c0) / ((D * D) * (h * w))
                	tmp = 0
                	if ((math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= math.inf:
                		tmp = ((d / (((D * D) * h) * w)) * (d * c0)) * (c0 / w)
                	else:
                		tmp = 0.0
                	return tmp
                
                function code(c0, w, h, D, d, M)
                	t_0 = Float64(Float64(Float64(d * d) * c0) / Float64(Float64(D * D) * Float64(h * w)))
                	tmp = 0.0
                	if (Float64(Float64(sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))) + t_0) * Float64(c0 / Float64(2.0 * w))) <= Inf)
                		tmp = Float64(Float64(Float64(d / Float64(Float64(Float64(D * D) * h) * w)) * Float64(d * c0)) * Float64(c0 / w));
                	else
                		tmp = 0.0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(c0, w, h, D, d, M)
                	t_0 = ((d * d) * c0) / ((D * D) * (h * w));
                	tmp = 0.0;
                	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Inf)
                		tmp = ((d / (((D * D) * h) * w)) * (d * c0)) * (c0 / w);
                	else
                		tmp = 0.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(d * d), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(d / N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * N[(d * c0), $MachinePrecision]), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision], 0.0]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\
                \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\
                \;\;\;\;\left(\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)\right) \cdot \frac{c0}{w}\\
                
                \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 73.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    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. associate-/l*N/A

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

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

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

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

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

                        \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                      7. metadata-eval36.9

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M} + \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\left(\frac{d}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)\right) \cdot \frac{c0}{w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 4: 55.0% accurate, 0.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\ \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{\frac{c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)}{w} \cdot d\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                  (FPCore (c0 w h D d M)
                   :precision binary64
                   (let* ((t_0 (/ (* (* d d) c0) (* (* D D) (* h w)))))
                     (if (<=
                          (* (+ (sqrt (- (* t_0 t_0) (* M M))) t_0) (/ c0 (* 2.0 w)))
                          INFINITY)
                       (* (/ (* (/ c0 (* (* (* D D) h) w)) (* d c0)) w) d)
                       0.0)))
                  double code(double c0, double w, double h, double D, double d, double M) {
                  	double t_0 = ((d * d) * c0) / ((D * D) * (h * w));
                  	double tmp;
                  	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= ((double) INFINITY)) {
                  		tmp = (((c0 / (((D * D) * h) * w)) * (d * c0)) / 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 = ((d * d) * c0) / ((D * D) * (h * w));
                  	double tmp;
                  	if (((Math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Double.POSITIVE_INFINITY) {
                  		tmp = (((c0 / (((D * D) * h) * w)) * (d * c0)) / w) * d;
                  	} else {
                  		tmp = 0.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(c0, w, h, D, d, M):
                  	t_0 = ((d * d) * c0) / ((D * D) * (h * w))
                  	tmp = 0
                  	if ((math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= math.inf:
                  		tmp = (((c0 / (((D * D) * h) * w)) * (d * c0)) / w) * d
                  	else:
                  		tmp = 0.0
                  	return tmp
                  
                  function code(c0, w, h, D, d, M)
                  	t_0 = Float64(Float64(Float64(d * d) * c0) / Float64(Float64(D * D) * Float64(h * w)))
                  	tmp = 0.0
                  	if (Float64(Float64(sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))) + t_0) * Float64(c0 / Float64(2.0 * w))) <= Inf)
                  		tmp = Float64(Float64(Float64(Float64(c0 / Float64(Float64(Float64(D * D) * h) * w)) * Float64(d * c0)) / w) * d);
                  	else
                  		tmp = 0.0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(c0, w, h, D, d, M)
                  	t_0 = ((d * d) * c0) / ((D * D) * (h * w));
                  	tmp = 0.0;
                  	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Inf)
                  		tmp = (((c0 / (((D * D) * h) * w)) * (d * c0)) / w) * d;
                  	else
                  		tmp = 0.0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(d * d), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(c0 / N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * N[(d * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] * d), $MachinePrecision], 0.0]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\
                  \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\
                  \;\;\;\;\frac{\frac{c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)}{w} \cdot d\\
                  
                  \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 73.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        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. associate-/l*N/A

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

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

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

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

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

                            \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                          7. metadata-eval36.9

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M} + \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{\frac{c0}{\left(\left(D \cdot D\right) \cdot h\right) \cdot w} \cdot \left(d \cdot c0\right)}{w} \cdot d\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 5: 53.1% accurate, 0.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\ \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                      (FPCore (c0 w h D d M)
                       :precision binary64
                       (let* ((t_0 (/ (* (* d d) c0) (* (* D D) (* h w)))))
                         (if (<=
                              (* (+ (sqrt (- (* t_0 t_0) (* M M))) t_0) (/ c0 (* 2.0 w)))
                              INFINITY)
                           (* (/ (* (* d c0) c0) (* (* (* (* 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 = ((d * d) * c0) / ((D * D) * (h * w));
                      	double tmp;
                      	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= ((double) INFINITY)) {
                      		tmp = (((d * c0) * c0) / ((((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 = ((d * d) * c0) / ((D * D) * (h * w));
                      	double tmp;
                      	if (((Math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Double.POSITIVE_INFINITY) {
                      		tmp = (((d * c0) * c0) / ((((D * D) * h) * w) * w)) * d;
                      	} else {
                      		tmp = 0.0;
                      	}
                      	return tmp;
                      }
                      
                      def code(c0, w, h, D, d, M):
                      	t_0 = ((d * d) * c0) / ((D * D) * (h * w))
                      	tmp = 0
                      	if ((math.sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= math.inf:
                      		tmp = (((d * c0) * c0) / ((((D * D) * h) * w) * w)) * d
                      	else:
                      		tmp = 0.0
                      	return tmp
                      
                      function code(c0, w, h, D, d, M)
                      	t_0 = Float64(Float64(Float64(d * d) * c0) / Float64(Float64(D * D) * Float64(h * w)))
                      	tmp = 0.0
                      	if (Float64(Float64(sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))) + t_0) * Float64(c0 / Float64(2.0 * w))) <= Inf)
                      		tmp = Float64(Float64(Float64(Float64(d * c0) * c0) / Float64(Float64(Float64(Float64(D * D) * h) * w) * w)) * d);
                      	else
                      		tmp = 0.0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(c0, w, h, D, d, M)
                      	t_0 = ((d * d) * c0) / ((D * D) * (h * w));
                      	tmp = 0.0;
                      	if (((sqrt(((t_0 * t_0) - (M * M))) + t_0) * (c0 / (2.0 * w))) <= Inf)
                      		tmp = (((d * c0) * c0) / ((((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[(N[(d * d), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(d * c0), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * w), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 0.0]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\\
                      \mathbf{if}\;\left(\sqrt{t\_0 \cdot t\_0 - M \cdot M} + t\_0\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\
                      \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\
                      
                      \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 73.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          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. associate-/l*N/A

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

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

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

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

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

                              \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                            7. metadata-eval36.9

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

                            \[\leadsto \color{blue}{0} \]
                        7. Recombined 2 regimes into one program.
                        8. Final simplification46.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M} + \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 6: 40.3% accurate, 1.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\frac{\frac{2 \cdot \left(d \cdot c0\right)}{w}}{D \cdot h}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\ \end{array} \end{array} \]
                        (FPCore (c0 w h D d M)
                         :precision binary64
                         (if (<= M 1.15e-198)
                           0.0
                           (/ (* (* (/ (/ (/ (* 2.0 (* d c0)) w) (* D h)) D) d) (* 0.5 c0)) w)))
                        double code(double c0, double w, double h, double D, double d, double M) {
                        	double tmp;
                        	if (M <= 1.15e-198) {
                        		tmp = 0.0;
                        	} else {
                        		tmp = ((((((2.0 * (d * c0)) / w) / (D * h)) / D) * d) * (0.5 * c0)) / w;
                        	}
                        	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) :: tmp
                            if (m <= 1.15d-198) then
                                tmp = 0.0d0
                            else
                                tmp = ((((((2.0d0 * (d_1 * c0)) / w) / (d * h)) / d) * d_1) * (0.5d0 * c0)) / w
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double c0, double w, double h, double D, double d, double M) {
                        	double tmp;
                        	if (M <= 1.15e-198) {
                        		tmp = 0.0;
                        	} else {
                        		tmp = ((((((2.0 * (d * c0)) / w) / (D * h)) / D) * d) * (0.5 * c0)) / w;
                        	}
                        	return tmp;
                        }
                        
                        def code(c0, w, h, D, d, M):
                        	tmp = 0
                        	if M <= 1.15e-198:
                        		tmp = 0.0
                        	else:
                        		tmp = ((((((2.0 * (d * c0)) / w) / (D * h)) / D) * d) * (0.5 * c0)) / w
                        	return tmp
                        
                        function code(c0, w, h, D, d, M)
                        	tmp = 0.0
                        	if (M <= 1.15e-198)
                        		tmp = 0.0;
                        	else
                        		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(d * c0)) / w) / Float64(D * h)) / D) * d) * Float64(0.5 * c0)) / w);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(c0, w, h, D, d, M)
                        	tmp = 0.0;
                        	if (M <= 1.15e-198)
                        		tmp = 0.0;
                        	else
                        		tmp = ((((((2.0 * (d * c0)) / w) / (D * h)) / D) * d) * (0.5 * c0)) / w;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.15e-198], 0.0, N[(N[(N[(N[(N[(N[(N[(2.0 * N[(d * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] / N[(D * h), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] * d), $MachinePrecision] * N[(0.5 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\
                        \;\;\;\;0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\left(\frac{\frac{\frac{2 \cdot \left(d \cdot c0\right)}{w}}{D \cdot h}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if M < 1.15000000000000007e-198

                          1. Initial program 24.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. associate-/l*N/A

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

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

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

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

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

                              \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                            7. metadata-eval33.0

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

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

                          if 1.15000000000000007e-198 < M

                          1. Initial program 27.3%

                            \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\left(c0 \cdot 0.5\right) \cdot \left(\frac{\frac{\frac{\left(d \cdot c0\right) \cdot 2}{w}}{D \cdot h}}{D} \cdot d\right)}{w} \]
                            5. Recombined 2 regimes into one program.
                            6. Final simplification41.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\frac{\frac{2 \cdot \left(d \cdot c0\right)}{w}}{D \cdot h}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 7: 40.1% accurate, 2.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\frac{2 \cdot \left(d \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\ \end{array} \end{array} \]
                            (FPCore (c0 w h D d M)
                             :precision binary64
                             (if (<= M 1.15e-198)
                               0.0
                               (/ (* (* (/ (/ (* 2.0 (* d c0)) (* (* h w) D)) D) d) (* 0.5 c0)) w)))
                            double code(double c0, double w, double h, double D, double d, double M) {
                            	double tmp;
                            	if (M <= 1.15e-198) {
                            		tmp = 0.0;
                            	} else {
                            		tmp = (((((2.0 * (d * c0)) / ((h * w) * D)) / D) * d) * (0.5 * c0)) / w;
                            	}
                            	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) :: tmp
                                if (m <= 1.15d-198) then
                                    tmp = 0.0d0
                                else
                                    tmp = (((((2.0d0 * (d_1 * c0)) / ((h * w) * d)) / d) * d_1) * (0.5d0 * c0)) / w
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double c0, double w, double h, double D, double d, double M) {
                            	double tmp;
                            	if (M <= 1.15e-198) {
                            		tmp = 0.0;
                            	} else {
                            		tmp = (((((2.0 * (d * c0)) / ((h * w) * D)) / D) * d) * (0.5 * c0)) / w;
                            	}
                            	return tmp;
                            }
                            
                            def code(c0, w, h, D, d, M):
                            	tmp = 0
                            	if M <= 1.15e-198:
                            		tmp = 0.0
                            	else:
                            		tmp = (((((2.0 * (d * c0)) / ((h * w) * D)) / D) * d) * (0.5 * c0)) / w
                            	return tmp
                            
                            function code(c0, w, h, D, d, M)
                            	tmp = 0.0
                            	if (M <= 1.15e-198)
                            		tmp = 0.0;
                            	else
                            		tmp = Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64(d * c0)) / Float64(Float64(h * w) * D)) / D) * d) * Float64(0.5 * c0)) / w);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(c0, w, h, D, d, M)
                            	tmp = 0.0;
                            	if (M <= 1.15e-198)
                            		tmp = 0.0;
                            	else
                            		tmp = (((((2.0 * (d * c0)) / ((h * w) * D)) / D) * d) * (0.5 * c0)) / w;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.15e-198], 0.0, N[(N[(N[(N[(N[(N[(2.0 * N[(d * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] * d), $MachinePrecision] * N[(0.5 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\
                            \;\;\;\;0\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\left(\frac{\frac{2 \cdot \left(d \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if M < 1.15000000000000007e-198

                              1. Initial program 24.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. associate-/l*N/A

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

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

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

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

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

                                  \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                7. metadata-eval33.0

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

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

                              if 1.15000000000000007e-198 < M

                              1. Initial program 27.3%

                                \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\left(c0 \cdot 0.5\right) \cdot \left(\frac{\frac{\left(d \cdot c0\right) \cdot 2}{\left(h \cdot w\right) \cdot D}}{D} \cdot d\right)}{w} \]
                                5. Recombined 2 regimes into one program.
                                6. Final simplification41.0%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.15 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\frac{2 \cdot \left(d \cdot c0\right)}{\left(h \cdot w\right) \cdot D}}{D} \cdot d\right) \cdot \left(0.5 \cdot c0\right)}{w}\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 8: 39.5% accurate, 2.6× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{w} \cdot \left(d \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \cdot d\\ \end{array} \end{array} \]
                                (FPCore (c0 w h D d M)
                                 :precision binary64
                                 (if (<= M 1.9e-198) 0.0 (* (/ (* (/ c0 w) (* d c0)) (* (* (* h w) D) D)) d)))
                                double code(double c0, double w, double h, double D, double d, double M) {
                                	double tmp;
                                	if (M <= 1.9e-198) {
                                		tmp = 0.0;
                                	} else {
                                		tmp = (((c0 / w) * (d * c0)) / (((h * w) * D) * D)) * 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) :: tmp
                                    if (m <= 1.9d-198) then
                                        tmp = 0.0d0
                                    else
                                        tmp = (((c0 / w) * (d_1 * c0)) / (((h * w) * d) * d)) * d_1
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double c0, double w, double h, double D, double d, double M) {
                                	double tmp;
                                	if (M <= 1.9e-198) {
                                		tmp = 0.0;
                                	} else {
                                		tmp = (((c0 / w) * (d * c0)) / (((h * w) * D) * D)) * d;
                                	}
                                	return tmp;
                                }
                                
                                def code(c0, w, h, D, d, M):
                                	tmp = 0
                                	if M <= 1.9e-198:
                                		tmp = 0.0
                                	else:
                                		tmp = (((c0 / w) * (d * c0)) / (((h * w) * D) * D)) * d
                                	return tmp
                                
                                function code(c0, w, h, D, d, M)
                                	tmp = 0.0
                                	if (M <= 1.9e-198)
                                		tmp = 0.0;
                                	else
                                		tmp = Float64(Float64(Float64(Float64(c0 / w) * Float64(d * c0)) / Float64(Float64(Float64(h * w) * D) * D)) * d);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(c0, w, h, D, d, M)
                                	tmp = 0.0;
                                	if (M <= 1.9e-198)
                                		tmp = 0.0;
                                	else
                                		tmp = (((c0 / w) * (d * c0)) / (((h * w) * D) * D)) * d;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.9e-198], 0.0, N[(N[(N[(N[(c0 / w), $MachinePrecision] * N[(d * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\
                                \;\;\;\;0\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{c0}{w} \cdot \left(d \cdot c0\right)}{\left(\left(h \cdot w\right) \cdot D\right) \cdot D} \cdot d\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if M < 1.9000000000000001e-198

                                  1. Initial program 24.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. associate-/l*N/A

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

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

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

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

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

                                      \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                    7. metadata-eval33.0

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

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

                                  if 1.9000000000000001e-198 < M

                                  1. Initial program 27.3%

                                    \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 9: 38.5% accurate, 2.9× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w} \cdot d\\ \end{array} \end{array} \]
                                    (FPCore (c0 w h D d M)
                                     :precision binary64
                                     (if (<= M 1.9e-198) 0.0 (* (/ (* (* d c0) c0) (* (* (* (* h w) D) D) w)) d)))
                                    double code(double c0, double w, double h, double D, double d, double M) {
                                    	double tmp;
                                    	if (M <= 1.9e-198) {
                                    		tmp = 0.0;
                                    	} else {
                                    		tmp = (((d * c0) * c0) / ((((h * w) * D) * D) * w)) * 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) :: tmp
                                        if (m <= 1.9d-198) then
                                            tmp = 0.0d0
                                        else
                                            tmp = (((d_1 * c0) * c0) / ((((h * w) * d) * d) * w)) * d_1
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double c0, double w, double h, double D, double d, double M) {
                                    	double tmp;
                                    	if (M <= 1.9e-198) {
                                    		tmp = 0.0;
                                    	} else {
                                    		tmp = (((d * c0) * c0) / ((((h * w) * D) * D) * w)) * d;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(c0, w, h, D, d, M):
                                    	tmp = 0
                                    	if M <= 1.9e-198:
                                    		tmp = 0.0
                                    	else:
                                    		tmp = (((d * c0) * c0) / ((((h * w) * D) * D) * w)) * d
                                    	return tmp
                                    
                                    function code(c0, w, h, D, d, M)
                                    	tmp = 0.0
                                    	if (M <= 1.9e-198)
                                    		tmp = 0.0;
                                    	else
                                    		tmp = Float64(Float64(Float64(Float64(d * c0) * c0) / Float64(Float64(Float64(Float64(h * w) * D) * D) * w)) * d);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(c0, w, h, D, d, M)
                                    	tmp = 0.0;
                                    	if (M <= 1.9e-198)
                                    		tmp = 0.0;
                                    	else
                                    		tmp = (((d * c0) * c0) / ((((h * w) * D) * D) * w)) * d;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.9e-198], 0.0, N[(N[(N[(N[(d * c0), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision] * D), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\
                                    \;\;\;\;0\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(\left(h \cdot w\right) \cdot D\right) \cdot D\right) \cdot w} \cdot d\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if M < 1.9000000000000001e-198

                                      1. Initial program 24.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. associate-/l*N/A

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

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

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

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

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

                                          \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                        7. metadata-eval33.0

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

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

                                      if 1.9000000000000001e-198 < M

                                      1. Initial program 27.3%

                                        \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 10: 38.7% accurate, 2.9× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(D \cdot w\right) \cdot \left(D \cdot h\right)\right) \cdot w} \cdot d\\ \end{array} \end{array} \]
                                        (FPCore (c0 w h D d M)
                                         :precision binary64
                                         (if (<= M 1.9e-198) 0.0 (* (/ (* (* d c0) c0) (* (* (* D w) (* D h)) w)) d)))
                                        double code(double c0, double w, double h, double D, double d, double M) {
                                        	double tmp;
                                        	if (M <= 1.9e-198) {
                                        		tmp = 0.0;
                                        	} else {
                                        		tmp = (((d * c0) * c0) / (((D * w) * (D * h)) * w)) * 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) :: tmp
                                            if (m <= 1.9d-198) then
                                                tmp = 0.0d0
                                            else
                                                tmp = (((d_1 * c0) * c0) / (((d * w) * (d * h)) * w)) * d_1
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double c0, double w, double h, double D, double d, double M) {
                                        	double tmp;
                                        	if (M <= 1.9e-198) {
                                        		tmp = 0.0;
                                        	} else {
                                        		tmp = (((d * c0) * c0) / (((D * w) * (D * h)) * w)) * d;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(c0, w, h, D, d, M):
                                        	tmp = 0
                                        	if M <= 1.9e-198:
                                        		tmp = 0.0
                                        	else:
                                        		tmp = (((d * c0) * c0) / (((D * w) * (D * h)) * w)) * d
                                        	return tmp
                                        
                                        function code(c0, w, h, D, d, M)
                                        	tmp = 0.0
                                        	if (M <= 1.9e-198)
                                        		tmp = 0.0;
                                        	else
                                        		tmp = Float64(Float64(Float64(Float64(d * c0) * c0) / Float64(Float64(Float64(D * w) * Float64(D * h)) * w)) * d);
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(c0, w, h, D, d, M)
                                        	tmp = 0.0;
                                        	if (M <= 1.9e-198)
                                        		tmp = 0.0;
                                        	else
                                        		tmp = (((d * c0) * c0) / (((D * w) * (D * h)) * w)) * d;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.9e-198], 0.0, N[(N[(N[(N[(d * c0), $MachinePrecision] * c0), $MachinePrecision] / N[(N[(N[(D * w), $MachinePrecision] * N[(D * h), $MachinePrecision]), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;M \leq 1.9 \cdot 10^{-198}:\\
                                        \;\;\;\;0\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{\left(d \cdot c0\right) \cdot c0}{\left(\left(D \cdot w\right) \cdot \left(D \cdot h\right)\right) \cdot w} \cdot d\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if M < 1.9000000000000001e-198

                                          1. Initial program 24.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. associate-/l*N/A

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

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

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

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

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

                                              \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                            7. metadata-eval33.0

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

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

                                          if 1.9000000000000001e-198 < M

                                          1. Initial program 27.3%

                                            \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 11: 37.5% accurate, 2.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.3 \cdot 10^{+17}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(c0 \cdot c0\right) \cdot d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\ \end{array} \end{array} \]
                                            (FPCore (c0 w h D d M)
                                             :precision binary64
                                             (if (<= M 1.3e+17) 0.0 (* (/ (* (* c0 c0) d) (* (* (* (* D D) h) w) w)) d)))
                                            double code(double c0, double w, double h, double D, double d, double M) {
                                            	double tmp;
                                            	if (M <= 1.3e+17) {
                                            		tmp = 0.0;
                                            	} else {
                                            		tmp = (((c0 * c0) * d) / ((((D * D) * h) * w) * w)) * 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) :: tmp
                                                if (m <= 1.3d+17) then
                                                    tmp = 0.0d0
                                                else
                                                    tmp = (((c0 * c0) * d_1) / ((((d * d) * h) * w) * w)) * d_1
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double c0, double w, double h, double D, double d, double M) {
                                            	double tmp;
                                            	if (M <= 1.3e+17) {
                                            		tmp = 0.0;
                                            	} else {
                                            		tmp = (((c0 * c0) * d) / ((((D * D) * h) * w) * w)) * d;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(c0, w, h, D, d, M):
                                            	tmp = 0
                                            	if M <= 1.3e+17:
                                            		tmp = 0.0
                                            	else:
                                            		tmp = (((c0 * c0) * d) / ((((D * D) * h) * w) * w)) * d
                                            	return tmp
                                            
                                            function code(c0, w, h, D, d, M)
                                            	tmp = 0.0
                                            	if (M <= 1.3e+17)
                                            		tmp = 0.0;
                                            	else
                                            		tmp = Float64(Float64(Float64(Float64(c0 * c0) * d) / Float64(Float64(Float64(Float64(D * D) * h) * w) * w)) * d);
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(c0, w, h, D, d, M)
                                            	tmp = 0.0;
                                            	if (M <= 1.3e+17)
                                            		tmp = 0.0;
                                            	else
                                            		tmp = (((c0 * c0) * d) / ((((D * D) * h) * w) * w)) * d;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.3e+17], 0.0, N[(N[(N[(N[(c0 * c0), $MachinePrecision] * d), $MachinePrecision] / N[(N[(N[(N[(D * D), $MachinePrecision] * h), $MachinePrecision] * w), $MachinePrecision] * w), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;M \leq 1.3 \cdot 10^{+17}:\\
                                            \;\;\;\;0\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{\left(c0 \cdot c0\right) \cdot d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if M < 1.3e17

                                              1. Initial program 26.5%

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

                                                \[\leadsto \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. associate-/l*N/A

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

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

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

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

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

                                                  \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                                7. metadata-eval31.5

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

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

                                              if 1.3e17 < M

                                              1. Initial program 20.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.3 \cdot 10^{+17}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(c0 \cdot c0\right) \cdot d}{\left(\left(\left(D \cdot D\right) \cdot h\right) \cdot w\right) \cdot w} \cdot d\\ \end{array} \]
                                                5. Add Preprocessing

                                                Alternative 12: 33.8% 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 25.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{-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. associate-/l*N/A

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

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

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

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

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

                                                    \[\leadsto \frac{-1}{2} \cdot \color{blue}{0} \]
                                                  7. metadata-eval27.9

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

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

                                                Reproduce

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