
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
D_m = (fabs.f64 D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M D_m h l d)
:precision binary64
(let* ((t_0 (* (/ 1.0 (/ (* D_m 0.5) (/ d M))) (sqrt l)))
(t_1 (cbrt (- 1.0 (* h (/ (pow (* D_m (/ M (/ d 0.5))) 2.0) l))))))
(if (<= l 1e-306)
(* w0 (* t_1 (sqrt t_1)))
(* w0 (sqrt (- 1.0 (* (/ 1.0 t_0) (/ h t_0))))))))D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * sqrt(l);
double t_1 = cbrt((1.0 - (h * (pow((D_m * (M / (d / 0.5))), 2.0) / l))));
double tmp;
if (l <= 1e-306) {
tmp = w0 * (t_1 * sqrt(t_1));
} else {
tmp = w0 * sqrt((1.0 - ((1.0 / t_0) * (h / t_0))));
}
return tmp;
}
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * Math.sqrt(l);
double t_1 = Math.cbrt((1.0 - (h * (Math.pow((D_m * (M / (d / 0.5))), 2.0) / l))));
double tmp;
if (l <= 1e-306) {
tmp = w0 * (t_1 * Math.sqrt(t_1));
} else {
tmp = w0 * Math.sqrt((1.0 - ((1.0 / t_0) * (h / t_0))));
}
return tmp;
}
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) t_0 = Float64(Float64(1.0 / Float64(Float64(D_m * 0.5) / Float64(d / M))) * sqrt(l)) t_1 = cbrt(Float64(1.0 - Float64(h * Float64((Float64(D_m * Float64(M / Float64(d / 0.5))) ^ 2.0) / l)))) tmp = 0.0 if (l <= 1e-306) tmp = Float64(w0 * Float64(t_1 * sqrt(t_1))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(1.0 / t_0) * Float64(h / t_0))))); end return tmp end
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(N[(1.0 / N[(N[(D$95$m * 0.5), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(1.0 - N[(h * N[(N[Power[N[(D$95$m * N[(M / N[(d / 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[l, 1e-306], N[(w0 * N[(t$95$1 * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(h / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\frac{D_m \cdot 0.5}{\frac{d}{M}}} \cdot \sqrt{\ell}\\
t_1 := \sqrt[3]{1 - h \cdot \frac{{\left(D_m \cdot \frac{M}{\frac{d}{0.5}}\right)}^{2}}{\ell}}\\
\mathbf{if}\;\ell \leq 10^{-306}:\\
\;\;\;\;w0 \cdot \left(t_1 \cdot \sqrt{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{1}{t_0} \cdot \frac{h}{t_0}}\\
\end{array}
\end{array}
if l < 1.00000000000000003e-306Initial program 82.2%
Simplified81.5%
pow1/281.5%
*-commutative81.5%
associate-/l*82.2%
*-commutative82.2%
add-cube-cbrt82.2%
unpow-prod-down82.2%
Applied egg-rr81.4%
Simplified90.3%
if 1.00000000000000003e-306 < l Initial program 80.0%
Simplified78.5%
Taylor expanded in M around 0 80.0%
associate-*r/80.0%
*-commutative80.0%
*-commutative80.0%
associate-*r/80.0%
associate-*l*78.4%
Simplified78.4%
Applied egg-rr86.8%
div-inv86.9%
associate-*r*85.2%
*-commutative85.2%
*-commutative85.2%
pow-flip85.2%
*-commutative85.2%
*-commutative85.2%
associate-*r*86.9%
metadata-eval86.9%
Applied egg-rr86.9%
*-un-lft-identity86.9%
add-sqr-sqrt86.9%
times-frac86.9%
*-commutative86.9%
sqrt-prod86.8%
sqrt-pow178.2%
metadata-eval78.2%
unpow-178.2%
associate-*l/78.2%
*-commutative78.2%
associate-*r*78.2%
*-commutative78.2%
Applied egg-rr91.0%
associate-/l*88.4%
*-commutative88.4%
associate-/l*90.0%
*-commutative90.0%
Simplified90.0%
Final simplification90.1%
D_m = (fabs.f64 D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M D_m h l d)
:precision binary64
(let* ((t_0 (* (/ 1.0 (/ (* D_m 0.5) (/ d M))) (sqrt l))))
(if (<= l 4e-307)
(* w0 (sqrt (- 1.0 (/ h (/ l (pow (* (/ 0.5 d) (* D_m M)) 2.0))))))
(* w0 (sqrt (- 1.0 (* (/ 1.0 t_0) (/ h t_0))))))))D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * sqrt(l);
double tmp;
if (l <= 4e-307) {
tmp = w0 * sqrt((1.0 - (h / (l / pow(((0.5 / d) * (D_m * M)), 2.0)))));
} else {
tmp = w0 * sqrt((1.0 - ((1.0 / t_0) * (h / t_0))));
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 / ((d_m * 0.5d0) / (d / m))) * sqrt(l)
if (l <= 4d-307) then
tmp = w0 * sqrt((1.0d0 - (h / (l / (((0.5d0 / d) * (d_m * m)) ** 2.0d0)))))
else
tmp = w0 * sqrt((1.0d0 - ((1.0d0 / t_0) * (h / t_0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * Math.sqrt(l);
double tmp;
if (l <= 4e-307) {
tmp = w0 * Math.sqrt((1.0 - (h / (l / Math.pow(((0.5 / d) * (D_m * M)), 2.0)))));
} else {
tmp = w0 * Math.sqrt((1.0 - ((1.0 / t_0) * (h / t_0))));
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * math.sqrt(l) tmp = 0 if l <= 4e-307: tmp = w0 * math.sqrt((1.0 - (h / (l / math.pow(((0.5 / d) * (D_m * M)), 2.0))))) else: tmp = w0 * math.sqrt((1.0 - ((1.0 / t_0) * (h / t_0)))) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) t_0 = Float64(Float64(1.0 / Float64(Float64(D_m * 0.5) / Float64(d / M))) * sqrt(l)) tmp = 0.0 if (l <= 4e-307) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l / (Float64(Float64(0.5 / d) * Float64(D_m * M)) ^ 2.0)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(1.0 / t_0) * Float64(h / t_0))))); end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
t_0 = (1.0 / ((D_m * 0.5) / (d / M))) * sqrt(l);
tmp = 0.0;
if (l <= 4e-307)
tmp = w0 * sqrt((1.0 - (h / (l / (((0.5 / d) * (D_m * M)) ^ 2.0)))));
else
tmp = w0 * sqrt((1.0 - ((1.0 / t_0) * (h / t_0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(N[(1.0 / N[(N[(D$95$m * 0.5), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 4e-307], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l / N[Power[N[(N[(0.5 / d), $MachinePrecision] * N[(D$95$m * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(h / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{1}{\frac{D_m \cdot 0.5}{\frac{d}{M}}} \cdot \sqrt{\ell}\\
\mathbf{if}\;\ell \leq 4 \cdot 10^{-307}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\frac{\ell}{{\left(\frac{0.5}{d} \cdot \left(D_m \cdot M\right)\right)}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{1}{t_0} \cdot \frac{h}{t_0}}\\
\end{array}
\end{array}
if l < 3.99999999999999964e-307Initial program 82.2%
Simplified81.5%
Taylor expanded in M around 0 82.2%
associate-*r/82.2%
*-commutative82.2%
*-commutative82.2%
associate-*r/82.2%
associate-*l*81.5%
Simplified81.5%
Applied egg-rr90.3%
if 3.99999999999999964e-307 < l Initial program 80.0%
Simplified78.5%
Taylor expanded in M around 0 80.0%
associate-*r/80.0%
*-commutative80.0%
*-commutative80.0%
associate-*r/80.0%
associate-*l*78.4%
Simplified78.4%
Applied egg-rr86.8%
div-inv86.9%
associate-*r*85.2%
*-commutative85.2%
*-commutative85.2%
pow-flip85.2%
*-commutative85.2%
*-commutative85.2%
associate-*r*86.9%
metadata-eval86.9%
Applied egg-rr86.9%
*-un-lft-identity86.9%
add-sqr-sqrt86.9%
times-frac86.9%
*-commutative86.9%
sqrt-prod86.8%
sqrt-pow178.2%
metadata-eval78.2%
unpow-178.2%
associate-*l/78.2%
*-commutative78.2%
associate-*r*78.2%
*-commutative78.2%
Applied egg-rr91.0%
associate-/l*88.4%
*-commutative88.4%
associate-/l*90.0%
*-commutative90.0%
Simplified90.0%
Final simplification90.1%
D_m = (fabs.f64 D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M D_m h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* D_m M) (* d 2.0)) 2.0) (/ h l)))))
(if (<= t_0 2e+247)
(* w0 (sqrt t_0))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (/ (/ D_m 2.0) d)) 2.0)) l)))))))D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = 1.0 - (pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l));
double tmp;
if (t_0 <= 2e+247) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * ((D_m / 2.0) / d)), 2.0)) / l)));
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((d_m * m) / (d * 2.0d0)) ** 2.0d0) * (h / l))
if (t_0 <= 2d+247) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((h * ((m * ((d_m / 2.0d0) / d)) ** 2.0d0)) / l)))
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l));
double tmp;
if (t_0 <= 2e+247) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * ((D_m / 2.0) / d)), 2.0)) / l)));
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): t_0 = 1.0 - (math.pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l)) tmp = 0 if t_0 <= 2e+247: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * ((D_m / 2.0) / d)), 2.0)) / l))) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(D_m * M) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 2e+247) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(Float64(D_m / 2.0) / d)) ^ 2.0)) / l)))); end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
t_0 = 1.0 - ((((D_m * M) / (d * 2.0)) ^ 2.0) * (h / l));
tmp = 0.0;
if (t_0 <= 2e+247)
tmp = w0 * sqrt(t_0);
else
tmp = w0 * sqrt((1.0 - ((h * ((M * ((D_m / 2.0) / d)) ^ 2.0)) / l)));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(1.0 - N[(N[Power[N[(N[(D$95$m * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+247], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(N[(D$95$m / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{D_m \cdot M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+247}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \frac{\frac{D_m}{2}}{d}\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 1.9999999999999999e247Initial program 99.9%
if 1.9999999999999999e247 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 40.1%
Simplified41.3%
*-commutative41.3%
associate-/l*40.1%
associate-*l/67.6%
associate-/l*68.2%
div-inv68.2%
clear-num68.2%
associate-/r*68.2%
Applied egg-rr68.2%
Final simplification90.0%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= (* (pow (/ (* D_m M) (* d 2.0)) 2.0) (/ h l)) -5e+18) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ M (/ (* d 2.0) D_m)) 2.0))))) w0))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if ((pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l)) <= -5e+18) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((M / ((d * 2.0) / D_m)), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (((((d_m * m) / (d * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+18)) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((m / ((d * 2.0d0) / d_m)) ** 2.0d0))))
else
tmp = w0
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if ((Math.pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l)) <= -5e+18) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((M / ((d * 2.0) / D_m)), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if (math.pow(((D_m * M) / (d * 2.0)), 2.0) * (h / l)) <= -5e+18: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((M / ((d * 2.0) / D_m)), 2.0)))) else: tmp = w0 return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(D_m * M) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+18) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(M / Float64(Float64(d * 2.0) / D_m)) ^ 2.0))))); else tmp = w0; end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if (((((D_m * M) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+18)
tmp = w0 * sqrt((1.0 - ((h / l) * ((M / ((d * 2.0) / D_m)) ^ 2.0))));
else
tmp = w0;
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(D$95$m * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+18], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(M / N[(N[(d * 2.0), $MachinePrecision] / D$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{D_m \cdot M}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+18}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{\frac{d \cdot 2}{D_m}}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -5e18Initial program 70.9%
Simplified69.8%
if -5e18 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 85.6%
Simplified84.5%
Taylor expanded in M around 0 95.3%
Final simplification87.7%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= l 1.16e-153) (* w0 (sqrt (- 1.0 (/ (* h (pow (* M (/ (/ D_m 2.0) d)) 2.0)) l)))) (* w0 (sqrt (- 1.0 (/ h (pow (/ (sqrt l) (* D_m (* M (/ 0.5 d)))) 2.0)))))))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (l <= 1.16e-153) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * ((D_m / 2.0) / d)), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 - (h / pow((sqrt(l) / (D_m * (M * (0.5 / d)))), 2.0))));
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (l <= 1.16d-153) then
tmp = w0 * sqrt((1.0d0 - ((h * ((m * ((d_m / 2.0d0) / d)) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 - (h / ((sqrt(l) / (d_m * (m * (0.5d0 / d)))) ** 2.0d0))))
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (l <= 1.16e-153) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * ((D_m / 2.0) / d)), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - (h / Math.pow((Math.sqrt(l) / (D_m * (M * (0.5 / d)))), 2.0))));
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if l <= 1.16e-153: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * ((D_m / 2.0) / d)), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 - (h / math.pow((math.sqrt(l) / (D_m * (M * (0.5 / d)))), 2.0)))) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (l <= 1.16e-153) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(Float64(D_m / 2.0) / d)) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / (Float64(sqrt(l) / Float64(D_m * Float64(M * Float64(0.5 / d)))) ^ 2.0))))); end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if (l <= 1.16e-153)
tmp = w0 * sqrt((1.0 - ((h * ((M * ((D_m / 2.0) / d)) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 - (h / ((sqrt(l) / (D_m * (M * (0.5 / d)))) ^ 2.0))));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[l, 1.16e-153], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(N[(D$95$m / 2.0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[Power[N[(N[Sqrt[l], $MachinePrecision] / N[(D$95$m * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.16 \cdot 10^{-153}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \frac{\frac{D_m}{2}}{d}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{{\left(\frac{\sqrt{\ell}}{D_m \cdot \left(M \cdot \frac{0.5}{d}\right)}\right)}^{2}}}\\
\end{array}
\end{array}
if l < 1.16e-153Initial program 78.6%
Simplified77.5%
*-commutative77.5%
associate-/l*78.6%
associate-*l/88.9%
associate-/l*87.2%
div-inv87.2%
clear-num87.2%
associate-/r*87.2%
Applied egg-rr87.2%
if 1.16e-153 < l Initial program 85.9%
Simplified85.0%
Taylor expanded in M around 0 85.9%
associate-*r/85.9%
*-commutative85.9%
*-commutative85.9%
associate-*r/85.9%
associate-*l*84.9%
Simplified84.9%
Applied egg-rr91.5%
add-sqr-sqrt91.5%
sqrt-div91.5%
associate-*r*89.4%
*-commutative89.4%
*-commutative89.4%
sqrt-pow182.6%
metadata-eval82.6%
pow182.6%
*-commutative82.6%
*-commutative82.6%
associate-*r*84.8%
sqrt-div84.8%
associate-*r*82.6%
*-commutative82.6%
*-commutative82.6%
Applied egg-rr93.6%
unpow293.6%
associate-*r*92.5%
*-commutative92.5%
Simplified92.5%
Final simplification89.1%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= (/ h l) -5e-322) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* M (* D_m (/ 0.5 d))) 2.0))))) w0))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if ((h / l) <= -5e-322) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((M * (D_m * (0.5 / d))), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if ((h / l) <= (-5d-322)) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((m * (d_m * (0.5d0 / d))) ** 2.0d0))))
else
tmp = w0
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if ((h / l) <= -5e-322) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((M * (D_m * (0.5 / d))), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if (h / l) <= -5e-322: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((M * (D_m * (0.5 / d))), 2.0)))) else: tmp = w0 return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (Float64(h / l) <= -5e-322) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(M * Float64(D_m * Float64(0.5 / d))) ^ 2.0))))); else tmp = w0; end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if ((h / l) <= -5e-322)
tmp = w0 * sqrt((1.0 - ((h / l) * ((M * (D_m * (0.5 / d))) ^ 2.0))));
else
tmp = w0;
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -5e-322], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-322}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(M \cdot \left(D_m \cdot \frac{0.5}{d}\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -4.99006e-322Initial program 76.4%
Simplified75.9%
Taylor expanded in M around 0 76.4%
associate-*r/76.4%
*-commutative76.4%
*-commutative76.4%
associate-*r/76.4%
associate-*l*75.9%
Simplified75.9%
if -4.99006e-322 < (/.f64 h l) Initial program 87.9%
Simplified86.0%
Taylor expanded in M around 0 95.5%
Final simplification84.1%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (* w0 (sqrt (- 1.0 (/ h (* l (pow (* (/ 0.5 d) (* D_m M)) -2.0)))))))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
return w0 * sqrt((1.0 - (h / (l * pow(((0.5 / d) * (D_m * M)), -2.0)))));
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0 * sqrt((1.0d0 - (h / (l * (((0.5d0 / d) * (d_m * m)) ** (-2.0d0))))))
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h / (l * Math.pow(((0.5 / d) * (D_m * M)), -2.0)))));
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): return w0 * math.sqrt((1.0 - (h / (l * math.pow(((0.5 / d) * (D_m * M)), -2.0)))))
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l * (Float64(Float64(0.5 / d) * Float64(D_m * M)) ^ -2.0)))))) end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp = code(w0, M, D_m, h, l, d)
tmp = w0 * sqrt((1.0 - (h / (l * (((0.5 / d) * (D_m * M)) ^ -2.0)))));
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l * N[Power[N[(N[(0.5 / d), $MachinePrecision] * N[(D$95$m * M), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
w0 \cdot \sqrt{1 - \frac{h}{\ell \cdot {\left(\frac{0.5}{d} \cdot \left(D_m \cdot M\right)\right)}^{-2}}}
\end{array}
Initial program 81.2%
Simplified80.1%
Taylor expanded in M around 0 81.2%
associate-*r/81.2%
*-commutative81.2%
*-commutative81.2%
associate-*r/81.2%
associate-*l*80.1%
Simplified80.1%
Applied egg-rr88.7%
div-inv88.7%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
pow-flip88.0%
*-commutative88.0%
*-commutative88.0%
associate-*r*88.7%
metadata-eval88.7%
Applied egg-rr88.7%
Final simplification88.7%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= M 3e-26) w0 (pow (pow w0 6.0) 0.16666666666666666)))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 3e-26) {
tmp = w0;
} else {
tmp = pow(pow(w0, 6.0), 0.16666666666666666);
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (m <= 3d-26) then
tmp = w0
else
tmp = (w0 ** 6.0d0) ** 0.16666666666666666d0
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 3e-26) {
tmp = w0;
} else {
tmp = Math.pow(Math.pow(w0, 6.0), 0.16666666666666666);
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if M <= 3e-26: tmp = w0 else: tmp = math.pow(math.pow(w0, 6.0), 0.16666666666666666) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (M <= 3e-26) tmp = w0; else tmp = (w0 ^ 6.0) ^ 0.16666666666666666; end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if (M <= 3e-26)
tmp = w0;
else
tmp = (w0 ^ 6.0) ^ 0.16666666666666666;
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[M, 3e-26], w0, N[Power[N[Power[w0, 6.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3 \cdot 10^{-26}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;{\left({w0}^{6}\right)}^{0.16666666666666666}\\
\end{array}
\end{array}
if M < 3.00000000000000012e-26Initial program 83.1%
Simplified81.1%
Taylor expanded in M around 0 74.4%
if 3.00000000000000012e-26 < M Initial program 75.6%
Simplified77.0%
*-commutative77.0%
associate-/l*75.6%
*-commutative75.6%
add-sqr-sqrt37.3%
sqrt-unprod29.5%
*-commutative29.5%
Applied egg-rr29.5%
Simplified28.4%
Taylor expanded in h around 0 25.8%
sqrt-pow152.8%
metadata-eval52.8%
pow152.8%
add-exp-log22.6%
Applied egg-rr22.6%
rem-exp-log52.8%
rem-cbrt-cube37.7%
unpow1/317.4%
sqr-pow17.4%
pow-prod-down16.5%
pow-prod-up16.5%
metadata-eval16.5%
metadata-eval16.5%
Applied egg-rr16.5%
Final simplification59.9%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= M 1.45e-22) w0 (sqrt (pow w0 2.0))))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 1.45e-22) {
tmp = w0;
} else {
tmp = sqrt(pow(w0, 2.0));
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (m <= 1.45d-22) then
tmp = w0
else
tmp = sqrt((w0 ** 2.0d0))
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 1.45e-22) {
tmp = w0;
} else {
tmp = Math.sqrt(Math.pow(w0, 2.0));
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if M <= 1.45e-22: tmp = w0 else: tmp = math.sqrt(math.pow(w0, 2.0)) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (M <= 1.45e-22) tmp = w0; else tmp = sqrt((w0 ^ 2.0)); end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if (M <= 1.45e-22)
tmp = w0;
else
tmp = sqrt((w0 ^ 2.0));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[M, 1.45e-22], w0, N[Sqrt[N[Power[w0, 2.0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.45 \cdot 10^{-22}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{w0}^{2}}\\
\end{array}
\end{array}
if M < 1.4500000000000001e-22Initial program 83.2%
Simplified81.2%
Taylor expanded in M around 0 74.5%
if 1.4500000000000001e-22 < M Initial program 75.2%
Simplified76.7%
*-commutative76.7%
associate-/l*75.2%
*-commutative75.2%
add-sqr-sqrt37.9%
sqrt-unprod29.8%
*-commutative29.8%
Applied egg-rr29.8%
Simplified28.7%
Taylor expanded in h around 0 26.1%
Final simplification62.6%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 (if (<= M 4e+59) w0 (log (exp w0))))
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 4e+59) {
tmp = w0;
} else {
tmp = log(exp(w0));
}
return tmp;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (m <= 4d+59) then
tmp = w0
else
tmp = log(exp(w0))
end if
code = tmp
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
double tmp;
if (M <= 4e+59) {
tmp = w0;
} else {
tmp = Math.log(Math.exp(w0));
}
return tmp;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): tmp = 0 if M <= 4e+59: tmp = w0 else: tmp = math.log(math.exp(w0)) return tmp
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) tmp = 0.0 if (M <= 4e+59) tmp = w0; else tmp = log(exp(w0)); end return tmp end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp_2 = code(w0, M, D_m, h, l, d)
tmp = 0.0;
if (M <= 4e+59)
tmp = w0;
else
tmp = log(exp(w0));
end
tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := If[LessEqual[M, 4e+59], w0, N[Log[N[Exp[w0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4 \cdot 10^{+59}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{w0}\right)\\
\end{array}
\end{array}
if M < 3.99999999999999989e59Initial program 82.8%
Simplified81.5%
Taylor expanded in M around 0 72.2%
if 3.99999999999999989e59 < M Initial program 72.5%
Simplified72.4%
*-commutative72.4%
associate-/l*72.5%
*-commutative72.5%
add-sqr-sqrt30.6%
sqrt-unprod24.4%
*-commutative24.4%
Applied egg-rr24.4%
Simplified22.1%
Taylor expanded in h around 0 27.8%
sqrt-pow151.5%
metadata-eval51.5%
pow151.5%
add-log-exp21.3%
Applied egg-rr21.3%
Final simplification64.4%
D_m = (fabs.f64 D) NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D_m h l d) :precision binary64 w0)
D_m = fabs(D);
assert(w0 < M && M < D_m && D_m < h && h < l && l < d);
double code(double w0, double M, double D_m, double h, double l, double d) {
return w0;
}
D_m = abs(D)
NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0
end function
D_m = Math.abs(D);
assert w0 < M && M < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M, double D_m, double h, double l, double d) {
return w0;
}
D_m = math.fabs(D) [w0, M, D_m, h, l, d] = sort([w0, M, D_m, h, l, d]) def code(w0, M, D_m, h, l, d): return w0
D_m = abs(D) w0, M, D_m, h, l, d = sort([w0, M, D_m, h, l, d]) function code(w0, M, D_m, h, l, d) return w0 end
D_m = abs(D);
w0, M, D_m, h, l, d = num2cell(sort([w0, M, D_m, h, l, d])){:}
function tmp = code(w0, M, D_m, h, l, d)
tmp = w0;
end
D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D$95$m_, h_, l_, d_] := w0
\begin{array}{l}
D_m = \left|D\right|
\\
[w0, M, D_m, h, l, d] = \mathsf{sort}([w0, M, D_m, h, l, d])\\
\\
w0
\end{array}
Initial program 81.2%
Simplified80.1%
Taylor expanded in M around 0 69.0%
Final simplification69.0%
herbie shell --seed 2024018
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
:precision binary64
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))