
(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:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M))))) INFINITY)
(/ (* 2.0 t_0) (* (/ D d) (/ (* h (* w D)) (* c0 d))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= ((double) INFINITY)) {
tmp = (2.0 * t_0) / ((D / d) * ((h * (w * D)) / (c0 * d)));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = (2.0 * t_0) / ((D / d) * ((h * (w * D)) / (c0 * d)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))) <= math.inf: tmp = (2.0 * t_0) / ((D / d) * ((h * (w * D)) / (c0 * d))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) <= Inf) tmp = Float64(Float64(2.0 * t_0) / Float64(Float64(D / d) * Float64(Float64(h * Float64(w * D)) / Float64(c0 * d)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= Inf) tmp = (2.0 * t_0) / ((D / d) * ((h * (w * D)) / (c0 * d))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(2.0 * t$95$0), $MachinePrecision] / N[(N[(D / d), $MachinePrecision] * N[(N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision] / N[(c0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{2 \cdot t_0}{\frac{D}{d} \cdot \frac{h \cdot \left(w \cdot D\right)}{c0 \cdot d}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 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.0Initial program 79.9%
times-frac73.3%
fma-def72.0%
associate-/r*70.8%
difference-of-squares70.8%
Simplified73.0%
fma-udef75.6%
associate-/l/73.0%
frac-times74.4%
pow274.4%
fma-udef74.4%
associate-/l/73.1%
times-frac70.8%
associate-/l/72.1%
times-frac72.0%
Applied egg-rr75.6%
Taylor expanded in c0 around inf 80.0%
associate-*r/80.0%
unpow280.0%
associate-*l*82.5%
unpow282.5%
associate-*l*81.2%
Simplified81.2%
associate-*r/82.2%
associate-/r*82.2%
Applied egg-rr82.2%
associate-/r*82.2%
associate-*r/81.2%
add-exp-log34.2%
*-commutative34.2%
add-exp-log81.2%
associate-/l*81.2%
*-commutative81.2%
Applied egg-rr81.2%
associate-*l/81.2%
*-commutative81.2%
times-frac87.2%
associate-*r*84.8%
Simplified84.8%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 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))))) Initial program 0.0%
times-frac0.0%
fma-def0.0%
associate-/r*0.0%
difference-of-squares5.6%
Simplified15.9%
Taylor expanded in c0 around -inf 0.8%
associate-*r*0.8%
distribute-rgt1-in0.8%
metadata-eval0.8%
mul0-lft37.4%
metadata-eval37.4%
mul0-lft0.8%
metadata-eval0.8%
distribute-lft1-in0.8%
*-commutative0.8%
distribute-lft1-in0.8%
metadata-eval0.8%
mul0-lft37.4%
Simplified37.4%
Taylor expanded in c0 around 0 42.7%
Final simplification55.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* (* (/ d D) (/ d D)) (* c0 c0)) (* h (* w w)))))
(if (<= w -3.3e+83)
0.0
(if (<= w -8.8e-105)
t_0
(if (<= w -1.75e-130)
0.0
(if (<= w -1e-172)
t_0
(if (<= w 1.5e-162)
(/ (* (* c0 c0) (/ d (/ w d))) (* D (* (* w h) D)))
(if (<= w 3.3e-26) t_0 0.0))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w));
double tmp;
if (w <= -3.3e+83) {
tmp = 0.0;
} else if (w <= -8.8e-105) {
tmp = t_0;
} else if (w <= -1.75e-130) {
tmp = 0.0;
} else if (w <= -1e-172) {
tmp = t_0;
} else if (w <= 1.5e-162) {
tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D));
} else if (w <= 3.3e-26) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (((d_1 / d) * (d_1 / d)) * (c0 * c0)) / (h * (w * w))
if (w <= (-3.3d+83)) then
tmp = 0.0d0
else if (w <= (-8.8d-105)) then
tmp = t_0
else if (w <= (-1.75d-130)) then
tmp = 0.0d0
else if (w <= (-1d-172)) then
tmp = t_0
else if (w <= 1.5d-162) then
tmp = ((c0 * c0) * (d_1 / (w / d_1))) / (d * ((w * h) * d))
else if (w <= 3.3d-26) then
tmp = t_0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w));
double tmp;
if (w <= -3.3e+83) {
tmp = 0.0;
} else if (w <= -8.8e-105) {
tmp = t_0;
} else if (w <= -1.75e-130) {
tmp = 0.0;
} else if (w <= -1e-172) {
tmp = t_0;
} else if (w <= 1.5e-162) {
tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D));
} else if (w <= 3.3e-26) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w)) tmp = 0 if w <= -3.3e+83: tmp = 0.0 elif w <= -8.8e-105: tmp = t_0 elif w <= -1.75e-130: tmp = 0.0 elif w <= -1e-172: tmp = t_0 elif w <= 1.5e-162: tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D)) elif w <= 3.3e-26: tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 * c0)) / Float64(h * Float64(w * w))) tmp = 0.0 if (w <= -3.3e+83) tmp = 0.0; elseif (w <= -8.8e-105) tmp = t_0; elseif (w <= -1.75e-130) tmp = 0.0; elseif (w <= -1e-172) tmp = t_0; elseif (w <= 1.5e-162) tmp = Float64(Float64(Float64(c0 * c0) * Float64(d / Float64(w / d))) / Float64(D * Float64(Float64(w * h) * D))); elseif (w <= 3.3e-26) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w)); tmp = 0.0; if (w <= -3.3e+83) tmp = 0.0; elseif (w <= -8.8e-105) tmp = t_0; elseif (w <= -1.75e-130) tmp = 0.0; elseif (w <= -1e-172) tmp = t_0; elseif (w <= 1.5e-162) tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D)); elseif (w <= 3.3e-26) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -3.3e+83], 0.0, If[LessEqual[w, -8.8e-105], t$95$0, If[LessEqual[w, -1.75e-130], 0.0, If[LessEqual[w, -1e-172], t$95$0, If[LessEqual[w, 1.5e-162], N[(N[(N[(c0 * c0), $MachinePrecision] * N[(d / N[(w / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 3.3e-26], t$95$0, 0.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;w \leq -3.3 \cdot 10^{+83}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -8.8 \cdot 10^{-105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -1.75 \cdot 10^{-130}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -1 \cdot 10^{-172}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq 1.5 \cdot 10^{-162}:\\
\;\;\;\;\frac{\left(c0 \cdot c0\right) \cdot \frac{d}{\frac{w}{d}}}{D \cdot \left(\left(w \cdot h\right) \cdot D\right)}\\
\mathbf{elif}\;w \leq 3.3 \cdot 10^{-26}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -3.29999999999999985e83 or -8.80000000000000016e-105 < w < -1.75e-130 or 3.2999999999999998e-26 < w Initial program 18.8%
times-frac13.7%
fma-def12.8%
associate-/r*12.8%
difference-of-squares12.8%
Simplified20.7%
Taylor expanded in c0 around -inf 8.7%
associate-*r*8.7%
distribute-rgt1-in8.7%
metadata-eval8.7%
mul0-lft54.0%
metadata-eval54.0%
mul0-lft9.7%
metadata-eval9.7%
distribute-lft1-in9.7%
*-commutative9.7%
distribute-lft1-in9.7%
metadata-eval9.7%
mul0-lft54.0%
Simplified54.0%
Taylor expanded in c0 around 0 54.0%
if -3.29999999999999985e83 < w < -8.80000000000000016e-105 or -1.75e-130 < w < -1e-172 or 1.49999999999999999e-162 < w < 3.2999999999999998e-26Initial program 27.2%
times-frac27.2%
fma-def27.2%
associate-/r*26.0%
difference-of-squares29.7%
Simplified38.8%
fma-udef40.0%
associate-/l/32.3%
frac-times40.8%
pow240.8%
fma-udef40.8%
associate-/l/32.3%
times-frac29.7%
associate-/l/29.7%
times-frac29.7%
Applied egg-rr42.0%
Taylor expanded in c0 around inf 27.5%
times-frac28.7%
unpow228.7%
unpow228.7%
unpow228.7%
*-commutative28.7%
unpow228.7%
Simplified28.7%
associate-*r/30.0%
times-frac45.5%
Applied egg-rr45.5%
if -1e-172 < w < 1.49999999999999999e-162Initial program 26.3%
times-frac26.3%
fma-def26.3%
associate-/r*26.3%
difference-of-squares35.5%
Simplified42.1%
fma-udef42.1%
associate-/l/36.9%
frac-times42.1%
pow242.1%
fma-udef42.1%
associate-/l/36.9%
times-frac35.5%
associate-/l/35.5%
times-frac35.5%
Applied egg-rr34.4%
Taylor expanded in c0 around inf 40.2%
associate-*r/40.2%
unpow240.2%
associate-*l*41.5%
unpow241.5%
associate-*l*52.3%
Simplified52.3%
associate-*r/52.3%
associate-/r*52.3%
Applied egg-rr52.3%
Taylor expanded in c0 around 0 45.6%
unpow245.6%
associate-/l*48.2%
associate-/r/48.2%
unpow248.2%
associate-/l*52.2%
Simplified52.2%
Final simplification50.8%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= w -2.7e+82)
0.0
(if (or (<= w 1.7e-20) (and (not (<= w 9.5e+102)) (<= w 5.4e+123)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* (/ d D) (/ d D)) (/ (/ c0 h) w))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (w <= -2.7e+82) {
tmp = 0.0;
} else if ((w <= 1.7e-20) || (!(w <= 9.5e+102) && (w <= 5.4e+123))) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / h) / w)));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (w <= (-2.7d+82)) then
tmp = 0.0d0
else if ((w <= 1.7d-20) .or. (.not. (w <= 9.5d+102)) .and. (w <= 5.4d+123)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 / d) * (d_1 / d)) * ((c0 / h) / w)))
else
tmp = 0.0d0
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 (w <= -2.7e+82) {
tmp = 0.0;
} else if ((w <= 1.7e-20) || (!(w <= 9.5e+102) && (w <= 5.4e+123))) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / h) / w)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if w <= -2.7e+82: tmp = 0.0 elif (w <= 1.7e-20) or (not (w <= 9.5e+102) and (w <= 5.4e+123)): tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / h) / w))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (w <= -2.7e+82) tmp = 0.0; elseif ((w <= 1.7e-20) || (!(w <= 9.5e+102) && (w <= 5.4e+123))) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 / h) / w)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (w <= -2.7e+82) tmp = 0.0; elseif ((w <= 1.7e-20) || (~((w <= 9.5e+102)) && (w <= 5.4e+123))) tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / h) / w))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[w, -2.7e+82], 0.0, If[Or[LessEqual[w, 1.7e-20], And[N[Not[LessEqual[w, 9.5e+102]], $MachinePrecision], LessEqual[w, 5.4e+123]]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.7 \cdot 10^{+82}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq 1.7 \cdot 10^{-20} \lor \neg \left(w \leq 9.5 \cdot 10^{+102}\right) \land w \leq 5.4 \cdot 10^{+123}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.6999999999999999e82 or 1.6999999999999999e-20 < w < 9.4999999999999992e102 or 5.40000000000000026e123 < w Initial program 16.8%
times-frac10.5%
fma-def9.3%
associate-/r*9.4%
difference-of-squares9.4%
Simplified16.6%
Taylor expanded in c0 around -inf 10.6%
associate-*r*10.6%
distribute-rgt1-in10.6%
metadata-eval10.6%
mul0-lft58.3%
metadata-eval58.3%
mul0-lft11.8%
metadata-eval11.8%
distribute-lft1-in11.8%
*-commutative11.8%
distribute-lft1-in11.8%
metadata-eval11.8%
mul0-lft58.3%
Simplified58.3%
Taylor expanded in c0 around 0 58.3%
if -2.6999999999999999e82 < w < 1.6999999999999999e-20 or 9.4999999999999992e102 < w < 5.40000000000000026e123Initial program 26.9%
times-frac26.9%
fma-def26.9%
associate-/r*26.3%
difference-of-squares32.0%
Simplified40.2%
fma-udef40.8%
associate-/l/33.9%
frac-times41.2%
pow241.2%
fma-udef41.2%
associate-/l/33.9%
times-frac32.0%
associate-/l/32.0%
times-frac32.0%
Applied egg-rr37.8%
Taylor expanded in c0 around inf 34.9%
associate-*r/34.9%
unpow234.9%
associate-*l*38.9%
unpow238.9%
associate-*l*44.8%
Simplified44.8%
Taylor expanded in d around 0 34.9%
unpow234.9%
times-frac36.1%
unpow236.1%
associate-/r*43.4%
associate-*l/47.9%
associate-*r/50.0%
*-commutative50.0%
associate-/r*50.0%
Simplified50.0%
Final simplification52.6%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D))))
(if (<= M 4e-217)
0.0
(if (<= M 7e-189)
(/ (* t_0 (* c0 c0)) (* h (* w w)))
(if (<= M 2.9e-154)
0.0
(if (<= M 6.1e-58)
(/ (* (* c0 c0) (/ d (/ w d))) (* D (* (* w h) D)))
(if (<= M 4.6) 0.0 (/ (* t_0 (/ (* c0 c0) h)) (* w w)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double tmp;
if (M <= 4e-217) {
tmp = 0.0;
} else if (M <= 7e-189) {
tmp = (t_0 * (c0 * c0)) / (h * (w * w));
} else if (M <= 2.9e-154) {
tmp = 0.0;
} else if (M <= 6.1e-58) {
tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D));
} else if (M <= 4.6) {
tmp = 0.0;
} else {
tmp = (t_0 * ((c0 * c0) / h)) / (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) :: t_0
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
if (m <= 4d-217) then
tmp = 0.0d0
else if (m <= 7d-189) then
tmp = (t_0 * (c0 * c0)) / (h * (w * w))
else if (m <= 2.9d-154) then
tmp = 0.0d0
else if (m <= 6.1d-58) then
tmp = ((c0 * c0) * (d_1 / (w / d_1))) / (d * ((w * h) * d))
else if (m <= 4.6d0) then
tmp = 0.0d0
else
tmp = (t_0 * ((c0 * c0) / h)) / (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 t_0 = (d / D) * (d / D);
double tmp;
if (M <= 4e-217) {
tmp = 0.0;
} else if (M <= 7e-189) {
tmp = (t_0 * (c0 * c0)) / (h * (w * w));
} else if (M <= 2.9e-154) {
tmp = 0.0;
} else if (M <= 6.1e-58) {
tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D));
} else if (M <= 4.6) {
tmp = 0.0;
} else {
tmp = (t_0 * ((c0 * c0) / h)) / (w * w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) tmp = 0 if M <= 4e-217: tmp = 0.0 elif M <= 7e-189: tmp = (t_0 * (c0 * c0)) / (h * (w * w)) elif M <= 2.9e-154: tmp = 0.0 elif M <= 6.1e-58: tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D)) elif M <= 4.6: tmp = 0.0 else: tmp = (t_0 * ((c0 * c0) / h)) / (w * w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) tmp = 0.0 if (M <= 4e-217) tmp = 0.0; elseif (M <= 7e-189) tmp = Float64(Float64(t_0 * Float64(c0 * c0)) / Float64(h * Float64(w * w))); elseif (M <= 2.9e-154) tmp = 0.0; elseif (M <= 6.1e-58) tmp = Float64(Float64(Float64(c0 * c0) * Float64(d / Float64(w / d))) / Float64(D * Float64(Float64(w * h) * D))); elseif (M <= 4.6) tmp = 0.0; else tmp = Float64(Float64(t_0 * Float64(Float64(c0 * c0) / h)) / Float64(w * w)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); tmp = 0.0; if (M <= 4e-217) tmp = 0.0; elseif (M <= 7e-189) tmp = (t_0 * (c0 * c0)) / (h * (w * w)); elseif (M <= 2.9e-154) tmp = 0.0; elseif (M <= 6.1e-58) tmp = ((c0 * c0) * (d / (w / d))) / (D * ((w * h) * D)); elseif (M <= 4.6) tmp = 0.0; else tmp = (t_0 * ((c0 * c0) / h)) / (w * w); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 4e-217], 0.0, If[LessEqual[M, 7e-189], N[(N[(t$95$0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.9e-154], 0.0, If[LessEqual[M, 6.1e-58], N[(N[(N[(c0 * c0), $MachinePrecision] * N[(d / N[(w / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 4.6], 0.0, N[(N[(t$95$0 * N[(N[(c0 * c0), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
\mathbf{if}\;M \leq 4 \cdot 10^{-217}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 7 \cdot 10^{-189}:\\
\;\;\;\;\frac{t_0 \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\\
\mathbf{elif}\;M \leq 2.9 \cdot 10^{-154}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 6.1 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(c0 \cdot c0\right) \cdot \frac{d}{\frac{w}{d}}}{D \cdot \left(\left(w \cdot h\right) \cdot D\right)}\\
\mathbf{elif}\;M \leq 4.6:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot \frac{c0 \cdot c0}{h}}{w \cdot w}\\
\end{array}
\end{array}
if M < 4.00000000000000033e-217 or 7.0000000000000003e-189 < M < 2.9e-154 or 6.1000000000000003e-58 < M < 4.5999999999999996Initial program 22.0%
times-frac20.8%
fma-def20.3%
associate-/r*19.7%
difference-of-squares20.9%
Simplified28.2%
Taylor expanded in c0 around -inf 5.0%
associate-*r*5.0%
distribute-rgt1-in5.0%
metadata-eval5.0%
mul0-lft35.8%
metadata-eval35.8%
mul0-lft5.0%
metadata-eval5.0%
distribute-lft1-in5.0%
*-commutative5.0%
distribute-lft1-in5.0%
metadata-eval5.0%
mul0-lft35.8%
Simplified35.8%
Taylor expanded in c0 around 0 41.4%
if 4.00000000000000033e-217 < M < 7.0000000000000003e-189Initial program 47.6%
times-frac47.7%
fma-def47.7%
associate-/r*47.8%
difference-of-squares47.8%
Simplified64.0%
fma-udef64.0%
associate-/l/54.7%
frac-times64.1%
pow264.1%
fma-udef64.1%
associate-/l/54.9%
times-frac48.0%
associate-/l/48.0%
times-frac47.8%
Applied egg-rr64.1%
Taylor expanded in c0 around inf 46.5%
times-frac46.5%
unpow246.5%
unpow246.5%
unpow246.5%
*-commutative46.5%
unpow246.5%
Simplified46.5%
associate-*r/54.3%
times-frac72.6%
Applied egg-rr72.6%
if 2.9e-154 < M < 6.1000000000000003e-58Initial program 43.0%
times-frac28.8%
fma-def28.9%
associate-/r*28.9%
difference-of-squares28.9%
Simplified33.7%
fma-udef33.6%
associate-/l/28.8%
frac-times33.7%
pow233.7%
fma-udef33.7%
associate-/l/28.8%
times-frac28.8%
associate-/l/28.8%
times-frac28.8%
Applied egg-rr33.9%
Taylor expanded in c0 around inf 47.8%
associate-*r/47.8%
unpow247.8%
associate-*l*52.6%
unpow252.6%
associate-*l*57.3%
Simplified57.3%
associate-*r/57.4%
associate-/r*57.4%
Applied egg-rr57.4%
Taylor expanded in c0 around 0 47.8%
unpow247.8%
associate-/l*52.6%
associate-/r/52.6%
unpow252.6%
associate-/l*57.3%
Simplified57.3%
if 4.5999999999999996 < M Initial program 16.7%
times-frac16.7%
fma-def16.7%
associate-/r*16.7%
difference-of-squares31.5%
Simplified40.8%
fma-udef40.8%
associate-/l/31.5%
frac-times40.8%
pow240.8%
fma-udef40.8%
associate-/l/31.5%
times-frac31.5%
associate-/l/31.5%
times-frac31.5%
Applied egg-rr24.4%
Taylor expanded in c0 around inf 34.2%
associate-*r/34.2%
unpow234.2%
associate-*l*38.0%
unpow238.0%
associate-*l*43.5%
Simplified43.5%
Taylor expanded in c0 around 0 24.8%
unpow224.8%
times-frac26.7%
unpow226.7%
associate-/r*35.9%
associate-*l/39.7%
associate-*r/43.4%
associate-/r*49.1%
unpow249.1%
associate-*r/53.1%
unpow253.1%
associate-*l/51.0%
*-commutative51.0%
unpow251.0%
associate-*r/49.1%
associate-*l/50.9%
Simplified49.0%
Final simplification45.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= w -5e+59)
0.0
(if (or (<= w -1.56e-105) (and (not (<= w -1.03e-159)) (<= w 6.6e-25)))
(* (* (/ d D) (/ d D)) (/ (* c0 c0) (* w (* w h))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (w <= -5e+59) {
tmp = 0.0;
} else if ((w <= -1.56e-105) || (!(w <= -1.03e-159) && (w <= 6.6e-25))) {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (w * (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (w <= (-5d+59)) then
tmp = 0.0d0
else if ((w <= (-1.56d-105)) .or. (.not. (w <= (-1.03d-159))) .and. (w <= 6.6d-25)) then
tmp = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (w * (w * h)))
else
tmp = 0.0d0
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 (w <= -5e+59) {
tmp = 0.0;
} else if ((w <= -1.56e-105) || (!(w <= -1.03e-159) && (w <= 6.6e-25))) {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (w * (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if w <= -5e+59: tmp = 0.0 elif (w <= -1.56e-105) or (not (w <= -1.03e-159) and (w <= 6.6e-25)): tmp = ((d / D) * (d / D)) * ((c0 * c0) / (w * (w * h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (w <= -5e+59) tmp = 0.0; elseif ((w <= -1.56e-105) || (!(w <= -1.03e-159) && (w <= 6.6e-25))) tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(w * Float64(w * h)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (w <= -5e+59) tmp = 0.0; elseif ((w <= -1.56e-105) || (~((w <= -1.03e-159)) && (w <= 6.6e-25))) tmp = ((d / D) * (d / D)) * ((c0 * c0) / (w * (w * h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[w, -5e+59], 0.0, If[Or[LessEqual[w, -1.56e-105], And[N[Not[LessEqual[w, -1.03e-159]], $MachinePrecision], LessEqual[w, 6.6e-25]]], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -5 \cdot 10^{+59}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -1.56 \cdot 10^{-105} \lor \neg \left(w \leq -1.03 \cdot 10^{-159}\right) \land w \leq 6.6 \cdot 10^{-25}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{w \cdot \left(w \cdot h\right)}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -4.9999999999999997e59 or -1.56000000000000004e-105 < w < -1.02999999999999994e-159 or 6.5999999999999997e-25 < w Initial program 18.8%
times-frac14.5%
fma-def13.6%
associate-/r*12.8%
difference-of-squares12.8%
Simplified23.1%
Taylor expanded in c0 around -inf 8.4%
associate-*r*8.4%
distribute-rgt1-in8.4%
metadata-eval8.4%
mul0-lft49.2%
metadata-eval49.2%
mul0-lft9.3%
metadata-eval9.3%
distribute-lft1-in9.3%
*-commutative9.3%
distribute-lft1-in9.3%
metadata-eval9.3%
mul0-lft49.2%
Simplified49.2%
Taylor expanded in c0 around 0 51.1%
if -4.9999999999999997e59 < w < -1.56000000000000004e-105 or -1.02999999999999994e-159 < w < 6.5999999999999997e-25Initial program 27.7%
times-frac27.7%
fma-def27.7%
associate-/r*27.7%
difference-of-squares34.7%
Simplified40.7%
fma-udef40.7%
associate-/l/36.9%
frac-times41.2%
pow241.2%
fma-udef41.2%
associate-/l/36.9%
times-frac34.7%
associate-/l/34.7%
times-frac34.7%
Applied egg-rr37.7%
Taylor expanded in c0 around inf 33.7%
times-frac35.8%
unpow235.8%
unpow235.8%
unpow235.8%
*-commutative35.8%
unpow235.8%
Simplified35.8%
Taylor expanded in h around 0 35.8%
*-commutative35.8%
unpow235.8%
associate-*r*35.8%
*-commutative35.8%
*-commutative35.8%
Simplified35.8%
times-frac46.4%
Applied egg-rr46.4%
Final simplification48.5%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= w -3.4e+81)
0.0
(if (or (<= w -1.08e-102) (and (not (<= w -3.1e-134)) (<= w 4.4e-25)))
(/ (* (* (/ d D) (/ d D)) (* c0 c0)) (* h (* w w)))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (w <= -3.4e+81) {
tmp = 0.0;
} else if ((w <= -1.08e-102) || (!(w <= -3.1e-134) && (w <= 4.4e-25))) {
tmp = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (w <= (-3.4d+81)) then
tmp = 0.0d0
else if ((w <= (-1.08d-102)) .or. (.not. (w <= (-3.1d-134))) .and. (w <= 4.4d-25)) then
tmp = (((d_1 / d) * (d_1 / d)) * (c0 * c0)) / (h * (w * w))
else
tmp = 0.0d0
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 (w <= -3.4e+81) {
tmp = 0.0;
} else if ((w <= -1.08e-102) || (!(w <= -3.1e-134) && (w <= 4.4e-25))) {
tmp = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if w <= -3.4e+81: tmp = 0.0 elif (w <= -1.08e-102) or (not (w <= -3.1e-134) and (w <= 4.4e-25)): tmp = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (w <= -3.4e+81) tmp = 0.0; elseif ((w <= -1.08e-102) || (!(w <= -3.1e-134) && (w <= 4.4e-25))) tmp = Float64(Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 * c0)) / Float64(h * Float64(w * w))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (w <= -3.4e+81) tmp = 0.0; elseif ((w <= -1.08e-102) || (~((w <= -3.1e-134)) && (w <= 4.4e-25))) tmp = (((d / D) * (d / D)) * (c0 * c0)) / (h * (w * w)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[w, -3.4e+81], 0.0, If[Or[LessEqual[w, -1.08e-102], And[N[Not[LessEqual[w, -3.1e-134]], $MachinePrecision], LessEqual[w, 4.4e-25]]], N[(N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3.4 \cdot 10^{+81}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -1.08 \cdot 10^{-102} \lor \neg \left(w \leq -3.1 \cdot 10^{-134}\right) \land w \leq 4.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -3.40000000000000003e81 or -1.08000000000000004e-102 < w < -3.10000000000000006e-134 or 4.4000000000000004e-25 < w Initial program 18.8%
times-frac13.7%
fma-def12.8%
associate-/r*12.8%
difference-of-squares12.8%
Simplified20.7%
Taylor expanded in c0 around -inf 8.7%
associate-*r*8.7%
distribute-rgt1-in8.7%
metadata-eval8.7%
mul0-lft54.0%
metadata-eval54.0%
mul0-lft9.7%
metadata-eval9.7%
distribute-lft1-in9.7%
*-commutative9.7%
distribute-lft1-in9.7%
metadata-eval9.7%
mul0-lft54.0%
Simplified54.0%
Taylor expanded in c0 around 0 54.0%
if -3.40000000000000003e81 < w < -1.08000000000000004e-102 or -3.10000000000000006e-134 < w < 4.4000000000000004e-25Initial program 26.8%
times-frac26.8%
fma-def26.8%
associate-/r*26.2%
difference-of-squares32.5%
Simplified40.4%
fma-udef41.0%
associate-/l/34.5%
frac-times41.5%
pow241.5%
fma-udef41.5%
associate-/l/34.5%
times-frac32.5%
associate-/l/32.5%
times-frac32.5%
Applied egg-rr38.3%
Taylor expanded in c0 around inf 31.6%
times-frac32.9%
unpow232.9%
unpow232.9%
unpow232.9%
*-commutative32.9%
unpow232.9%
Simplified32.9%
associate-*r/33.5%
times-frac46.1%
Applied egg-rr46.1%
Final simplification49.1%
(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}
Initial program 23.7%
times-frac21.8%
fma-def21.4%
associate-/r*21.0%
difference-of-squares24.9%
Simplified32.9%
Taylor expanded in c0 around -inf 3.9%
associate-*r*3.9%
distribute-rgt1-in3.9%
metadata-eval3.9%
mul0-lft30.3%
metadata-eval30.3%
mul0-lft4.3%
metadata-eval4.3%
distribute-lft1-in4.3%
*-commutative4.3%
distribute-lft1-in4.3%
metadata-eval4.3%
mul0-lft30.3%
Simplified30.3%
Taylor expanded in c0 around 0 34.1%
Final simplification34.1%
herbie shell --seed 2023230
(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))))))