
(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}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (* (/ D (/ d (/ M l))) (/ D (/ d (* M h))))) (t_1 (/ (* M D) d)))
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -1e+26)
(* w0 (sqrt (- 1.0 (* h (* (/ 0.25 l) (* t_1 t_1))))))
(* w0 (+ 1.0 (* -0.125 (cbrt (* t_0 (* t_0 t_0)))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (D / (d / (M / l))) * (D / (d / (M * h)));
double t_1 = (M * D) / d;
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -1e+26) {
tmp = w0 * sqrt((1.0 - (h * ((0.25 / l) * (t_1 * t_1)))));
} else {
tmp = w0 * (1.0 + (-0.125 * cbrt((t_0 * (t_0 * t_0)))));
}
return tmp;
}
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (D / (d / (M / l))) * (D / (d / (M * h)));
double t_1 = (M * D) / d;
double tmp;
if ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -1e+26) {
tmp = w0 * Math.sqrt((1.0 - (h * ((0.25 / l) * (t_1 * t_1)))));
} else {
tmp = w0 * (1.0 + (-0.125 * Math.cbrt((t_0 * (t_0 * t_0)))));
}
return tmp;
}
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(Float64(D / Float64(d / Float64(M / l))) * Float64(D / Float64(d / Float64(M * h)))) t_1 = Float64(Float64(M * D) / d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+26) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(0.25 / l) * Float64(t_1 * t_1)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * cbrt(Float64(t_0 * Float64(t_0 * t_0)))))); end return tmp end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(D / N[(d / N[(M / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -1e+26], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(0.25 / l), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{\frac{M}{\ell}}} \cdot \frac{D}{\frac{d}{M \cdot h}}\\
t_1 := \frac{M \cdot D}{d}\\
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+26}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(\frac{0.25}{\ell} \cdot \left(t_1 \cdot t_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}\right)\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -1.00000000000000005e26Initial program 66.8%
associate-/l*66.7%
Simplified66.7%
associate-/l*66.8%
clear-num66.8%
un-div-inv66.8%
associate-*l/62.5%
*-commutative62.5%
associate-/r*62.5%
div-inv62.5%
metadata-eval62.5%
Applied egg-rr62.5%
associate-/r/64.1%
*-commutative64.1%
*-commutative64.1%
associate-*l/64.0%
associate-*l*69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in M around 0 50.8%
unpow250.8%
associate-*l*52.2%
associate-*r/52.2%
associate-*l*50.8%
unpow250.8%
times-frac52.2%
unpow252.2%
unpow252.2%
unswap-sqr59.7%
unpow259.7%
Simplified59.7%
times-frac69.4%
*-commutative69.4%
*-commutative69.4%
Applied egg-rr69.4%
if -1.00000000000000005e26 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 84.0%
associate-/l*85.0%
Simplified85.0%
Taylor expanded in M around 0 57.4%
*-commutative57.4%
associate-/l*58.5%
unpow258.5%
unpow258.5%
*-commutative58.5%
unpow258.5%
Simplified58.5%
div-inv58.5%
associate-*r*62.9%
associate-*l*67.1%
Applied egg-rr67.1%
div-inv67.1%
*-un-lft-identity67.1%
add-cbrt-cube67.1%
Applied egg-rr76.8%
associate-*l*76.8%
Simplified84.8%
Final simplification80.7%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (let* ((t_0 (/ (* M D) d))) (* w0 (sqrt (- 1.0 (* h (* (/ 0.25 l) (* t_0 t_0))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / d;
return w0 * sqrt((1.0 - (h * ((0.25 / l) * (t_0 * t_0)))));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: t_0
t_0 = (m * d) / d_1
code = w0 * sqrt((1.0d0 - (h * ((0.25d0 / l) * (t_0 * t_0)))))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / d;
return w0 * Math.sqrt((1.0 - (h * ((0.25 / l) * (t_0 * t_0)))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = (M * D) / d return w0 * math.sqrt((1.0 - (h * ((0.25 / l) * (t_0 * t_0)))))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(0.25 / l) * Float64(t_0 * t_0)))))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
t_0 = (M * D) / d;
tmp = w0 * sqrt((1.0 - (h * ((0.25 / l) * (t_0 * t_0)))));
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(0.25 / l), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
w0 \cdot \sqrt{1 - h \cdot \left(\frac{0.25}{\ell} \cdot \left(t_0 \cdot t_0\right)\right)}
\end{array}
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
associate-/l*79.3%
clear-num79.3%
un-div-inv79.3%
associate-*l/77.8%
*-commutative77.8%
associate-/r*77.8%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
associate-/r/83.5%
*-commutative83.5%
*-commutative83.5%
associate-*l/83.5%
associate-*l*85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in M around 0 59.2%
unpow259.2%
associate-*l*63.1%
associate-*r/63.1%
associate-*l*59.2%
unpow259.2%
times-frac60.8%
unpow260.8%
unpow260.8%
unswap-sqr73.8%
unpow273.8%
Simplified73.8%
times-frac85.0%
*-commutative85.0%
*-commutative85.0%
Applied egg-rr85.0%
Final simplification85.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (+ w0 (* w0 (* -0.125 (* h (/ (pow (* D (/ M d)) 2.0) l))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 + (w0 * (-0.125 * (h * (pow((D * (M / d)), 2.0) / l))));
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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 + (w0 * ((-0.125d0) * (h * (((d * (m / d_1)) ** 2.0d0) / l))))
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 + (w0 * (-0.125 * (h * (Math.pow((D * (M / d)), 2.0) / l))));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 + (w0 * (-0.125 * (h * (math.pow((D * (M / d)), 2.0) / l))))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 + Float64(w0 * Float64(-0.125 * Float64(h * Float64((Float64(D * Float64(M / d)) ^ 2.0) / l))))) end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 + (w0 * (-0.125 * (h * (((D * (M / d)) ^ 2.0) / l))));
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 + N[(w0 * N[(-0.125 * N[(h * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 + w0 \cdot \left(-0.125 \cdot \left(h \cdot \frac{{\left(D \cdot \frac{M}{d}\right)}^{2}}{\ell}\right)\right)
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
Taylor expanded in M around 0 52.7%
*-commutative52.7%
associate-/l*53.4%
unpow253.4%
unpow253.4%
*-commutative53.4%
unpow253.4%
Simplified53.4%
Taylor expanded in D around 0 52.7%
unpow252.7%
unpow252.7%
associate-*r*55.8%
*-commutative55.8%
*-commutative55.8%
unpow255.8%
associate-*l*59.5%
associate-*r/59.8%
associate-*l*64.6%
times-frac72.7%
Simplified72.7%
Taylor expanded in w0 around 0 52.7%
Simplified52.6%
Taylor expanded in D around 0 52.7%
unpow252.7%
unpow252.7%
times-frac53.4%
unpow253.4%
*-commutative53.4%
associate-/l*55.3%
times-frac55.4%
associate-/l*55.8%
associate-*l/55.3%
associate-*r/57.0%
associate-*l/57.0%
unpow257.0%
associate-/r/57.1%
Simplified78.5%
Final simplification78.5%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ M (/ d D))))
(if (<= (* M D) 2e+79)
w0
(* w0 (+ 1.0 (* -0.125 (* (/ h l) (* t_0 t_0))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M / (d / D);
double tmp;
if ((M * D) <= 2e+79) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((h / l) * (t_0 * t_0))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = m / (d_1 / d)
if ((m * d) <= 2d+79) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((h / l) * (t_0 * t_0))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M / (d / D);
double tmp;
if ((M * D) <= 2e+79) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((h / l) * (t_0 * t_0))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = M / (d / D) tmp = 0 if (M * D) <= 2e+79: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((h / l) * (t_0 * t_0)))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(M / Float64(d / D)) tmp = 0.0 if (Float64(M * D) <= 2e+79) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(h / l) * Float64(t_0 * t_0))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = M / (d / D);
tmp = 0.0;
if ((M * D) <= 2e+79)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((h / l) * (t_0 * t_0))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 2e+79], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(h / l), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{M}{\frac{d}{D}}\\
\mathbf{if}\;M \cdot D \leq 2 \cdot 10^{+79}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{h}{\ell} \cdot \left(t_0 \cdot t_0\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 M D) < 1.99999999999999993e79Initial program 81.4%
associate-/l*81.9%
Simplified81.9%
Taylor expanded in M around 0 76.4%
if 1.99999999999999993e79 < (*.f64 M D) Initial program 65.7%
associate-/l*68.6%
Simplified68.6%
Taylor expanded in M around 0 42.4%
*-commutative42.4%
associate-/l*45.4%
unpow245.4%
unpow245.4%
*-commutative45.4%
unpow245.4%
Simplified45.4%
Taylor expanded in D around 0 42.4%
unpow242.4%
unpow242.4%
associate-*r*42.5%
*-commutative42.5%
*-commutative42.5%
unpow242.5%
associate-*l*42.5%
associate-*r/45.4%
associate-*l*54.3%
times-frac63.3%
Simplified63.3%
Taylor expanded in M around 0 42.4%
*-commutative42.4%
*-commutative42.4%
*-commutative42.4%
associate-*r*48.3%
times-frac48.1%
unpow248.1%
*-commutative48.1%
unpow248.1%
unpow248.1%
swap-sqr54.1%
unpow254.1%
*-commutative54.1%
Simplified54.1%
unpow254.1%
*-commutative54.1%
*-commutative54.1%
frac-times63.0%
associate-/l*63.0%
associate-/l*65.9%
Applied egg-rr65.9%
Final simplification75.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 3.4e-149) w0 (* w0 (+ 1.0 (* -0.125 (* M (* (* M h) (* (/ D (* d l)) (/ D d)))))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.4e-149) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (M * ((M * h) * ((D / (d * l)) * (D / d))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: tmp
if (m <= 3.4d-149) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (m * ((m * h) * ((d / (d_1 * l)) * (d / d_1))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.4e-149) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (M * ((M * h) * ((D / (d * l)) * (D / d))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 3.4e-149: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (M * ((M * h) * ((D / (d * l)) * (D / d)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3.4e-149) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(M * Float64(Float64(M * h) * Float64(Float64(D / Float64(d * l)) * Float64(D / d))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 3.4e-149)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (M * ((M * h) * ((D / (d * l)) * (D / d))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3.4e-149], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(M * N[(N[(M * h), $MachinePrecision] * N[(N[(D / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.4 \cdot 10^{-149}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(\left(M \cdot h\right) \cdot \left(\frac{D}{d \cdot \ell} \cdot \frac{D}{d}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 3.3999999999999999e-149Initial program 80.8%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in M around 0 70.2%
if 3.3999999999999999e-149 < M Initial program 76.9%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in M around 0 56.8%
*-commutative56.8%
associate-/l*58.8%
unpow258.8%
unpow258.8%
*-commutative58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in D around 0 56.8%
unpow256.8%
unpow256.8%
associate-*r*59.8%
*-commutative59.8%
*-commutative59.8%
unpow259.8%
associate-*l*62.0%
associate-*r/64.1%
associate-*l*69.3%
times-frac77.6%
Simplified77.6%
Final simplification73.0%
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ d (* M h))))
(if (<= D 2e+140)
(* w0 (+ 1.0 (* -0.125 (/ (* D D) (* d (* t_0 (/ l M)))))))
(* w0 (+ 1.0 (* -0.125 (* D (/ D (* t_0 (/ (* d l) M))))))))))M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = d / (M * h);
double tmp;
if (D <= 2e+140) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / (d * (t_0 * (l / M))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (D / (t_0 * ((d * l) / M))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: t_0
real(8) :: tmp
t_0 = d_1 / (m * h)
if (d <= 2d+140) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * d) / (d_1 * (t_0 * (l / m))))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d * (d / (t_0 * ((d_1 * l) / m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = d / (M * h);
double tmp;
if (D <= 2e+140) {
tmp = w0 * (1.0 + (-0.125 * ((D * D) / (d * (t_0 * (l / M))))));
} else {
tmp = w0 * (1.0 + (-0.125 * (D * (D / (t_0 * ((d * l) / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): t_0 = d / (M * h) tmp = 0 if D <= 2e+140: tmp = w0 * (1.0 + (-0.125 * ((D * D) / (d * (t_0 * (l / M)))))) else: tmp = w0 * (1.0 + (-0.125 * (D * (D / (t_0 * ((d * l) / M)))))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) t_0 = Float64(d / Float64(M * h)) tmp = 0.0 if (D <= 2e+140) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * D) / Float64(d * Float64(t_0 * Float64(l / M))))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D * Float64(D / Float64(t_0 * Float64(Float64(d * l) / M))))))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
t_0 = d / (M * h);
tmp = 0.0;
if (D <= 2e+140)
tmp = w0 * (1.0 + (-0.125 * ((D * D) / (d * (t_0 * (l / M))))));
else
tmp = w0 * (1.0 + (-0.125 * (D * (D / (t_0 * ((d * l) / M))))));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(d / N[(M * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 2e+140], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * D), $MachinePrecision] / N[(d * N[(t$95$0 * N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(D * N[(D / N[(t$95$0 * N[(N[(d * l), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := \frac{d}{M \cdot h}\\
\mathbf{if}\;D \leq 2 \cdot 10^{+140}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D \cdot D}{d \cdot \left(t_0 \cdot \frac{\ell}{M}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(D \cdot \frac{D}{t_0 \cdot \frac{d \cdot \ell}{M}}\right)\right)\\
\end{array}
\end{array}
if D < 2.00000000000000012e140Initial program 82.0%
associate-/l*82.0%
Simplified82.0%
Taylor expanded in M around 0 54.8%
*-commutative54.8%
associate-/l*55.7%
unpow255.7%
unpow255.7%
*-commutative55.7%
unpow255.7%
Simplified55.7%
div-inv55.7%
associate-*r*59.2%
associate-*l*62.8%
Applied egg-rr62.8%
Taylor expanded in l around 0 55.7%
*-commutative55.7%
unpow255.7%
associate-*r*59.2%
*-rgt-identity59.2%
*-commutative59.2%
unpow259.2%
associate-*r*62.8%
*-commutative62.8%
associate-*r/62.8%
associate-*l*66.8%
associate-*r/66.8%
*-rgt-identity66.8%
*-commutative66.8%
times-frac71.2%
Simplified71.2%
if 2.00000000000000012e140 < D Initial program 56.8%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in M around 0 34.7%
*-commutative34.7%
associate-/l*34.7%
unpow234.7%
unpow234.7%
*-commutative34.7%
unpow234.7%
Simplified34.7%
div-inv34.7%
associate-*r*34.7%
associate-*l*34.7%
Applied egg-rr34.7%
div-inv34.7%
*-un-lft-identity34.7%
times-frac55.5%
times-frac59.4%
*-commutative59.4%
*-commutative59.4%
Applied egg-rr59.4%
Final simplification69.9%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 4e+21) w0 (* -0.125 (* (/ (* D D) l) (/ (* (* M M) (* h w0)) (* d d))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * (((M * M) * (h * w0)) / (d * d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: tmp
if (m <= 4d+21) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / l) * (((m * m) * (h * w0)) / (d_1 * d_1)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / l) * (((M * M) * (h * w0)) / (d * d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4e+21: tmp = w0 else: tmp = -0.125 * (((D * D) / l) * (((M * M) * (h * w0)) / (d * d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4e+21) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / l) * Float64(Float64(Float64(M * M) * Float64(h * w0)) / Float64(d * d)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 4e+21)
tmp = w0;
else
tmp = -0.125 * (((D * D) / l) * (((M * M) * (h * w0)) / (d * d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4e+21], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * w0), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4 \cdot 10^{+21}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot w0\right)}{d \cdot d}\right)\\
\end{array}
\end{array}
if M < 4e21Initial program 80.1%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in M around 0 73.3%
if 4e21 < M Initial program 75.6%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in M around 0 48.6%
*-commutative48.6%
associate-/l*48.6%
unpow248.6%
unpow248.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in D around 0 48.6%
unpow248.6%
unpow248.6%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
unpow255.4%
associate-*l*55.6%
associate-*r/55.6%
associate-*l*64.7%
times-frac69.4%
Simplified69.4%
Taylor expanded in M around inf 33.0%
associate-/r*33.0%
*-commutative33.0%
associate-/r*33.0%
times-frac32.8%
unpow232.8%
unpow232.8%
*-commutative32.8%
associate-*r*30.4%
unpow230.4%
Simplified30.4%
Taylor expanded in D around 0 33.0%
unpow233.0%
unpow233.0%
times-frac33.0%
*-commutative33.0%
unpow233.0%
*-commutative33.0%
*-commutative33.0%
associate-*r*30.5%
*-commutative30.5%
Simplified30.5%
Final simplification66.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 4e+21) w0 (* -0.125 (* (/ (* D D) (* d d)) (/ (* (* M M) (* h w0)) l)))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * (((M * M) * (h * w0)) / l));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: tmp
if (m <= 4d+21) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) / (d_1 * d_1)) * (((m * m) * (h * w0)) / l))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) / (d * d)) * (((M * M) * (h * w0)) / l));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4e+21: tmp = w0 else: tmp = -0.125 * (((D * D) / (d * d)) * (((M * M) * (h * w0)) / l)) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4e+21) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(Float64(Float64(M * M) * Float64(h * w0)) / l))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 4e+21)
tmp = w0;
else
tmp = -0.125 * (((D * D) / (d * d)) * (((M * M) * (h * w0)) / l));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4e+21], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * w0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4 \cdot 10^{+21}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot w0\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 4e21Initial program 80.1%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in M around 0 73.3%
if 4e21 < M Initial program 75.6%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in M around 0 48.6%
*-commutative48.6%
associate-/l*48.6%
unpow248.6%
unpow248.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in D around 0 48.6%
unpow248.6%
unpow248.6%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
unpow255.4%
associate-*l*55.6%
associate-*r/55.6%
associate-*l*64.7%
times-frac69.4%
Simplified69.4%
Taylor expanded in M around inf 33.0%
associate-/r*33.0%
*-commutative33.0%
associate-/r*33.0%
times-frac32.8%
unpow232.8%
unpow232.8%
*-commutative32.8%
associate-*r*30.4%
unpow230.4%
Simplified30.4%
Final simplification66.0%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 4e+21) w0 (* -0.125 (/ (* (* D D) (* w0 (* h (* M M)))) (* l (* d d))))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (w0 * (h * (M * M)))) / (l * (d * d)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: tmp
if (m <= 4d+21) then
tmp = w0
else
tmp = (-0.125d0) * (((d * d) * (w0 * (h * (m * m)))) / (l * (d_1 * d_1)))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4e+21) {
tmp = w0;
} else {
tmp = -0.125 * (((D * D) * (w0 * (h * (M * M)))) / (l * (d * d)));
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4e+21: tmp = w0 else: tmp = -0.125 * (((D * D) * (w0 * (h * (M * M)))) / (l * (d * d))) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4e+21) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D * D) * Float64(w0 * Float64(h * Float64(M * M)))) / Float64(l * Float64(d * d)))); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 4e+21)
tmp = w0;
else
tmp = -0.125 * (((D * D) * (w0 * (h * (M * M)))) / (l * (d * d)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4e+21], w0, N[(-0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4 \cdot 10^{+21}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(D \cdot D\right) \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
\end{array}
\end{array}
if M < 4e21Initial program 80.1%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in M around 0 73.3%
if 4e21 < M Initial program 75.6%
associate-/l*77.9%
Simplified77.9%
Taylor expanded in M around 0 48.6%
*-commutative48.6%
associate-/l*48.6%
unpow248.6%
unpow248.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in D around 0 48.6%
unpow248.6%
unpow248.6%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
unpow255.4%
associate-*l*55.6%
associate-*r/55.6%
associate-*l*64.7%
times-frac69.4%
Simplified69.4%
Taylor expanded in M around inf 33.0%
associate-/r*33.0%
*-commutative33.0%
associate-/r*33.0%
times-frac32.8%
unpow232.8%
unpow232.8%
*-commutative32.8%
associate-*r*30.4%
unpow230.4%
Simplified30.4%
frac-times30.5%
associate-*l*33.0%
Applied egg-rr33.0%
Final simplification66.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 2.1e+19) w0 (* -0.125 (/ (* (* (/ D d) (/ D d)) (* w0 (* h (* M M)))) l))))
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.1e+19) {
tmp = w0;
} else {
tmp = -0.125 * ((((D / d) * (D / d)) * (w0 * (h * (M * M)))) / l);
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
real(8) :: tmp
if (m <= 2.1d+19) then
tmp = w0
else
tmp = (-0.125d0) * ((((d / d_1) * (d / d_1)) * (w0 * (h * (m * m)))) / l)
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.1e+19) {
tmp = w0;
} else {
tmp = -0.125 * ((((D / d) * (D / d)) * (w0 * (h * (M * M)))) / l);
}
return tmp;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.1e+19: tmp = w0 else: tmp = -0.125 * ((((D / d) * (D / d)) * (w0 * (h * (M * M)))) / l) return tmp
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.1e+19) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(w0 * Float64(h * Float64(M * M)))) / l)); end return tmp end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 2.1e+19)
tmp = w0;
else
tmp = -0.125 * ((((D / d) * (D / d)) * (w0 * (h * (M * M)))) / l);
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.1e+19], w0, N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.1 \cdot 10^{+19}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\ell}\\
\end{array}
\end{array}
if M < 2.1e19Initial program 79.9%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in M around 0 73.5%
if 2.1e19 < M Initial program 76.7%
associate-/l*78.9%
Simplified78.9%
Taylor expanded in M around 0 46.5%
*-commutative46.5%
associate-/l*46.5%
unpow246.5%
unpow246.5%
*-commutative46.5%
unpow246.5%
Simplified46.5%
Taylor expanded in D around 0 46.5%
unpow246.5%
unpow246.5%
associate-*r*53.0%
*-commutative53.0%
*-commutative53.0%
unpow253.0%
associate-*l*53.3%
associate-*r/53.3%
associate-*l*64.2%
times-frac68.8%
Simplified68.8%
Taylor expanded in M around inf 31.5%
associate-/r*31.6%
*-commutative31.6%
associate-/r*31.5%
times-frac31.3%
unpow231.3%
unpow231.3%
*-commutative31.3%
associate-*r*29.2%
unpow229.2%
Simplified29.2%
associate-*r/29.3%
times-frac32.0%
associate-*l*34.1%
Applied egg-rr34.1%
Final simplification66.4%
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 w0)
M = abs(M);
D = abs(D);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
NOTE: M should be positive before calling this function
NOTE: D should be positive before calling this function
NOTE: M and D should be sorted in increasing order before calling this function.
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
end function
M = Math.abs(M);
D = Math.abs(D);
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return w0 end
M = abs(M)
D = abs(D)
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
NOTE: M should be positive before calling this function NOTE: D should be positive before calling this function NOTE: M and D should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 79.3%
associate-/l*80.1%
Simplified80.1%
Taylor expanded in M around 0 69.0%
Final simplification69.0%
herbie shell --seed 2023187
(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))))))