
(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)
(* t_0 (* 2.0 (/ (* d (* c0 d)) (* D (* w (* h D))))))
(* 0.25 (/ (* h (* M M)) (pow (/ d D) 2.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 = t_0 * (2.0 * ((d * (c0 * d)) / (D * (w * (h * D)))));
} else {
tmp = 0.25 * ((h * (M * M)) / pow((d / D), 2.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 = t_0 * (2.0 * ((d * (c0 * d)) / (D * (w * (h * D)))));
} else {
tmp = 0.25 * ((h * (M * M)) / Math.pow((d / D), 2.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 = t_0 * (2.0 * ((d * (c0 * d)) / (D * (w * (h * D))))) else: tmp = 0.25 * ((h * (M * M)) / math.pow((d / D), 2.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(t_0 * Float64(2.0 * Float64(Float64(d * Float64(c0 * d)) / Float64(D * Float64(w * Float64(h * D)))))); else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / (Float64(d / D) ^ 2.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 = t_0 * (2.0 * ((d * (c0 * d)) / (D * (w * (h * D))))); else tmp = 0.25 * ((h * (M * M)) / ((d / D) ^ 2.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[(t$95$0 * N[(2.0 * N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / N[(D * N[(w * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(c0 \cdot d\right)}{D \cdot \left(w \cdot \left(h \cdot D\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}\\
\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 70.0%
times-frac63.9%
fma-def63.9%
associate-/r*64.1%
difference-of-squares64.1%
Simplified66.1%
Taylor expanded in c0 around inf 73.5%
pow173.5%
pow273.5%
Applied egg-rr73.5%
unpow173.5%
associate-*l*75.2%
*-commutative75.2%
associate-*l*75.1%
Simplified75.1%
pow175.1%
pow275.1%
Applied egg-rr75.1%
unpow175.1%
associate-*l*78.5%
Simplified78.5%
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.6%
associate-/r*0.6%
difference-of-squares13.5%
Simplified20.0%
fma-udef20.0%
associate-/l/14.7%
frac-times19.0%
pow219.0%
Applied egg-rr19.0%
Taylor expanded in c0 around -inf 3.5%
Simplified29.7%
Taylor expanded in c0 around 0 40.6%
*-commutative40.6%
unpow240.6%
*-commutative40.6%
unpow240.6%
associate-/l*38.2%
*-commutative38.2%
unpow238.2%
times-frac50.8%
unpow250.8%
Simplified50.8%
Final simplification59.9%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= w -2.2e+216)
0.0
(if (or (<= w -1.8e+147)
(and (not (<= w -1.65e+96))
(or (<= w -1.8e-92)
(and (not (<= w -1.5e-174)) (<= w 1.85e+93)))))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* (/ d D) (/ d D)) (/ (/ c0 w) h))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (w <= -2.2e+216) {
tmp = 0.0;
} else if ((w <= -1.8e+147) || (!(w <= -1.65e+96) && ((w <= -1.8e-92) || (!(w <= -1.5e-174) && (w <= 1.85e+93))))) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / 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 <= (-2.2d+216)) then
tmp = 0.0d0
else if ((w <= (-1.8d+147)) .or. (.not. (w <= (-1.65d+96))) .and. (w <= (-1.8d-92)) .or. (.not. (w <= (-1.5d-174))) .and. (w <= 1.85d+93)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 / d) * (d_1 / d)) * ((c0 / 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 <= -2.2e+216) {
tmp = 0.0;
} else if ((w <= -1.8e+147) || (!(w <= -1.65e+96) && ((w <= -1.8e-92) || (!(w <= -1.5e-174) && (w <= 1.85e+93))))) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if w <= -2.2e+216: tmp = 0.0 elif (w <= -1.8e+147) or (not (w <= -1.65e+96) and ((w <= -1.8e-92) or (not (w <= -1.5e-174) and (w <= 1.85e+93)))): tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (w <= -2.2e+216) tmp = 0.0; elseif ((w <= -1.8e+147) || (!(w <= -1.65e+96) && ((w <= -1.8e-92) || (!(w <= -1.5e-174) && (w <= 1.85e+93))))) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 / 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 <= -2.2e+216) tmp = 0.0; elseif ((w <= -1.8e+147) || (~((w <= -1.65e+96)) && ((w <= -1.8e-92) || (~((w <= -1.5e-174)) && (w <= 1.85e+93))))) tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[w, -2.2e+216], 0.0, If[Or[LessEqual[w, -1.8e+147], And[N[Not[LessEqual[w, -1.65e+96]], $MachinePrecision], Or[LessEqual[w, -1.8e-92], And[N[Not[LessEqual[w, -1.5e-174]], $MachinePrecision], LessEqual[w, 1.85e+93]]]]], 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 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.2 \cdot 10^{+216}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -1.8 \cdot 10^{+147} \lor \neg \left(w \leq -1.65 \cdot 10^{+96}\right) \land \left(w \leq -1.8 \cdot 10^{-92} \lor \neg \left(w \leq -1.5 \cdot 10^{-174}\right) \land w \leq 1.85 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.2e216 or -1.8000000000000001e147 < w < -1.64999999999999992e96 or -1.80000000000000008e-92 < w < -1.50000000000000011e-174 or 1.84999999999999994e93 < w Initial program 12.4%
times-frac6.2%
fma-def6.2%
associate-/r*6.2%
difference-of-squares14.0%
Simplified17.1%
Taylor expanded in c0 around -inf 9.6%
associate-*r*9.6%
distribute-rgt1-in9.6%
metadata-eval9.6%
mul0-lft51.7%
metadata-eval51.7%
mul0-lft9.5%
metadata-eval9.5%
distribute-lft1-in9.5%
*-commutative9.5%
distribute-lft1-in9.5%
metadata-eval9.5%
mul0-lft51.7%
Simplified51.7%
Taylor expanded in c0 around 0 53.2%
if -2.2e216 < w < -1.8000000000000001e147 or -1.64999999999999992e96 < w < -1.80000000000000008e-92 or -1.50000000000000011e-174 < w < 1.84999999999999994e93Initial program 26.7%
times-frac26.1%
fma-def26.6%
associate-/r*26.7%
difference-of-squares35.7%
Simplified41.4%
Taylor expanded in c0 around inf 41.3%
*-commutative41.3%
*-commutative41.3%
unpow241.3%
associate-/l*41.4%
unpow241.4%
unpow241.4%
unpow241.4%
associate-/l*42.0%
unpow242.0%
unpow242.0%
Simplified42.0%
div-inv42.0%
times-frac52.3%
unpow252.3%
Applied egg-rr52.3%
associate-*r/52.3%
*-rgt-identity52.3%
associate-/r/52.7%
*-commutative52.7%
associate-/r*54.8%
Simplified54.8%
unpow254.8%
Applied egg-rr54.8%
Final simplification54.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* t_1 (* 2.0 (* t_0 (/ (/ c0 w) h))))))
(if (<= w -6.2e+215)
0.0
(if (<= w -1.4e+145)
t_2
(if (<= w -9.2e+95)
0.0
(if (<= w -4.9e-101)
(* t_1 (* 2.0 (/ c0 (/ (* w h) t_0))))
(if (<= w -1.6e-175) 0.0 (if (<= w 1.2e+93) t_2 0.0))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * (t_0 * ((c0 / w) / h)));
double tmp;
if (w <= -6.2e+215) {
tmp = 0.0;
} else if (w <= -1.4e+145) {
tmp = t_2;
} else if (w <= -9.2e+95) {
tmp = 0.0;
} else if (w <= -4.9e-101) {
tmp = t_1 * (2.0 * (c0 / ((w * h) / t_0)));
} else if (w <= -1.6e-175) {
tmp = 0.0;
} else if (w <= 1.2e+93) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = c0 / (2.0d0 * w)
t_2 = t_1 * (2.0d0 * (t_0 * ((c0 / w) / h)))
if (w <= (-6.2d+215)) then
tmp = 0.0d0
else if (w <= (-1.4d+145)) then
tmp = t_2
else if (w <= (-9.2d+95)) then
tmp = 0.0d0
else if (w <= (-4.9d-101)) then
tmp = t_1 * (2.0d0 * (c0 / ((w * h) / t_0)))
else if (w <= (-1.6d-175)) then
tmp = 0.0d0
else if (w <= 1.2d+93) then
tmp = t_2
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);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * (t_0 * ((c0 / w) / h)));
double tmp;
if (w <= -6.2e+215) {
tmp = 0.0;
} else if (w <= -1.4e+145) {
tmp = t_2;
} else if (w <= -9.2e+95) {
tmp = 0.0;
} else if (w <= -4.9e-101) {
tmp = t_1 * (2.0 * (c0 / ((w * h) / t_0)));
} else if (w <= -1.6e-175) {
tmp = 0.0;
} else if (w <= 1.2e+93) {
tmp = t_2;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = c0 / (2.0 * w) t_2 = t_1 * (2.0 * (t_0 * ((c0 / w) / h))) tmp = 0 if w <= -6.2e+215: tmp = 0.0 elif w <= -1.4e+145: tmp = t_2 elif w <= -9.2e+95: tmp = 0.0 elif w <= -4.9e-101: tmp = t_1 * (2.0 * (c0 / ((w * h) / t_0))) elif w <= -1.6e-175: tmp = 0.0 elif w <= 1.2e+93: tmp = t_2 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / w) / h)))) tmp = 0.0 if (w <= -6.2e+215) tmp = 0.0; elseif (w <= -1.4e+145) tmp = t_2; elseif (w <= -9.2e+95) tmp = 0.0; elseif (w <= -4.9e-101) tmp = Float64(t_1 * Float64(2.0 * Float64(c0 / Float64(Float64(w * h) / t_0)))); elseif (w <= -1.6e-175) tmp = 0.0; elseif (w <= 1.2e+93) tmp = t_2; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = c0 / (2.0 * w); t_2 = t_1 * (2.0 * (t_0 * ((c0 / w) / h))); tmp = 0.0; if (w <= -6.2e+215) tmp = 0.0; elseif (w <= -1.4e+145) tmp = t_2; elseif (w <= -9.2e+95) tmp = 0.0; elseif (w <= -4.9e-101) tmp = t_1 * (2.0 * (c0 / ((w * h) / t_0))); elseif (w <= -1.6e-175) tmp = 0.0; elseif (w <= 1.2e+93) tmp = t_2; else tmp = 0.0; 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]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -6.2e+215], 0.0, If[LessEqual[w, -1.4e+145], t$95$2, If[LessEqual[w, -9.2e+95], 0.0, If[LessEqual[w, -4.9e-101], N[(t$95$1 * N[(2.0 * N[(c0 / N[(N[(w * h), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, -1.6e-175], 0.0, If[LessEqual[w, 1.2e+93], t$95$2, 0.0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\mathbf{if}\;w \leq -6.2 \cdot 10^{+215}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -1.4 \cdot 10^{+145}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;w \leq -9.2 \cdot 10^{+95}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -4.9 \cdot 10^{-101}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \frac{c0}{\frac{w \cdot h}{t_0}}\right)\\
\mathbf{elif}\;w \leq -1.6 \cdot 10^{-175}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -6.1999999999999998e215 or -1.3999999999999999e145 < w < -9.19999999999999989e95 or -4.9e-101 < w < -1.6e-175 or 1.20000000000000005e93 < w Initial program 11.0%
times-frac6.3%
fma-def6.3%
associate-/r*6.3%
difference-of-squares14.2%
Simplified17.4%
Taylor expanded in c0 around -inf 9.7%
associate-*r*9.7%
distribute-rgt1-in9.7%
metadata-eval9.7%
mul0-lft52.4%
metadata-eval52.4%
mul0-lft9.7%
metadata-eval9.7%
distribute-lft1-in9.7%
*-commutative9.7%
distribute-lft1-in9.7%
metadata-eval9.7%
mul0-lft52.4%
Simplified52.4%
Taylor expanded in c0 around 0 54.0%
if -6.1999999999999998e215 < w < -1.3999999999999999e145 or -1.6e-175 < w < 1.20000000000000005e93Initial program 26.6%
times-frac25.9%
fma-def26.6%
associate-/r*26.7%
difference-of-squares34.5%
Simplified42.1%
Taylor expanded in c0 around inf 40.6%
*-commutative40.6%
*-commutative40.6%
unpow240.6%
associate-/l*39.9%
unpow239.9%
unpow239.9%
unpow239.9%
associate-/l*40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
div-inv40.6%
times-frac51.7%
unpow251.7%
Applied egg-rr51.7%
associate-*r/51.7%
*-rgt-identity51.7%
associate-/r/51.6%
*-commutative51.6%
associate-/r*54.4%
Simplified54.4%
unpow254.4%
Applied egg-rr54.4%
if -9.19999999999999989e95 < w < -4.9e-101Initial program 28.2%
times-frac26.2%
fma-def26.2%
associate-/r*26.2%
difference-of-squares38.3%
Simplified38.4%
Taylor expanded in c0 around inf 44.8%
*-commutative44.8%
*-commutative44.8%
unpow244.8%
associate-/l*46.8%
unpow246.8%
unpow246.8%
unpow246.8%
associate-/l*46.9%
unpow246.9%
unpow246.9%
Simplified46.9%
times-frac48.8%
Applied egg-rr55.0%
Final simplification54.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
(if (<= w -1.6e+71)
0.0
(if (<= w -3.1e-131)
t_0
(if (<= w -1.38e-202)
(* 0.25 (/ (* (* D D) (* h (* M M))) (* d d)))
(if (<= w 8.6e+70) 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 <= -1.6e+71) {
tmp = 0.0;
} else if (w <= -3.1e-131) {
tmp = t_0;
} else if (w <= -1.38e-202) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else if (w <= 8.6e+70) {
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 <= (-1.6d+71)) then
tmp = 0.0d0
else if (w <= (-3.1d-131)) then
tmp = t_0
else if (w <= (-1.38d-202)) then
tmp = 0.25d0 * (((d * d) * (h * (m * m))) / (d_1 * d_1))
else if (w <= 8.6d+70) 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 <= -1.6e+71) {
tmp = 0.0;
} else if (w <= -3.1e-131) {
tmp = t_0;
} else if (w <= -1.38e-202) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else if (w <= 8.6e+70) {
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 <= -1.6e+71: tmp = 0.0 elif w <= -3.1e-131: tmp = t_0 elif w <= -1.38e-202: tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)) elif w <= 8.6e+70: tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))) tmp = 0.0 if (w <= -1.6e+71) tmp = 0.0; elseif (w <= -3.1e-131) tmp = t_0; elseif (w <= -1.38e-202) tmp = Float64(0.25 * Float64(Float64(Float64(D * D) * Float64(h * Float64(M * M))) / Float64(d * d))); elseif (w <= 8.6e+70) 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 <= -1.6e+71) tmp = 0.0; elseif (w <= -3.1e-131) tmp = t_0; elseif (w <= -1.38e-202) tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)); elseif (w <= 8.6e+70) 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[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.6e+71], 0.0, If[LessEqual[w, -3.1e-131], t$95$0, If[LessEqual[w, -1.38e-202], N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 8.6e+70], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;w \leq -1.6 \cdot 10^{+71}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -3.1 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -1.38 \cdot 10^{-202}:\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{elif}\;w \leq 8.6 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.60000000000000012e71 or 8.6000000000000002e70 < w Initial program 15.8%
times-frac10.2%
fma-def10.2%
associate-/r*10.2%
difference-of-squares15.9%
Simplified20.2%
Taylor expanded in c0 around -inf 11.9%
associate-*r*11.9%
distribute-rgt1-in11.9%
metadata-eval11.9%
mul0-lft42.5%
metadata-eval42.5%
mul0-lft11.8%
metadata-eval11.8%
distribute-lft1-in11.8%
*-commutative11.8%
distribute-lft1-in11.8%
metadata-eval11.8%
mul0-lft42.5%
Simplified42.5%
Taylor expanded in c0 around 0 42.5%
if -1.60000000000000012e71 < w < -3.10000000000000021e-131 or -1.38e-202 < w < 8.6000000000000002e70Initial program 27.0%
times-frac26.4%
fma-def27.0%
associate-/r*27.1%
difference-of-squares36.6%
Simplified42.5%
Taylor expanded in c0 around inf 42.5%
*-commutative42.5%
*-commutative42.5%
unpow242.5%
associate-/l*42.6%
unpow242.6%
unpow242.6%
unpow242.6%
associate-/l*42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
Taylor expanded in c0 around 0 35.7%
times-frac37.4%
unpow237.4%
unpow237.4%
unpow237.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
times-frac46.0%
Applied egg-rr46.0%
if -3.10000000000000021e-131 < w < -1.38e-202Initial program 12.5%
times-frac12.5%
fma-def12.5%
associate-/r*12.5%
difference-of-squares25.0%
Simplified25.0%
fma-udef25.0%
associate-/l/25.0%
frac-times25.0%
pow225.0%
Applied egg-rr25.0%
Taylor expanded in c0 around -inf 6.3%
Simplified50.2%
Taylor expanded in c0 around 0 62.7%
*-commutative62.7%
unpow262.7%
*-commutative62.7%
*-commutative62.7%
unpow262.7%
unpow262.7%
Simplified62.7%
Final simplification46.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
(if (<= c0 -2.1e-104)
t_0
(if (<= c0 6e-159)
0.0
(if (<= c0 1.6e+32)
(/ (* d d) (/ (* h (* (* w D) (* w D))) (* c0 c0)))
(if (<= c0 1.95e+74)
(* 0.25 (/ (* (* D D) (* h (* M M))) (* d d)))
t_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 (c0 <= -2.1e-104) {
tmp = t_0;
} else if (c0 <= 6e-159) {
tmp = 0.0;
} else if (c0 <= 1.6e+32) {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
} else if (c0 <= 1.95e+74) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
if (c0 <= (-2.1d-104)) then
tmp = t_0
else if (c0 <= 6d-159) then
tmp = 0.0d0
else if (c0 <= 1.6d+32) then
tmp = (d_1 * d_1) / ((h * ((w * d) * (w * d))) / (c0 * c0))
else if (c0 <= 1.95d+74) then
tmp = 0.25d0 * (((d * d) * (h * (m * m))) / (d_1 * d_1))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
double tmp;
if (c0 <= -2.1e-104) {
tmp = t_0;
} else if (c0 <= 6e-159) {
tmp = 0.0;
} else if (c0 <= 1.6e+32) {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
} else if (c0 <= 1.95e+74) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else {
tmp = t_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 c0 <= -2.1e-104: tmp = t_0 elif c0 <= 6e-159: tmp = 0.0 elif c0 <= 1.6e+32: tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)) elif c0 <= 1.95e+74: tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)) else: tmp = t_0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))) tmp = 0.0 if (c0 <= -2.1e-104) tmp = t_0; elseif (c0 <= 6e-159) tmp = 0.0; elseif (c0 <= 1.6e+32) tmp = Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(w * D) * Float64(w * D))) / Float64(c0 * c0))); elseif (c0 <= 1.95e+74) tmp = Float64(0.25 * Float64(Float64(Float64(D * D) * Float64(h * Float64(M * M))) / Float64(d * d))); else tmp = t_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 (c0 <= -2.1e-104) tmp = t_0; elseif (c0 <= 6e-159) tmp = 0.0; elseif (c0 <= 1.6e+32) tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)); elseif (c0 <= 1.95e+74) tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)); else tmp = t_0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.1e-104], t$95$0, If[LessEqual[c0, 6e-159], 0.0, If[LessEqual[c0, 1.6e+32], N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(w * D), $MachinePrecision] * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.95e+74], N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;c0 \leq -2.1 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq 6 \cdot 10^{-159}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq 1.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\
\mathbf{elif}\;c0 \leq 1.95 \cdot 10^{+74}:\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if c0 < -2.09999999999999999e-104 or 1.95000000000000004e74 < c0 Initial program 28.0%
times-frac26.7%
fma-def27.3%
associate-/r*27.4%
difference-of-squares35.8%
Simplified40.9%
Taylor expanded in c0 around inf 40.8%
*-commutative40.8%
*-commutative40.8%
unpow240.8%
associate-/l*41.5%
unpow241.5%
unpow241.5%
unpow241.5%
associate-/l*42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in c0 around 0 38.0%
times-frac38.1%
unpow238.1%
unpow238.1%
unpow238.1%
*-commutative38.1%
unpow238.1%
Simplified38.1%
times-frac44.7%
Applied egg-rr44.7%
if -2.09999999999999999e-104 < c0 < 6.00000000000000018e-159Initial program 11.8%
times-frac8.6%
fma-def8.6%
associate-/r*8.6%
difference-of-squares16.8%
Simplified21.8%
Taylor expanded in c0 around -inf 3.4%
associate-*r*3.4%
distribute-rgt1-in3.4%
metadata-eval3.4%
mul0-lft43.0%
metadata-eval43.0%
mul0-lft3.4%
metadata-eval3.4%
distribute-lft1-in3.4%
*-commutative3.4%
distribute-lft1-in3.4%
metadata-eval3.4%
mul0-lft43.0%
Simplified43.0%
Taylor expanded in c0 around 0 43.0%
if 6.00000000000000018e-159 < c0 < 1.5999999999999999e32Initial program 23.2%
times-frac19.8%
fma-def19.8%
associate-/r*19.8%
difference-of-squares32.8%
Simplified39.3%
Taylor expanded in c0 around inf 39.7%
*-commutative39.7%
*-commutative39.7%
unpow239.7%
associate-/l*42.9%
unpow242.9%
unpow242.9%
unpow242.9%
associate-/l*42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
Taylor expanded in c0 around 0 32.8%
associate-/l*39.2%
unpow239.2%
associate-*r*42.5%
unpow242.5%
unpow242.5%
unswap-sqr52.3%
unpow252.3%
Simplified52.3%
if 1.5999999999999999e32 < c0 < 1.95000000000000004e74Initial program 11.1%
times-frac11.3%
fma-def11.3%
associate-/r*11.3%
difference-of-squares11.3%
Simplified11.3%
fma-udef11.3%
associate-/l/11.3%
frac-times11.3%
pow211.3%
Applied egg-rr11.3%
Taylor expanded in c0 around -inf 11.1%
Simplified55.7%
Taylor expanded in c0 around 0 78.0%
*-commutative78.0%
unpow278.0%
*-commutative78.0%
*-commutative78.0%
unpow278.0%
unpow278.0%
Simplified78.0%
Final simplification46.4%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* D D) 0.0)
0.0
(if (<= (* D D) 1e+196)
(* 0.25 (/ (* (* D D) (* h (* M M))) (* d d)))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 0.0) {
tmp = 0.0;
} else if ((D * D) <= 1e+196) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} 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 ((d * d) <= 0.0d0) then
tmp = 0.0d0
else if ((d * d) <= 1d+196) then
tmp = 0.25d0 * (((d * d) * (h * (m * m))) / (d_1 * d_1))
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 ((D * D) <= 0.0) {
tmp = 0.0;
} else if ((D * D) <= 1e+196) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 0.0: tmp = 0.0 elif (D * D) <= 1e+196: tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 0.0) tmp = 0.0; elseif (Float64(D * D) <= 1e+196) tmp = Float64(0.25 * Float64(Float64(Float64(D * D) * Float64(h * Float64(M * M))) / Float64(d * d))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 0.0) tmp = 0.0; elseif ((D * D) <= 1e+196) tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 0.0], 0.0, If[LessEqual[N[(D * D), $MachinePrecision], 1e+196], N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 0:\\
\;\;\;\;0\\
\mathbf{elif}\;D \cdot D \leq 10^{+196}:\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 D D) < 0.0 or 9.9999999999999995e195 < (*.f64 D D) Initial program 17.6%
times-frac16.9%
fma-def16.9%
associate-/r*17.0%
difference-of-squares25.0%
Simplified33.7%
Taylor expanded in c0 around -inf 0.9%
associate-*r*0.9%
distribute-rgt1-in0.9%
metadata-eval0.9%
mul0-lft31.2%
metadata-eval31.2%
mul0-lft0.9%
metadata-eval0.9%
distribute-lft1-in0.9%
*-commutative0.9%
distribute-lft1-in0.9%
metadata-eval0.9%
mul0-lft31.2%
Simplified31.2%
Taylor expanded in c0 around 0 35.1%
if 0.0 < (*.f64 D D) < 9.9999999999999995e195Initial program 29.2%
times-frac25.8%
fma-def26.6%
associate-/r*26.6%
difference-of-squares36.0%
Simplified36.8%
fma-udef36.8%
associate-/l/36.8%
frac-times36.8%
pow236.8%
Applied egg-rr36.8%
Taylor expanded in c0 around -inf 13.5%
Simplified32.4%
Taylor expanded in c0 around 0 44.3%
*-commutative44.3%
unpow244.3%
*-commutative44.3%
*-commutative44.3%
unpow244.3%
unpow244.3%
Simplified44.3%
Final simplification39.4%
(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.0%
times-frac21.0%
fma-def21.4%
associate-/r*21.4%
difference-of-squares30.1%
Simplified35.1%
Taylor expanded in c0 around -inf 4.7%
associate-*r*4.7%
distribute-rgt1-in4.7%
metadata-eval4.7%
mul0-lft28.6%
metadata-eval28.6%
mul0-lft4.6%
metadata-eval4.6%
distribute-lft1-in4.6%
*-commutative4.6%
distribute-lft1-in4.6%
metadata-eval4.6%
mul0-lft28.6%
Simplified28.6%
Taylor expanded in c0 around 0 31.2%
Final simplification31.2%
herbie shell --seed 2023227
(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))))))