Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.5% → 56.4%
Time: 21.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.5% 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: 56.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{\frac{c0 \cdot d}{\left(2 \cdot w\right) \cdot D}}{\frac{w \cdot \left(D \cdot \left(h \cdot 0.5\right)\right)}{c0 \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 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \left(c0 \cdot \color{blue}{\frac{1}{\frac{w \cdot h}{2}}}\right)\right)\right) \]
      19. un-div-invN/A

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

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

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

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

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

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

        \[\leadsto \left(\frac{c0}{2 \cdot w} \cdot \frac{d}{D}\right) \cdot \color{blue}{\frac{1}{\frac{D}{d \cdot \frac{c0}{w \cdot \left(h \cdot \frac{1}{2}\right)}}}} \]
      4. un-div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval36.1

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified36.1%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt41.7

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr41.7%

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

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

Alternative 2: 41.0% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.2 \cdot 10^{-209}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.2000000000000001e-209

    1. Initial program 29.0%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval29.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified29.2%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt33.3

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr33.3%

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

    if 1.2000000000000001e-209 < M

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \left(c0 \cdot \color{blue}{\frac{1}{\frac{w \cdot h}{2}}}\right)\right)\right) \]
      19. un-div-invN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\frac{c0}{2 \cdot w} \cdot \frac{d}{D}\right) \cdot \left(c0 \cdot d\right)}\right)}{\mathsf{neg}\left(D \cdot \left(w \cdot \left(h \cdot \frac{1}{2}\right)\right)\right)} \]
      9. frac-timesN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{c0 \cdot d}{\left(2 \cdot w\right) \cdot D} \cdot \color{blue}{\left(c0 \cdot d\right)}\right)}{\mathsf{neg}\left(D \cdot \left(w \cdot \left(h \cdot \frac{1}{2}\right)\right)\right)} \]
    11. Applied egg-rr43.3%

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

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

Alternative 3: 40.1% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.8 \cdot 10^{-209}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.80000000000000008e-209

    1. Initial program 29.0%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval29.2

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified29.2%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt33.3

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr33.3%

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

    if 1.80000000000000008e-209 < M

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \left(c0 \cdot \color{blue}{\frac{1}{\frac{w \cdot h}{2}}}\right)\right)\right) \]
      19. un-div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{c0 \cdot d}{\left(2 \cdot w\right) \cdot D} \cdot \left(c0 \cdot d\right)}{w \cdot \color{blue}{\left(\left(h \cdot \frac{1}{2}\right) \cdot D\right)}} \]
      17. *-lowering-*.f6442.4

        \[\leadsto \frac{\frac{c0 \cdot d}{\left(2 \cdot w\right) \cdot D} \cdot \left(c0 \cdot d\right)}{w \cdot \left(\color{blue}{\left(h \cdot 0.5\right)} \cdot D\right)} \]
    11. Applied egg-rr42.4%

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

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

Alternative 4: 39.5% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 5.1 \cdot 10^{-219}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 5.0999999999999998e-219

    1. Initial program 28.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(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval29.9

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified29.9%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt34.1

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr34.1%

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

    if 5.0999999999999998e-219 < M

    1. Initial program 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \left(c0 \cdot \color{blue}{\frac{1}{\frac{w \cdot h}{2}}}\right)\right)\right) \]
      19. un-div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 39.3% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.6 \cdot 10^{-218}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 7.5999999999999997e-218

    1. Initial program 28.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(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval29.9

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified29.9%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt34.1

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr34.1%

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

    if 7.5999999999999997e-218 < M

    1. Initial program 19.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \left(c0 \cdot \color{blue}{\frac{1}{\frac{w \cdot h}{2}}}\right)\right)\right) \]
      19. un-div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 38.2% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 9.5 \cdot 10^{-17}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w}}{w \cdot D}}{h \cdot D}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M 9.5e-17) 0.0 (/ (/ (* c0 (/ (* c0 (* d d)) w)) (* w D)) (* h D))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 9.5e-17) {
		tmp = 0.0;
	} else {
		tmp = ((c0 * ((c0 * (d * d)) / w)) / (w * D)) / (h * D);
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= 9.5d-17) then
        tmp = 0.0d0
    else
        tmp = ((c0 * ((c0 * (d_1 * d_1)) / w)) / (w * d)) / (h * d)
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 9.5e-17) {
		tmp = 0.0;
	} else {
		tmp = ((c0 * ((c0 * (d * d)) / w)) / (w * D)) / (h * D);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= 9.5e-17:
		tmp = 0.0
	else:
		tmp = ((c0 * ((c0 * (d * d)) / w)) / (w * D)) / (h * D)
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= 9.5e-17)
		tmp = 0.0;
	else
		tmp = Float64(Float64(Float64(c0 * Float64(Float64(c0 * Float64(d * d)) / w)) / Float64(w * D)) / Float64(h * D));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= 9.5e-17)
		tmp = 0.0;
	else
		tmp = ((c0 * ((c0 * (d * d)) / w)) / (w * D)) / (h * D);
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 9.5e-17], 0.0, N[(N[(N[(c0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision] / N[(w * D), $MachinePrecision]), $MachinePrecision] / N[(h * D), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 9.50000000000000029e-17

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 9.50000000000000029e-17 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \color{blue}{\left(D \cdot \left(D \cdot h\right)\right)}\right)} \]
      20. *-lowering-*.f6436.0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{c0 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w}}{\color{blue}{w \cdot D}}}{D \cdot h} \]
      12. *-lowering-*.f6438.5

        \[\leadsto \frac{\frac{c0 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w}}{w \cdot D}}{\color{blue}{D \cdot h}} \]
    12. Applied egg-rr38.5%

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

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

Alternative 7: 38.3% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.8000000000000001e-15

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 1.8000000000000001e-15 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \color{blue}{\left(D \cdot w\right)}}}{w \cdot D} \]
      12. *-lowering-*.f6438.5

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

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

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

Alternative 8: 38.1% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 1.5 \cdot 10^{-16}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M 1.5e-16) 0.0 (/ (* (* c0 d) (* c0 d)) (* w (* w (* D (* h D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 1.5e-16) {
		tmp = 0.0;
	} else {
		tmp = ((c0 * d) * (c0 * d)) / (w * (w * (D * (h * D))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= 1.5d-16) then
        tmp = 0.0d0
    else
        tmp = ((c0 * d_1) * (c0 * d_1)) / (w * (w * (d * (h * d))))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 1.5e-16) {
		tmp = 0.0;
	} else {
		tmp = ((c0 * d) * (c0 * d)) / (w * (w * (D * (h * D))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= 1.5e-16:
		tmp = 0.0
	else:
		tmp = ((c0 * d) * (c0 * d)) / (w * (w * (D * (h * D))))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= 1.5e-16)
		tmp = 0.0;
	else
		tmp = Float64(Float64(Float64(c0 * d) * Float64(c0 * d)) / Float64(w * Float64(w * Float64(D * Float64(h * D)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= 1.5e-16)
		tmp = 0.0;
	else
		tmp = ((c0 * d) * (c0 * d)) / (w * (w * (D * (h * D))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.5e-16], 0.0, N[(N[(N[(c0 * d), $MachinePrecision] * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / N[(w * N[(w * N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.5 \cdot 10^{-16}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.49999999999999997e-16

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 1.49999999999999997e-16 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \color{blue}{\left(D \cdot \left(D \cdot h\right)\right)}\right)} \]
      20. *-lowering-*.f6436.0

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(c0 \cdot d\right)} \cdot \left(c0 \cdot d\right)}{w \cdot \left(w \cdot \left(D \cdot \left(D \cdot h\right)\right)\right)} \]
      5. *-lowering-*.f6438.4

        \[\leadsto \frac{\left(c0 \cdot d\right) \cdot \color{blue}{\left(c0 \cdot d\right)}}{w \cdot \left(w \cdot \left(D \cdot \left(D \cdot h\right)\right)\right)} \]
    12. Applied egg-rr38.4%

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

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

Alternative 9: 37.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 9 \cdot 10^{-16}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(\left(w \cdot D\right) \cdot \left(h \cdot D\right)\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M 9e-16) 0.0 (/ (* c0 (* c0 (* d d))) (* w (* (* w D) (* h D))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 9e-16) {
		tmp = 0.0;
	} else {
		tmp = (c0 * (c0 * (d * d))) / (w * ((w * D) * (h * D)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= 9d-16) then
        tmp = 0.0d0
    else
        tmp = (c0 * (c0 * (d_1 * d_1))) / (w * ((w * d) * (h * d)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 9e-16) {
		tmp = 0.0;
	} else {
		tmp = (c0 * (c0 * (d * d))) / (w * ((w * D) * (h * D)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= 9e-16:
		tmp = 0.0
	else:
		tmp = (c0 * (c0 * (d * d))) / (w * ((w * D) * (h * D)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= 9e-16)
		tmp = 0.0;
	else
		tmp = Float64(Float64(c0 * Float64(c0 * Float64(d * d))) / Float64(w * Float64(Float64(w * D) * Float64(h * D))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= 9e-16)
		tmp = 0.0;
	else
		tmp = (c0 * (c0 * (d * d))) / (w * ((w * D) * (h * D)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 9e-16], 0.0, N[(N[(c0 * N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(w * N[(N[(w * D), $MachinePrecision] * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 9 \cdot 10^{-16}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 9.0000000000000003e-16

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 9.0000000000000003e-16 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \color{blue}{\left(D \cdot \left(D \cdot h\right)\right)}\right)} \]
      20. *-lowering-*.f6436.0

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(\color{blue}{\left(w \cdot D\right)} \cdot \left(D \cdot h\right)\right)} \]
      4. *-lowering-*.f6437.9

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(\left(w \cdot D\right) \cdot \color{blue}{\left(D \cdot h\right)}\right)} \]
    12. Applied egg-rr37.9%

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

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

Alternative 10: 37.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 2.9 \cdot 10^{-15}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M 2.9e-15) 0.0 (/ (* c0 (* c0 (* d d))) (* w (* w (* D (* h D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 2.9e-15) {
		tmp = 0.0;
	} else {
		tmp = (c0 * (c0 * (d * d))) / (w * (w * (D * (h * D))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= 2.9d-15) then
        tmp = 0.0d0
    else
        tmp = (c0 * (c0 * (d_1 * d_1))) / (w * (w * (d * (h * d))))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 2.9e-15) {
		tmp = 0.0;
	} else {
		tmp = (c0 * (c0 * (d * d))) / (w * (w * (D * (h * D))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= 2.9e-15:
		tmp = 0.0
	else:
		tmp = (c0 * (c0 * (d * d))) / (w * (w * (D * (h * D))))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= 2.9e-15)
		tmp = 0.0;
	else
		tmp = Float64(Float64(c0 * Float64(c0 * Float64(d * d))) / Float64(w * Float64(w * Float64(D * Float64(h * D)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= 2.9e-15)
		tmp = 0.0;
	else
		tmp = (c0 * (c0 * (d * d))) / (w * (w * (D * (h * D))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 2.9e-15], 0.0, N[(N[(c0 * N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(w * N[(w * N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.9 \cdot 10^{-15}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 2.90000000000000019e-15

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 2.90000000000000019e-15 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \color{blue}{\left(D \cdot \left(D \cdot h\right)\right)}\right)} \]
      20. *-lowering-*.f6436.0

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

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

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

Alternative 11: 36.6% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.55 \cdot 10^{-15}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.5499999999999999e-15

    1. Initial program 27.4%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
      6. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
      11. metadata-evalN/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
      13. metadata-eval30.7

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    5. Simplified30.7%

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

        \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
      2. mul0-rgt35.0

        \[\leadsto \color{blue}{0} \]
    7. Applied egg-rr35.0%

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

    if 1.5499999999999999e-15 < M

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{h \cdot \left(w \cdot \color{blue}{\left(D \cdot D\right)}\right)} \]
      14. *-lowering-*.f6432.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{w \cdot \left(w \cdot \color{blue}{\left(D \cdot \left(D \cdot h\right)\right)}\right)} \]
      20. *-lowering-*.f6436.0

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot \left(D \cdot h\right)\right) \cdot \color{blue}{\left(w \cdot w\right)}} \cdot c0 \]
    12. Applied egg-rr33.9%

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

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

Alternative 12: 33.4% 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 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 \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
  4. Step-by-step derivation
    1. associate-*r*N/A

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{0}\right) \]
    6. metadata-evalN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
    7. distribute-lft-neg-inN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)} \]
    8. distribute-rgt-neg-inN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)} \]
    9. metadata-evalN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\mathsf{neg}\left(\color{blue}{0}\right)\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    11. metadata-evalN/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 + 1\right)}\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 + 1\right)\right)} \]
    13. metadata-eval29.2

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
  5. Simplified29.2%

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

      \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot 0} \]
    2. mul0-rgt33.0

      \[\leadsto \color{blue}{0} \]
  7. Applied egg-rr33.0%

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

Reproduce

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