
(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 10 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}
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (/ w (* (pow (/ d D) 2.0) (fabs (/ c0 (* w h))))))))
(if (<= M_m 1.05e-217)
t_0
(if (<= M_m 4e-99)
0.0
(if (<= M_m 2.1e-40)
t_0
(/ 1.0 (/ (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)) c0)))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (w / (pow((d / D), 2.0) * fabs((c0 / (w * h)))));
double tmp;
if (M_m <= 1.05e-217) {
tmp = t_0;
} else if (M_m <= 4e-99) {
tmp = 0.0;
} else if (M_m <= 2.1e-40) {
tmp = t_0;
} else {
tmp = 1.0 / ((((w * pow((d / D), -2.0)) / c0) * (w * h)) / c0);
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (w / (((d_1 / d) ** 2.0d0) * abs((c0 / (w * h)))))
if (m_m <= 1.05d-217) then
tmp = t_0
else if (m_m <= 4d-99) then
tmp = 0.0d0
else if (m_m <= 2.1d-40) then
tmp = t_0
else
tmp = 1.0d0 / ((((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h)) / c0)
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (w / (Math.pow((d / D), 2.0) * Math.abs((c0 / (w * h)))));
double tmp;
if (M_m <= 1.05e-217) {
tmp = t_0;
} else if (M_m <= 4e-99) {
tmp = 0.0;
} else if (M_m <= 2.1e-40) {
tmp = t_0;
} else {
tmp = 1.0 / ((((w * Math.pow((d / D), -2.0)) / c0) * (w * h)) / c0);
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (w / (math.pow((d / D), 2.0) * math.fabs((c0 / (w * h))))) tmp = 0 if M_m <= 1.05e-217: tmp = t_0 elif M_m <= 4e-99: tmp = 0.0 elif M_m <= 2.1e-40: tmp = t_0 else: tmp = 1.0 / ((((w * math.pow((d / D), -2.0)) / c0) * (w * h)) / c0) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(w / Float64((Float64(d / D) ^ 2.0) * abs(Float64(c0 / Float64(w * h)))))) tmp = 0.0 if (M_m <= 1.05e-217) tmp = t_0; elseif (M_m <= 4e-99) tmp = 0.0; elseif (M_m <= 2.1e-40) tmp = t_0; else tmp = Float64(1.0 / Float64(Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)) / c0)); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (w / (((d / D) ^ 2.0) * abs((c0 / (w * h))))); tmp = 0.0; if (M_m <= 1.05e-217) tmp = t_0; elseif (M_m <= 4e-99) tmp = 0.0; elseif (M_m <= 2.1e-40) tmp = t_0; else tmp = 1.0 / ((((w * ((d / D) ^ -2.0)) / c0) * (w * h)) / c0); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(w / N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[Abs[N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1.05e-217], t$95$0, If[LessEqual[M$95$m, 4e-99], 0.0, If[LessEqual[M$95$m, 2.1e-40], t$95$0, N[(1.0 / N[(N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \left|\frac{c0}{w \cdot h}\right|}}\\
\mathbf{if}\;M_m \leq 1.05 \cdot 10^{-217}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M_m \leq 4 \cdot 10^{-99}:\\
\;\;\;\;0\\
\mathbf{elif}\;M_m \leq 2.1 \cdot 10^{-40}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\
\end{array}
\end{array}
if M < 1.05e-217 or 4.0000000000000001e-99 < M < 2.10000000000000018e-40Initial program 27.2%
+-commutative27.2%
+-commutative27.2%
times-frac26.6%
fma-neg26.6%
Simplified27.3%
Taylor expanded in c0 around inf 37.3%
*-commutative37.3%
*-commutative37.3%
associate-*r*37.2%
associate-*r/37.3%
associate-*r*37.4%
*-commutative37.4%
*-commutative37.4%
associate-/r*37.5%
unpow237.5%
associate-*r/44.7%
unpow244.7%
associate-/l/47.8%
associate-*r/47.2%
associate-*l/48.4%
unpow248.4%
Simplified48.4%
Applied egg-rr21.4%
expm1-def23.8%
expm1-log1p47.4%
associate-*l*47.4%
associate-*l/46.3%
associate-/l*48.0%
*-commutative48.0%
associate-/l*48.1%
*-commutative48.1%
associate-/l*48.1%
metadata-eval48.1%
Simplified48.1%
add-sqr-sqrt41.9%
pow1/241.9%
pow1/245.6%
pow-prod-down47.8%
pow247.8%
*-commutative47.8%
Applied egg-rr47.8%
unpow1/247.8%
unpow247.8%
rem-sqrt-square52.1%
*-commutative52.1%
Simplified52.1%
if 1.05e-217 < M < 4.0000000000000001e-99Initial program 15.7%
+-commutative15.7%
+-commutative15.7%
times-frac15.7%
fma-neg15.7%
Simplified15.8%
Taylor expanded in c0 around -inf 4.1%
associate-*r*4.1%
neg-mul-14.1%
distribute-lft1-in4.1%
metadata-eval4.1%
mul0-lft45.4%
distribute-lft-neg-in45.4%
distribute-rgt-neg-in45.4%
metadata-eval45.4%
mul0-lft4.1%
metadata-eval4.1%
distribute-lft1-in4.1%
distribute-lft-in4.1%
Simplified45.4%
Taylor expanded in c0 around 0 53.1%
if 2.10000000000000018e-40 < M Initial program 18.5%
+-commutative18.5%
+-commutative18.5%
times-frac18.5%
fma-neg18.5%
Simplified20.0%
Taylor expanded in c0 around inf 43.8%
*-commutative43.8%
*-commutative43.8%
associate-*r*43.8%
associate-*r/44.0%
associate-*r*44.0%
*-commutative44.0%
*-commutative44.0%
associate-/r*45.6%
unpow245.6%
associate-*r/47.3%
unpow247.3%
associate-/l/53.5%
associate-*r/53.6%
associate-*l/53.6%
unpow253.6%
Simplified53.6%
Applied egg-rr22.1%
expm1-def22.1%
expm1-log1p53.6%
associate-*l*53.6%
associate-*l/53.6%
associate-/l*53.6%
*-commutative53.6%
associate-/l*53.6%
*-commutative53.6%
associate-/l*53.6%
metadata-eval53.6%
Simplified53.6%
clear-num53.6%
inv-pow53.6%
/-rgt-identity53.6%
associate-/r*50.4%
associate-/l/53.6%
Applied egg-rr53.6%
unpow-153.6%
associate-/r*54.9%
*-commutative54.9%
Simplified54.9%
associate-/r/55.0%
div-inv55.0%
pow-flip55.0%
metadata-eval55.0%
*-commutative55.0%
Applied egg-rr55.0%
Final simplification52.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* w 2.0)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
INFINITY)
(/ 1.0 (/ (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)) c0))
0.0)))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (w * 2.0)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))))) <= ((double) INFINITY)) {
tmp = 1.0 / ((((w * pow((d / D), -2.0)) / c0) * (w * h)) / c0);
} else {
tmp = 0.0;
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (w * 2.0)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((((w * Math.pow((d / D), -2.0)) / c0) * (w * h)) / c0);
} else {
tmp = 0.0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if ((c0 / (w * 2.0)) * (t_0 + math.sqrt(((t_0 * t_0) - (M_m * M_m))))) <= math.inf: tmp = 1.0 / ((((w * math.pow((d / D), -2.0)) / c0) * (w * h)) / c0) else: tmp = 0.0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(Float64(c0 / Float64(w * 2.0)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))) <= Inf) tmp = Float64(1.0 / Float64(Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)) / c0)); else tmp = 0.0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if (((c0 / (w * 2.0)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))))) <= Inf) tmp = 1.0 / ((((w * ((d / D) ^ -2.0)) / c0) * (w * h)) / c0); else tmp = 0.0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$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[(w * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(1.0 / N[(N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
M_m = \left|M\right|
\\
\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}{w \cdot 2} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M_m \cdot M_m}\right) \leq \infty:\\
\;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\
\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 80.1%
+-commutative80.1%
+-commutative80.1%
times-frac78.8%
fma-neg78.8%
Simplified78.8%
Taylor expanded in c0 around inf 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*r*83.3%
associate-*r/80.8%
associate-*r*82.4%
*-commutative82.4%
*-commutative82.4%
associate-/r*82.3%
unpow282.3%
associate-*r/87.3%
unpow287.3%
associate-/l/87.3%
associate-*r/86.0%
associate-*l/87.3%
unpow287.3%
Simplified87.3%
Applied egg-rr39.0%
expm1-def42.7%
expm1-log1p86.4%
associate-*l*86.4%
associate-*l/83.9%
associate-/l*87.6%
*-commutative87.6%
associate-/l*87.6%
*-commutative87.6%
associate-/l*87.6%
metadata-eval87.6%
Simplified87.6%
clear-num87.6%
inv-pow87.6%
/-rgt-identity87.6%
associate-/r*81.1%
associate-/l/87.6%
Applied egg-rr87.6%
unpow-187.6%
associate-/r*90.0%
*-commutative90.0%
Simplified90.0%
associate-/r/91.3%
div-inv90.9%
pow-flip91.2%
metadata-eval91.2%
*-commutative91.2%
Applied egg-rr91.2%
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%
+-commutative0.0%
+-commutative0.0%
times-frac0.0%
fma-neg0.0%
Simplified1.2%
Taylor expanded in c0 around -inf 1.2%
associate-*r*1.2%
neg-mul-11.2%
distribute-lft1-in1.2%
metadata-eval1.2%
mul0-lft31.8%
distribute-lft-neg-in31.8%
distribute-rgt-neg-in31.8%
metadata-eval31.8%
mul0-lft1.2%
metadata-eval1.2%
distribute-lft1-in1.2%
distribute-lft-in1.2%
Simplified31.8%
Taylor expanded in c0 around 0 36.0%
Final simplification52.4%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(if (<= w -1.6e+49)
0.0
(if (or (<= w 7.2e-173) (and (not (<= w 3.8e-154)) (<= w 4.4e+180)))
(* (/ c0 w) (* (pow (/ d D) 2.0) (/ c0 (* w h))))
0.0)))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (w <= -1.6e+49) {
tmp = 0.0;
} else if ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180))) {
tmp = (c0 / w) * (pow((d / D), 2.0) * (c0 / (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (w <= (-1.6d+49)) then
tmp = 0.0d0
else if ((w <= 7.2d-173) .or. (.not. (w <= 3.8d-154)) .and. (w <= 4.4d+180)) then
tmp = (c0 / w) * (((d_1 / d) ** 2.0d0) * (c0 / (w * h)))
else
tmp = 0.0d0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (w <= -1.6e+49) {
tmp = 0.0;
} else if ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180))) {
tmp = (c0 / w) * (Math.pow((d / D), 2.0) * (c0 / (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if w <= -1.6e+49: tmp = 0.0 elif (w <= 7.2e-173) or (not (w <= 3.8e-154) and (w <= 4.4e+180)): tmp = (c0 / w) * (math.pow((d / D), 2.0) * (c0 / (w * h))) else: tmp = 0.0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (w <= -1.6e+49) tmp = 0.0; elseif ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180))) tmp = Float64(Float64(c0 / w) * Float64((Float64(d / D) ^ 2.0) * Float64(c0 / Float64(w * h)))); else tmp = 0.0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (w <= -1.6e+49) tmp = 0.0; elseif ((w <= 7.2e-173) || (~((w <= 3.8e-154)) && (w <= 4.4e+180))) tmp = (c0 / w) * (((d / D) ^ 2.0) * (c0 / (w * h))); else tmp = 0.0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[w, -1.6e+49], 0.0, If[Or[LessEqual[w, 7.2e-173], And[N[Not[LessEqual[w, 3.8e-154]], $MachinePrecision], LessEqual[w, 4.4e+180]]], N[(N[(c0 / w), $MachinePrecision] * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.6 \cdot 10^{+49}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq 7.2 \cdot 10^{-173} \lor \neg \left(w \leq 3.8 \cdot 10^{-154}\right) \land w \leq 4.4 \cdot 10^{+180}:\\
\;\;\;\;\frac{c0}{w} \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.60000000000000007e49 or 7.19999999999999943e-173 < w < 3.8000000000000001e-154 or 4.3999999999999999e180 < w Initial program 7.4%
+-commutative7.4%
+-commutative7.4%
times-frac5.6%
fma-neg5.6%
Simplified7.5%
Taylor expanded in c0 around -inf 5.7%
associate-*r*5.7%
neg-mul-15.7%
distribute-lft1-in5.7%
metadata-eval5.7%
mul0-lft49.5%
distribute-lft-neg-in49.5%
distribute-rgt-neg-in49.5%
metadata-eval49.5%
mul0-lft5.7%
metadata-eval5.7%
distribute-lft1-in5.7%
distribute-lft-in5.7%
Simplified49.5%
Taylor expanded in c0 around 0 51.3%
if -1.60000000000000007e49 < w < 7.19999999999999943e-173 or 3.8000000000000001e-154 < w < 4.3999999999999999e180Initial program 28.3%
+-commutative28.3%
+-commutative28.3%
times-frac28.2%
fma-neg28.2%
Simplified28.8%
Taylor expanded in c0 around inf 44.5%
*-commutative44.5%
*-commutative44.5%
associate-*r*44.9%
associate-*r/44.6%
associate-*r*44.2%
*-commutative44.2%
*-commutative44.2%
associate-/r*44.7%
unpow244.7%
associate-*r/51.1%
unpow251.1%
associate-/l/55.7%
associate-*r/55.7%
associate-*l/56.2%
unpow256.2%
Simplified56.2%
Applied egg-rr25.0%
expm1-def26.6%
expm1-log1p55.9%
associate-*l*55.9%
associate-*l/54.5%
associate-/l*56.0%
*-commutative56.0%
associate-/l*56.0%
*-commutative56.0%
associate-/l*56.0%
metadata-eval56.0%
Simplified56.0%
associate-/r/55.9%
/-rgt-identity55.9%
associate-/r*54.3%
associate-/l/55.9%
Applied egg-rr55.9%
Final simplification55.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)))))
(if (<= M_m 1e-217)
t_0
(if (<= M_m 1.56e-97)
0.0
(if (<= M_m 5.2e-76)
(/ c0 (* w (/ (* h (/ w c0)) (pow (/ d D) 2.0))))
(if (<= M_m 1.3e-65) 0.0 t_0))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (((w * pow((d / D), -2.0)) / c0) * (w * h));
double tmp;
if (M_m <= 1e-217) {
tmp = t_0;
} else if (M_m <= 1.56e-97) {
tmp = 0.0;
} else if (M_m <= 5.2e-76) {
tmp = c0 / (w * ((h * (w / c0)) / pow((d / D), 2.0)));
} else if (M_m <= 1.3e-65) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h))
if (m_m <= 1d-217) then
tmp = t_0
else if (m_m <= 1.56d-97) then
tmp = 0.0d0
else if (m_m <= 5.2d-76) then
tmp = c0 / (w * ((h * (w / c0)) / ((d_1 / d) ** 2.0d0)))
else if (m_m <= 1.3d-65) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (((w * Math.pow((d / D), -2.0)) / c0) * (w * h));
double tmp;
if (M_m <= 1e-217) {
tmp = t_0;
} else if (M_m <= 1.56e-97) {
tmp = 0.0;
} else if (M_m <= 5.2e-76) {
tmp = c0 / (w * ((h * (w / c0)) / Math.pow((d / D), 2.0)));
} else if (M_m <= 1.3e-65) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (((w * math.pow((d / D), -2.0)) / c0) * (w * h)) tmp = 0 if M_m <= 1e-217: tmp = t_0 elif M_m <= 1.56e-97: tmp = 0.0 elif M_m <= 5.2e-76: tmp = c0 / (w * ((h * (w / c0)) / math.pow((d / D), 2.0))) elif M_m <= 1.3e-65: tmp = 0.0 else: tmp = t_0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h))) tmp = 0.0 if (M_m <= 1e-217) tmp = t_0; elseif (M_m <= 1.56e-97) tmp = 0.0; elseif (M_m <= 5.2e-76) tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / (Float64(d / D) ^ 2.0)))); elseif (M_m <= 1.3e-65) tmp = 0.0; else tmp = t_0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (((w * ((d / D) ^ -2.0)) / c0) * (w * h)); tmp = 0.0; if (M_m <= 1e-217) tmp = t_0; elseif (M_m <= 1.56e-97) tmp = 0.0; elseif (M_m <= 5.2e-76) tmp = c0 / (w * ((h * (w / c0)) / ((d / D) ^ 2.0))); elseif (M_m <= 1.3e-65) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1e-217], t$95$0, If[LessEqual[M$95$m, 1.56e-97], 0.0, If[LessEqual[M$95$m, 5.2e-76], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.3e-65], 0.0, t$95$0]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\
\mathbf{if}\;M_m \leq 10^{-217}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M_m \leq 1.56 \cdot 10^{-97}:\\
\;\;\;\;0\\
\mathbf{elif}\;M_m \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\
\mathbf{elif}\;M_m \leq 1.3 \cdot 10^{-65}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if M < 1.00000000000000008e-217 or 1.30000000000000005e-65 < M Initial program 25.0%
+-commutative25.0%
+-commutative25.0%
times-frac24.6%
fma-neg24.6%
Simplified25.5%
Taylor expanded in c0 around inf 39.5%
*-commutative39.5%
*-commutative39.5%
associate-*r*39.4%
associate-*r/39.5%
associate-*r*39.6%
*-commutative39.6%
*-commutative39.6%
associate-/r*40.1%
unpow240.1%
associate-*r/45.5%
unpow245.5%
associate-/l/49.6%
associate-*r/49.2%
associate-*l/50.1%
unpow250.1%
Simplified50.1%
Applied egg-rr21.8%
expm1-def23.6%
expm1-log1p49.3%
associate-*l*49.3%
associate-*l/48.5%
associate-/l*49.8%
*-commutative49.8%
associate-/l*49.9%
*-commutative49.9%
associate-/l*49.9%
metadata-eval49.9%
Simplified49.9%
div-inv49.9%
/-rgt-identity49.9%
associate-/r*47.5%
associate-/l/49.9%
Applied egg-rr49.9%
un-div-inv49.9%
associate-/r*51.0%
*-commutative51.0%
associate-/r/51.9%
div-inv51.8%
pow-flip51.9%
metadata-eval51.9%
*-commutative51.9%
Applied egg-rr51.9%
if 1.00000000000000008e-217 < M < 1.55999999999999989e-97 or 5.1999999999999999e-76 < M < 1.30000000000000005e-65Initial program 14.1%
+-commutative14.1%
+-commutative14.1%
times-frac14.1%
fma-neg14.1%
Simplified14.2%
Taylor expanded in c0 around -inf 3.7%
associate-*r*3.7%
neg-mul-13.7%
distribute-lft1-in3.7%
metadata-eval3.7%
mul0-lft50.9%
distribute-lft-neg-in50.9%
distribute-rgt-neg-in50.9%
metadata-eval50.9%
mul0-lft3.7%
metadata-eval3.7%
distribute-lft1-in3.7%
distribute-lft-in3.7%
Simplified50.9%
Taylor expanded in c0 around 0 57.7%
if 1.55999999999999989e-97 < M < 5.1999999999999999e-76Initial program 27.2%
+-commutative27.2%
+-commutative27.2%
times-frac27.2%
fma-neg27.2%
Simplified28.8%
Taylor expanded in c0 around inf 50.0%
*-commutative50.0%
*-commutative50.0%
associate-*r*50.0%
associate-*r/50.0%
associate-*r*50.0%
*-commutative50.0%
*-commutative50.0%
associate-/r*51.2%
unpow251.2%
associate-*r/74.0%
unpow274.0%
associate-/l/74.2%
associate-*r/73.6%
associate-*l/73.6%
unpow273.6%
Simplified73.6%
associate-*r/74.0%
*-commutative74.0%
associate-*l/74.0%
*-commutative74.0%
unpow274.0%
times-frac51.2%
associate-/r*51.2%
associate-/r*51.2%
frac-times27.2%
pow227.2%
Applied egg-rr27.2%
expm1-log1p-u2.2%
expm1-udef2.2%
associate-*r*2.2%
associate-/r*2.2%
times-frac24.2%
associate-/r*24.2%
*-commutative24.2%
associate-/r*24.2%
Applied egg-rr24.2%
expm1-def24.2%
expm1-log1p51.2%
associate-*l*51.2%
associate-/l/51.2%
associate-/r/51.6%
associate-/l*51.6%
*-commutative51.6%
associate-/l*51.6%
associate-/l/51.2%
unpow251.2%
times-frac74.6%
unpow274.6%
metadata-eval74.6%
Simplified74.0%
Final simplification52.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (pow (/ d D) 2.0)))
(if (<= M_m 1.3e-217)
(/ c0 (/ (/ w t_0) (/ c0 (* w h))))
(if (<= M_m 2.05e-97)
0.0
(if (<= M_m 3.6e-76)
(/ c0 (* w (/ (* h (/ w c0)) t_0)))
(if (<= M_m 1.22e-65)
0.0
(/ c0 (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = pow((d / D), 2.0);
double tmp;
if (M_m <= 1.3e-217) {
tmp = c0 / ((w / t_0) / (c0 / (w * h)));
} else if (M_m <= 2.05e-97) {
tmp = 0.0;
} else if (M_m <= 3.6e-76) {
tmp = c0 / (w * ((h * (w / c0)) / t_0));
} else if (M_m <= 1.22e-65) {
tmp = 0.0;
} else {
tmp = c0 / (((w * pow((d / D), -2.0)) / c0) * (w * h));
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 / d) ** 2.0d0
if (m_m <= 1.3d-217) then
tmp = c0 / ((w / t_0) / (c0 / (w * h)))
else if (m_m <= 2.05d-97) then
tmp = 0.0d0
else if (m_m <= 3.6d-76) then
tmp = c0 / (w * ((h * (w / c0)) / t_0))
else if (m_m <= 1.22d-65) then
tmp = 0.0d0
else
tmp = c0 / (((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = Math.pow((d / D), 2.0);
double tmp;
if (M_m <= 1.3e-217) {
tmp = c0 / ((w / t_0) / (c0 / (w * h)));
} else if (M_m <= 2.05e-97) {
tmp = 0.0;
} else if (M_m <= 3.6e-76) {
tmp = c0 / (w * ((h * (w / c0)) / t_0));
} else if (M_m <= 1.22e-65) {
tmp = 0.0;
} else {
tmp = c0 / (((w * Math.pow((d / D), -2.0)) / c0) * (w * h));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = math.pow((d / D), 2.0) tmp = 0 if M_m <= 1.3e-217: tmp = c0 / ((w / t_0) / (c0 / (w * h))) elif M_m <= 2.05e-97: tmp = 0.0 elif M_m <= 3.6e-76: tmp = c0 / (w * ((h * (w / c0)) / t_0)) elif M_m <= 1.22e-65: tmp = 0.0 else: tmp = c0 / (((w * math.pow((d / D), -2.0)) / c0) * (w * h)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(d / D) ^ 2.0 tmp = 0.0 if (M_m <= 1.3e-217) tmp = Float64(c0 / Float64(Float64(w / t_0) / Float64(c0 / Float64(w * h)))); elseif (M_m <= 2.05e-97) tmp = 0.0; elseif (M_m <= 3.6e-76) tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / t_0))); elseif (M_m <= 1.22e-65) tmp = 0.0; else tmp = Float64(c0 / Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = (d / D) ^ 2.0; tmp = 0.0; if (M_m <= 1.3e-217) tmp = c0 / ((w / t_0) / (c0 / (w * h))); elseif (M_m <= 2.05e-97) tmp = 0.0; elseif (M_m <= 3.6e-76) tmp = c0 / (w * ((h * (w / c0)) / t_0)); elseif (M_m <= 1.22e-65) tmp = 0.0; else tmp = c0 / (((w * ((d / D) ^ -2.0)) / c0) * (w * h)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[M$95$m, 1.3e-217], N[(c0 / N[(N[(w / t$95$0), $MachinePrecision] / N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 2.05e-97], 0.0, If[LessEqual[M$95$m, 3.6e-76], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.22e-65], 0.0, N[(c0 / N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
\mathbf{if}\;M_m \leq 1.3 \cdot 10^{-217}:\\
\;\;\;\;\frac{c0}{\frac{\frac{w}{t_0}}{\frac{c0}{w \cdot h}}}\\
\mathbf{elif}\;M_m \leq 2.05 \cdot 10^{-97}:\\
\;\;\;\;0\\
\mathbf{elif}\;M_m \leq 3.6 \cdot 10^{-76}:\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{t_0}}\\
\mathbf{elif}\;M_m \leq 1.22 \cdot 10^{-65}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\
\end{array}
\end{array}
if M < 1.29999999999999997e-217Initial program 28.5%
+-commutative28.5%
+-commutative28.5%
times-frac27.8%
fma-neg27.8%
Simplified28.6%
Taylor expanded in c0 around inf 38.6%
*-commutative38.6%
*-commutative38.6%
associate-*r*38.5%
associate-*r/38.6%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
associate-/r*38.8%
unpow238.8%
associate-*r/45.9%
unpow245.9%
associate-/l/49.2%
associate-*r/48.6%
associate-*l/49.8%
unpow249.8%
Simplified49.8%
Applied egg-rr22.2%
expm1-def24.8%
expm1-log1p48.8%
associate-*l*48.8%
associate-*l/47.6%
associate-/l*49.5%
*-commutative49.5%
associate-/l*49.6%
*-commutative49.6%
associate-/l*49.6%
metadata-eval49.6%
Simplified49.6%
expm1-log1p-u46.8%
expm1-udef27.3%
/-rgt-identity27.3%
associate-/r*27.7%
associate-/l/27.3%
Applied egg-rr27.3%
expm1-def46.8%
expm1-log1p49.6%
associate-/r*50.7%
*-commutative50.7%
Simplified50.7%
if 1.29999999999999997e-217 < M < 2.04999999999999996e-97 or 3.6e-76 < M < 1.21999999999999999e-65Initial program 14.1%
+-commutative14.1%
+-commutative14.1%
times-frac14.1%
fma-neg14.1%
Simplified14.2%
Taylor expanded in c0 around -inf 3.7%
associate-*r*3.7%
neg-mul-13.7%
distribute-lft1-in3.7%
metadata-eval3.7%
mul0-lft50.9%
distribute-lft-neg-in50.9%
distribute-rgt-neg-in50.9%
metadata-eval50.9%
mul0-lft3.7%
metadata-eval3.7%
distribute-lft1-in3.7%
distribute-lft-in3.7%
Simplified50.9%
Taylor expanded in c0 around 0 57.7%
if 2.04999999999999996e-97 < M < 3.6e-76Initial program 27.2%
+-commutative27.2%
+-commutative27.2%
times-frac27.2%
fma-neg27.2%
Simplified28.8%
Taylor expanded in c0 around inf 50.0%
*-commutative50.0%
*-commutative50.0%
associate-*r*50.0%
associate-*r/50.0%
associate-*r*50.0%
*-commutative50.0%
*-commutative50.0%
associate-/r*51.2%
unpow251.2%
associate-*r/74.0%
unpow274.0%
associate-/l/74.2%
associate-*r/73.6%
associate-*l/73.6%
unpow273.6%
Simplified73.6%
associate-*r/74.0%
*-commutative74.0%
associate-*l/74.0%
*-commutative74.0%
unpow274.0%
times-frac51.2%
associate-/r*51.2%
associate-/r*51.2%
frac-times27.2%
pow227.2%
Applied egg-rr27.2%
expm1-log1p-u2.2%
expm1-udef2.2%
associate-*r*2.2%
associate-/r*2.2%
times-frac24.2%
associate-/r*24.2%
*-commutative24.2%
associate-/r*24.2%
Applied egg-rr24.2%
expm1-def24.2%
expm1-log1p51.2%
associate-*l*51.2%
associate-/l/51.2%
associate-/r/51.6%
associate-/l*51.6%
*-commutative51.6%
associate-/l*51.6%
associate-/l/51.2%
unpow251.2%
times-frac74.6%
unpow274.6%
metadata-eval74.6%
Simplified74.0%
if 1.21999999999999999e-65 < M Initial program 17.4%
+-commutative17.4%
+-commutative17.4%
times-frac17.4%
fma-neg17.4%
Simplified18.9%
Taylor expanded in c0 around inf 41.4%
*-commutative41.4%
*-commutative41.4%
associate-*r*41.4%
associate-*r/41.6%
associate-*r*41.6%
*-commutative41.6%
*-commutative41.6%
associate-/r*43.0%
unpow243.0%
associate-*r/44.6%
unpow244.6%
associate-/l/50.5%
associate-*r/50.6%
associate-*l/50.6%
unpow250.6%
Simplified50.6%
Applied egg-rr20.8%
expm1-def20.8%
expm1-log1p50.6%
associate-*l*50.6%
associate-*l/50.6%
associate-/l*50.6%
*-commutative50.6%
associate-/l*50.6%
*-commutative50.6%
associate-/l*50.6%
metadata-eval50.6%
Simplified50.6%
div-inv50.6%
/-rgt-identity50.6%
associate-/r*47.6%
associate-/l/50.6%
Applied egg-rr50.6%
un-div-inv50.6%
associate-/r*51.8%
*-commutative51.8%
associate-/r/51.9%
div-inv51.9%
pow-flip51.9%
metadata-eval51.9%
*-commutative51.9%
Applied egg-rr51.9%
Final simplification52.2%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (or (<= M_m 8.5e-210) (not (<= M_m 1.65e-97))) (/ c0 (* w (/ (* h (/ w c0)) (pow (/ d D) 2.0)))) 0.0))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97)) {
tmp = c0 / (w * ((h * (w / c0)) / pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if ((m_m <= 8.5d-210) .or. (.not. (m_m <= 1.65d-97))) then
tmp = c0 / (w * ((h * (w / c0)) / ((d_1 / d) ** 2.0d0)))
else
tmp = 0.0d0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97)) {
tmp = c0 / (w * ((h * (w / c0)) / Math.pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if (M_m <= 8.5e-210) or not (M_m <= 1.65e-97): tmp = c0 / (w * ((h * (w / c0)) / math.pow((d / D), 2.0))) else: tmp = 0.0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97)) tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / (Float64(d / D) ^ 2.0)))); else tmp = 0.0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if ((M_m <= 8.5e-210) || ~((M_m <= 1.65e-97))) tmp = c0 / (w * ((h * (w / c0)) / ((d / D) ^ 2.0))); else tmp = 0.0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[Or[LessEqual[M$95$m, 8.5e-210], N[Not[LessEqual[M$95$m, 1.65e-97]], $MachinePrecision]], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 8.5 \cdot 10^{-210} \lor \neg \left(M_m \leq 1.65 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 8.4999999999999997e-210 or 1.6500000000000001e-97 < M Initial program 24.7%
+-commutative24.7%
+-commutative24.7%
times-frac24.3%
fma-neg24.3%
Simplified25.3%
Taylor expanded in c0 around inf 38.9%
*-commutative38.9%
*-commutative38.9%
associate-*r*39.3%
associate-*r/39.4%
associate-*r*39.0%
*-commutative39.0%
*-commutative39.0%
associate-/r*39.5%
unpow239.5%
associate-*r/45.1%
unpow245.1%
associate-/l/49.0%
associate-*r/48.6%
associate-*l/49.5%
unpow249.5%
Simplified49.5%
associate-*r/49.2%
*-commutative49.2%
associate-*l/48.8%
*-commutative48.8%
unpow248.8%
times-frac39.0%
associate-/r*44.6%
associate-/r*45.9%
frac-times46.6%
pow246.6%
Applied egg-rr46.6%
expm1-log1p-u21.1%
expm1-udef21.4%
associate-*r*21.4%
associate-/r*21.4%
times-frac21.2%
associate-/r*19.9%
*-commutative19.9%
associate-/r*19.4%
Applied egg-rr19.4%
expm1-def20.2%
expm1-log1p43.5%
associate-*l*43.5%
associate-/l/43.5%
associate-/r/44.0%
associate-/l*44.0%
*-commutative44.0%
associate-/l*44.0%
associate-/l/38.1%
unpow238.1%
times-frac47.5%
unpow247.5%
metadata-eval47.5%
Simplified50.5%
if 8.4999999999999997e-210 < M < 1.6500000000000001e-97Initial program 14.1%
+-commutative14.1%
+-commutative14.1%
times-frac14.1%
fma-neg14.1%
Simplified14.2%
Taylor expanded in c0 around -inf 4.9%
associate-*r*4.9%
neg-mul-14.9%
distribute-lft1-in4.9%
metadata-eval4.9%
mul0-lft44.6%
distribute-lft-neg-in44.6%
distribute-rgt-neg-in44.6%
metadata-eval44.6%
mul0-lft4.9%
metadata-eval4.9%
distribute-lft1-in4.9%
distribute-lft-in4.9%
Simplified44.6%
Taylor expanded in c0 around 0 53.4%
Final simplification50.7%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 1.55e+241) 0.0 (* -0.5 (* M_m (/ c0 w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 1.55e+241) {
tmp = 0.0;
} else {
tmp = -0.5 * (M_m * (c0 / w));
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 1.55d+241) then
tmp = 0.0d0
else
tmp = (-0.5d0) * (m_m * (c0 / w))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 1.55e+241) {
tmp = 0.0;
} else {
tmp = -0.5 * (M_m * (c0 / w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 1.55e+241: tmp = 0.0 else: tmp = -0.5 * (M_m * (c0 / w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 1.55e+241) tmp = 0.0; else tmp = Float64(-0.5 * Float64(M_m * Float64(c0 / w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 1.55e+241) tmp = 0.0; else tmp = -0.5 * (M_m * (c0 / w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 1.55e+241], 0.0, N[(-0.5 * N[(M$95$m * N[(c0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 1.55 \cdot 10^{+241}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(M_m \cdot \frac{c0}{w}\right)\\
\end{array}
\end{array}
if M < 1.55e241Initial program 25.0%
+-commutative25.0%
+-commutative25.0%
times-frac24.5%
fma-neg24.5%
Simplified25.5%
Taylor expanded in c0 around -inf 2.7%
associate-*r*2.7%
neg-mul-12.7%
distribute-lft1-in2.7%
metadata-eval2.7%
mul0-lft25.9%
distribute-lft-neg-in25.9%
distribute-rgt-neg-in25.9%
metadata-eval25.9%
mul0-lft2.7%
metadata-eval2.7%
distribute-lft1-in2.7%
distribute-lft-in2.7%
Simplified25.9%
Taylor expanded in c0 around 0 29.1%
if 1.55e241 < M Initial program 0.0%
+-commutative0.0%
+-commutative0.0%
times-frac0.0%
fma-neg0.0%
Simplified0.0%
Applied egg-rr0.0%
fma-udef0.0%
*-commutative0.0%
fma-udef0.0%
Applied egg-rr25.0%
fma-def25.0%
associate-/r*16.7%
associate-/r*16.7%
Simplified16.7%
Taylor expanded in M around -inf 43.1%
associate-/l*43.1%
Simplified43.1%
div-inv43.1%
clear-num43.1%
Applied egg-rr43.1%
Final simplification29.8%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 4.8e+116) 0.0 (* 0.5 (/ M_m (/ w c0)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 4.8e+116) {
tmp = 0.0;
} else {
tmp = 0.5 * (M_m / (w / c0));
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 4.8d+116) then
tmp = 0.0d0
else
tmp = 0.5d0 * (m_m / (w / c0))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 4.8e+116) {
tmp = 0.0;
} else {
tmp = 0.5 * (M_m / (w / c0));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 4.8e+116: tmp = 0.0 else: tmp = 0.5 * (M_m / (w / c0)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 4.8e+116) tmp = 0.0; else tmp = Float64(0.5 * Float64(M_m / Float64(w / c0))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 4.8e+116) tmp = 0.0; else tmp = 0.5 * (M_m / (w / c0)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 4.8e+116], 0.0, N[(0.5 * N[(M$95$m / N[(w / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 4.8 \cdot 10^{+116}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{M_m}{\frac{w}{c0}}\\
\end{array}
\end{array}
if M < 4.8000000000000001e116Initial program 25.7%
+-commutative25.7%
+-commutative25.7%
times-frac25.3%
fma-neg25.3%
Simplified26.3%
Taylor expanded in c0 around -inf 3.0%
associate-*r*3.0%
neg-mul-13.0%
distribute-lft1-in3.0%
metadata-eval3.0%
mul0-lft27.8%
distribute-lft-neg-in27.8%
distribute-rgt-neg-in27.8%
metadata-eval27.8%
mul0-lft3.0%
metadata-eval3.0%
distribute-lft1-in3.0%
distribute-lft-in3.0%
Simplified27.8%
Taylor expanded in c0 around 0 31.3%
if 4.8000000000000001e116 < M Initial program 11.4%
+-commutative11.4%
+-commutative11.4%
times-frac11.4%
fma-neg11.4%
Simplified11.4%
Applied egg-rr8.6%
fma-udef8.6%
*-commutative8.6%
fma-udef8.6%
Applied egg-rr43.0%
fma-def43.1%
associate-/r*40.2%
associate-/r*40.2%
Simplified40.2%
Taylor expanded in c0 around 0 38.2%
associate-/l*32.9%
Simplified32.9%
Final simplification31.5%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 9.2e+115) 0.0 (/ (* (* M_m c0) 0.5) w)))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.2e+115) {
tmp = 0.0;
} else {
tmp = ((M_m * c0) * 0.5) / w;
}
return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 9.2d+115) then
tmp = 0.0d0
else
tmp = ((m_m * c0) * 0.5d0) / w
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.2e+115) {
tmp = 0.0;
} else {
tmp = ((M_m * c0) * 0.5) / w;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 9.2e+115: tmp = 0.0 else: tmp = ((M_m * c0) * 0.5) / w return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 9.2e+115) tmp = 0.0; else tmp = Float64(Float64(Float64(M_m * c0) * 0.5) / w); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 9.2e+115) tmp = 0.0; else tmp = ((M_m * c0) * 0.5) / w; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 9.2e+115], 0.0, N[(N[(N[(M$95$m * c0), $MachinePrecision] * 0.5), $MachinePrecision] / w), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 9.2 \cdot 10^{+115}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(M_m \cdot c0\right) \cdot 0.5}{w}\\
\end{array}
\end{array}
if M < 9.20000000000000014e115Initial program 25.7%
+-commutative25.7%
+-commutative25.7%
times-frac25.3%
fma-neg25.3%
Simplified26.3%
Taylor expanded in c0 around -inf 3.0%
associate-*r*3.0%
neg-mul-13.0%
distribute-lft1-in3.0%
metadata-eval3.0%
mul0-lft27.8%
distribute-lft-neg-in27.8%
distribute-rgt-neg-in27.8%
metadata-eval27.8%
mul0-lft3.0%
metadata-eval3.0%
distribute-lft1-in3.0%
distribute-lft-in3.0%
Simplified27.8%
Taylor expanded in c0 around 0 31.3%
if 9.20000000000000014e115 < M Initial program 11.4%
+-commutative11.4%
+-commutative11.4%
times-frac11.4%
fma-neg11.4%
Simplified11.4%
Applied egg-rr8.6%
fma-udef8.6%
*-commutative8.6%
fma-udef8.6%
Applied egg-rr43.0%
fma-def43.1%
associate-/r*40.2%
associate-/r*40.2%
Simplified40.2%
Taylor expanded in c0 around 0 38.2%
*-commutative38.2%
associate-*l/38.2%
*-commutative38.2%
Simplified38.2%
Final simplification32.2%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 0.0)
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
return 0.0;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
code = 0.0d0
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
return 0.0;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): return 0.0
M_m = abs(M) function code(c0, w, h, D, d, M_m) return 0.0 end
M_m = abs(M); function tmp = code(c0, w, h, D, d, M_m) tmp = 0.0; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := 0.0
\begin{array}{l}
M_m = \left|M\right|
\\
0
\end{array}
Initial program 23.8%
+-commutative23.8%
+-commutative23.8%
times-frac23.4%
fma-neg23.4%
Simplified24.3%
Taylor expanded in c0 around -inf 2.6%
associate-*r*2.6%
neg-mul-12.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft24.8%
distribute-lft-neg-in24.8%
distribute-rgt-neg-in24.8%
metadata-eval24.8%
mul0-lft2.6%
metadata-eval2.6%
distribute-lft1-in2.6%
distribute-lft-in2.6%
Simplified24.8%
Taylor expanded in c0 around 0 27.8%
Final simplification27.8%
herbie shell --seed 2024024
(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))))))