
(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 5 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}
M_m = (fabs.f64 M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D h l d)
:precision binary64
(*
w0
(sqrt
(+
(-
2.0
(* h (* (* (* D 0.5) (/ M_m d)) (/ 1.0 (/ l (* 0.5 (* D (/ M_m d))))))))
-1.0))))M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * sqrt(((2.0 - (h * (((D * 0.5) * (M_m / d)) * (1.0 / (l / (0.5 * (D * (M_m / d)))))))) + -1.0));
}
M_m = abs(m)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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(((2.0d0 - (h * (((d * 0.5d0) * (m_m / d_1)) * (1.0d0 / (l / (0.5d0 * (d * (m_m / d_1)))))))) + (-1.0d0)))
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * Math.sqrt(((2.0 - (h * (((D * 0.5) * (M_m / d)) * (1.0 / (l / (0.5 * (D * (M_m / d)))))))) + -1.0));
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): return w0 * math.sqrt(((2.0 - (h * (((D * 0.5) * (M_m / d)) * (1.0 / (l / (0.5 * (D * (M_m / d)))))))) + -1.0))
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) return Float64(w0 * sqrt(Float64(Float64(2.0 - Float64(h * Float64(Float64(Float64(D * 0.5) * Float64(M_m / d)) * Float64(1.0 / Float64(l / Float64(0.5 * Float64(D * Float64(M_m / d)))))))) + -1.0))) end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
tmp = w0 * sqrt(((2.0 - (h * (((D * 0.5) * (M_m / d)) * (1.0 / (l / (0.5 * (D * (M_m / d)))))))) + -1.0));
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(2.0 - N[(h * N[(N[(N[(D * 0.5), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(l / N[(0.5 * N[(D * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
w0 \cdot \sqrt{\left(2 - h \cdot \left(\left(\left(D \cdot 0.5\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{1}{\frac{\ell}{0.5 \cdot \left(D \cdot \frac{M\_m}{d}\right)}}\right)\right) + -1}
\end{array}
Initial program 81.6%
Simplified81.1%
*-commutative81.1%
unpow281.1%
associate-*r*82.7%
*-commutative82.7%
associate-/r*82.7%
associate-*l/80.8%
associate-*r/81.4%
*-commutative81.4%
associate-/r*81.4%
associate-*l/82.0%
associate-*r/83.9%
associate-*r*82.7%
unpow282.7%
*-commutative82.7%
expm1-log1p-u82.3%
Applied egg-rr80.8%
expm1-undefine80.8%
sub-neg80.8%
log1p-undefine80.8%
rem-exp-log81.1%
associate-+r-81.1%
metadata-eval81.1%
associate-*l/86.1%
associate-/l*87.6%
associate-*r/88.2%
times-frac87.6%
associate-*r/88.2%
metadata-eval88.2%
Simplified88.2%
associate-*r/87.6%
unpow287.6%
div-inv87.6%
metadata-eval87.6%
div-inv87.6%
metadata-eval87.6%
Applied egg-rr87.6%
associate-/l*89.6%
Applied egg-rr89.6%
clear-num89.6%
inv-pow89.6%
Applied egg-rr89.6%
unpow-189.6%
associate-*r/87.8%
*-commutative87.8%
associate-*r*87.8%
associate-*r/87.8%
associate-/l*89.6%
Simplified89.6%
M_m = (fabs.f64 M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D h l d)
:precision binary64
(let* ((t_0 (* D (/ M_m (* 2.0 d)))))
(if (<= D 17500000000000.0)
w0
(* w0 (sqrt (- 1.0 (* (* t_0 t_0) (/ h l))))))))M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D * (M_m / (2.0 * d));
double tmp;
if (D <= 17500000000000.0) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - ((t_0 * t_0) * (h / l))));
}
return tmp;
}
M_m = abs(m)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = d * (m_m / (2.0d0 * d_1))
if (d <= 17500000000000.0d0) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - ((t_0 * t_0) * (h / l))))
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D * (M_m / (2.0 * d));
double tmp;
if (D <= 17500000000000.0) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - ((t_0 * t_0) * (h / l))));
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = D * (M_m / (2.0 * d)) tmp = 0 if D <= 17500000000000.0: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - ((t_0 * t_0) * (h / l)))) return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(D * Float64(M_m / Float64(2.0 * d))) tmp = 0.0 if (D <= 17500000000000.0) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(t_0 * t_0) * Float64(h / l))))); end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
t_0 = D * (M_m / (2.0 * d));
tmp = 0.0;
if (D <= 17500000000000.0)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - ((t_0 * t_0) * (h / l))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D * N[(M$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 17500000000000.0], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := D \cdot \frac{M\_m}{2 \cdot d}\\
\mathbf{if}\;D \leq 17500000000000:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(t\_0 \cdot t\_0\right) \cdot \frac{h}{\ell}}\\
\end{array}
\end{array}
if D < 1.75e13Initial program 83.3%
Simplified81.9%
Taylor expanded in D around 0 74.8%
if 1.75e13 < D Initial program 75.5%
Simplified78.0%
*-commutative78.0%
associate-/r*78.0%
associate-*l/75.5%
associate-*r/77.2%
clear-num77.2%
un-div-inv77.1%
associate-/l*77.1%
Applied egg-rr77.1%
associate-*r/77.1%
Simplified77.1%
unpow277.1%
associate-/r/76.2%
associate-/r/78.0%
Applied egg-rr78.0%
Final simplification75.5%
M_m = (fabs.f64 M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D h l d)
:precision binary64
(let* ((t_0 (* (/ 0.5 d) (* D M_m))))
(if (<= D 1150000000000.0)
w0
(* w0 (sqrt (- 1.0 (* (/ h l) (* t_0 t_0))))))))M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (0.5 / d) * (D * M_m);
double tmp;
if (D <= 1150000000000.0) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - ((h / l) * (t_0 * t_0))));
}
return tmp;
}
M_m = abs(m)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (0.5d0 / d_1) * (d * m_m)
if (d <= 1150000000000.0d0) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - ((h / l) * (t_0 * t_0))))
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (0.5 / d) * (D * M_m);
double tmp;
if (D <= 1150000000000.0) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * (t_0 * t_0))));
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = (0.5 / d) * (D * M_m) tmp = 0 if D <= 1150000000000.0: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - ((h / l) * (t_0 * t_0)))) return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(Float64(0.5 / d) * Float64(D * M_m)) tmp = 0.0 if (D <= 1150000000000.0) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * Float64(t_0 * t_0))))); end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
t_0 = (0.5 / d) * (D * M_m);
tmp = 0.0;
if (D <= 1150000000000.0)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - ((h / l) * (t_0 * t_0))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(0.5 / d), $MachinePrecision] * N[(D * M$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 1150000000000.0], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{0.5}{d} \cdot \left(D \cdot M\_m\right)\\
\mathbf{if}\;D \leq 1150000000000:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(t\_0 \cdot t\_0\right)}\\
\end{array}
\end{array}
if D < 1.15e12Initial program 83.3%
Simplified81.9%
Taylor expanded in D around 0 74.8%
if 1.15e12 < D Initial program 75.5%
Simplified78.0%
*-commutative78.0%
associate-/r*78.0%
associate-*l/75.5%
clear-num75.5%
*-commutative75.5%
Applied egg-rr75.5%
associate-/r/75.4%
Simplified75.4%
Taylor expanded in d around 0 75.4%
unpow275.4%
Applied egg-rr75.4%
Final simplification74.9%
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (* (* D 0.5) (/ M_m d)))) (* w0 (sqrt (+ -1.0 (- 2.0 (* h (* t_0 (/ t_0 l)))))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (D * 0.5) * (M_m / d);
return w0 * sqrt((-1.0 + (2.0 - (h * (t_0 * (t_0 / l))))));
}
M_m = abs(m)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
t_0 = (d * 0.5d0) * (m_m / d_1)
code = w0 * sqrt(((-1.0d0) + (2.0d0 - (h * (t_0 * (t_0 / l))))))
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (D * 0.5) * (M_m / d);
return w0 * Math.sqrt((-1.0 + (2.0 - (h * (t_0 * (t_0 / l))))));
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = (D * 0.5) * (M_m / d) return w0 * math.sqrt((-1.0 + (2.0 - (h * (t_0 * (t_0 / l))))))
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(Float64(D * 0.5) * Float64(M_m / d)) return Float64(w0 * sqrt(Float64(-1.0 + Float64(2.0 - Float64(h * Float64(t_0 * Float64(t_0 / l))))))) end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
t_0 = (D * 0.5) * (M_m / d);
tmp = w0 * sqrt((-1.0 + (2.0 - (h * (t_0 * (t_0 / l))))));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(D * 0.5), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(-1.0 + N[(2.0 - N[(h * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := \left(D \cdot 0.5\right) \cdot \frac{M\_m}{d}\\
w0 \cdot \sqrt{-1 + \left(2 - h \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)\right)}
\end{array}
\end{array}
Initial program 81.6%
Simplified81.1%
*-commutative81.1%
unpow281.1%
associate-*r*82.7%
*-commutative82.7%
associate-/r*82.7%
associate-*l/80.8%
associate-*r/81.4%
*-commutative81.4%
associate-/r*81.4%
associate-*l/82.0%
associate-*r/83.9%
associate-*r*82.7%
unpow282.7%
*-commutative82.7%
expm1-log1p-u82.3%
Applied egg-rr80.8%
expm1-undefine80.8%
sub-neg80.8%
log1p-undefine80.8%
rem-exp-log81.1%
associate-+r-81.1%
metadata-eval81.1%
associate-*l/86.1%
associate-/l*87.6%
associate-*r/88.2%
times-frac87.6%
associate-*r/88.2%
metadata-eval88.2%
Simplified88.2%
associate-*r/87.6%
unpow287.6%
div-inv87.6%
metadata-eval87.6%
div-inv87.6%
metadata-eval87.6%
Applied egg-rr87.6%
associate-/l*89.6%
Applied egg-rr89.6%
Final simplification89.6%
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 w0)
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = abs(m)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): return w0
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) return w0 end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
tmp = w0;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := w0
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
w0
\end{array}
Initial program 81.6%
Simplified81.1%
Taylor expanded in D around 0 69.9%
herbie shell --seed 2024165
(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))))))