
(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: 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 D) (* 2.0 d)) 5e+17)
(* w0 (sqrt (+ 1.0 (/ -1.0 (/ l (* h (pow (* M (* D (/ 0.5 d))) 2.0)))))))
(*
w0
(sqrt (+ 1.0 (* (* (/ D l) (* (/ h (/ d M)) (/ D (/ d M)))) -0.25))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+17) {
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (h * pow((M * (D * (0.5 / d))), 2.0))))));
} else {
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 * d) / (2.0d0 * d_1)) <= 5d+17) then
tmp = w0 * sqrt((1.0d0 + ((-1.0d0) / (l / (h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0))))))
else
tmp = w0 * sqrt((1.0d0 + (((d / l) * ((h / (d_1 / m)) * (d / (d_1 / m)))) * (-0.25d0))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 * D) / (2.0 * d)) <= 5e+17) {
tmp = w0 * Math.sqrt((1.0 + (-1.0 / (l / (h * Math.pow((M * (D * (0.5 / d))), 2.0))))));
} else {
tmp = w0 * Math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 5e+17: tmp = w0 * math.sqrt((1.0 + (-1.0 / (l / (h * math.pow((M * (D * (0.5 / d))), 2.0)))))) else: tmp = w0 * math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+17) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-1.0 / Float64(l / Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D / l) * Float64(Float64(h / Float64(d / M)) * Float64(D / Float64(d / M)))) * -0.25)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 5e+17)
tmp = w0 * sqrt((1.0 + (-1.0 / (l / (h * ((M * (D * (0.5 / d))) ^ 2.0))))));
else
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+17], N[(w0 * N[Sqrt[N[(1.0 + N[(-1.0 / N[(l / N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D / l), $MachinePrecision] * N[(N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+17}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{-1}{\frac{\ell}{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \left(\frac{D}{\ell} \cdot \left(\frac{h}{\frac{d}{M}} \cdot \frac{D}{\frac{d}{M}}\right)\right) \cdot -0.25}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 5e17Initial program 83.9%
*-commutative83.9%
times-frac83.4%
Simplified83.4%
associate-*r/93.1%
frac-times93.3%
*-commutative93.3%
clear-num93.3%
*-commutative93.3%
div-inv93.3%
associate-*l*91.7%
associate-/r*91.7%
metadata-eval91.7%
Applied egg-rr91.7%
if 5e17 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 70.2%
*-commutative70.2%
times-frac70.0%
Simplified70.0%
Taylor expanded in w0 around 0 50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
distribute-lft-neg-in50.9%
distribute-rgt-neg-in50.9%
Simplified50.8%
frac-times55.1%
*-commutative55.1%
times-frac76.1%
Applied egg-rr76.1%
*-commutative76.1%
times-frac67.8%
associate-/l*61.9%
associate-*l/67.8%
associate-*l*74.3%
associate-*r/76.0%
*-commutative76.0%
times-frac76.1%
Simplified76.1%
Final simplification88.8%
NOTE: M should be positive before calling this function NOTE: D 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 (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -4e-13) (* w0 (sqrt (+ 1.0 (* (* (/ D l) (* (/ h (/ d M)) (/ D (/ d M)))) -0.25)))) w0))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -4e-13) {
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
} else {
tmp = w0;
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-4d-13)) then
tmp = w0 * sqrt((1.0d0 + (((d / l) * ((h / (d_1 / m)) * (d / (d_1 / m)))) * (-0.25d0))))
else
tmp = w0
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -4e-13) {
tmp = w0 * Math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
} else {
tmp = w0;
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -4e-13: tmp = w0 * math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25))) else: tmp = w0 return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -4e-13) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D / l) * Float64(Float64(h / Float64(d / M)) * Float64(D / Float64(d / M)))) * -0.25)))); else tmp = w0; end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -4e-13)
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -4e-13], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D / l), $MachinePrecision] * N[(N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{-13}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \left(\frac{D}{\ell} \cdot \left(\frac{h}{\frac{d}{M}} \cdot \frac{D}{\frac{d}{M}}\right)\right) \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -4.0000000000000001e-13Initial program 64.3%
*-commutative64.3%
times-frac65.4%
Simplified65.4%
Taylor expanded in w0 around 0 44.0%
*-commutative44.0%
cancel-sign-sub-inv44.0%
*-commutative44.0%
cancel-sign-sub-inv44.0%
*-commutative44.0%
cancel-sign-sub-inv44.0%
distribute-lft-neg-in44.0%
distribute-rgt-neg-in44.0%
Simplified44.2%
frac-times45.8%
*-commutative45.8%
times-frac62.7%
Applied egg-rr62.7%
*-commutative62.7%
times-frac54.3%
associate-/l*51.6%
associate-*l/54.3%
associate-*l*59.8%
associate-*r/61.3%
*-commutative61.3%
times-frac63.9%
Simplified63.9%
if -4.0000000000000001e-13 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 88.0%
*-commutative88.0%
times-frac87.0%
Simplified87.0%
Taylor expanded in M around 0 98.5%
Final simplification88.8%
NOTE: M should be positive before calling this function
NOTE: D 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 D) (* 2.0 d)) 5e+17)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l))))
(*
w0
(sqrt (+ 1.0 (* (* (/ D l) (* (/ h (/ d M)) (/ D (/ d M)))) -0.25))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+17) {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 * d) / (2.0d0 * d_1)) <= 5d+17) then
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (0.5d0 / d_1))) ** 2.0d0)) / l)))
else
tmp = w0 * sqrt((1.0d0 + (((d / l) * ((h / (d_1 / m)) * (d / (d_1 / m)))) * (-0.25d0))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 * D) / (2.0 * d)) <= 5e+17) {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 5e+17: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) else: tmp = w0 * math.sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+17) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(D / l) * Float64(Float64(h / Float64(d / M)) * Float64(D / Float64(d / M)))) * -0.25)))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (((M * D) / (2.0 * d)) <= 5e+17)
tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l)));
else
tmp = w0 * sqrt((1.0 + (((D / l) * ((h / (d / M)) * (D / (d / M)))) * -0.25)));
end
tmp_2 = tmp;
end
NOTE: M should be positive before calling this function NOTE: D 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[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+17], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(D / l), $MachinePrecision] * N[(N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+17}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \left(\frac{D}{\ell} \cdot \left(\frac{h}{\frac{d}{M}} \cdot \frac{D}{\frac{d}{M}}\right)\right) \cdot -0.25}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 2 d)) < 5e17Initial program 83.9%
*-commutative83.9%
times-frac83.4%
Simplified83.4%
*-commutative83.4%
frac-times83.9%
*-commutative83.9%
associate-*l/93.3%
div-inv93.3%
associate-*l*91.7%
associate-/r*91.7%
metadata-eval91.7%
Applied egg-rr91.7%
if 5e17 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 70.2%
*-commutative70.2%
times-frac70.0%
Simplified70.0%
Taylor expanded in w0 around 0 50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
*-commutative50.9%
cancel-sign-sub-inv50.9%
distribute-lft-neg-in50.9%
distribute-rgt-neg-in50.9%
Simplified50.8%
frac-times55.1%
*-commutative55.1%
times-frac76.1%
Applied egg-rr76.1%
*-commutative76.1%
times-frac67.8%
associate-/l*61.9%
associate-*l/67.8%
associate-*l*74.3%
associate-*r/76.0%
*-commutative76.0%
times-frac76.1%
Simplified76.1%
Final simplification88.8%
NOTE: M should be positive before calling this function
NOTE: D 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 1.6e-206)
w0
(*
w0
(sqrt (+ 1.0 (* -0.25 (* (/ D l) (* (/ h (/ d M)) (* M (/ D d))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.6e-206) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / l) * ((h / (d / M)) * (M * (D / d)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 1.6d-206) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 + ((-0.25d0) * ((d / l) * ((h / (d_1 / m)) * (m * (d / d_1)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 1.6e-206) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 + (-0.25 * ((D / l) * ((h / (d / M)) * (M * (D / d)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.6e-206: tmp = w0 else: tmp = w0 * math.sqrt((1.0 + (-0.25 * ((D / l) * ((h / (d / M)) * (M * (D / d))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.6e-206) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(-0.25 * Float64(Float64(D / l) * Float64(Float64(h / Float64(d / M)) * Float64(M * Float64(D / d)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.6e-206)
tmp = w0;
else
tmp = w0 * sqrt((1.0 + (-0.25 * ((D / l) * ((h / (d / M)) * (M * (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: 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, 1.6e-206], w0, N[(w0 * N[Sqrt[N[(1.0 + N[(-0.25 * N[(N[(D / l), $MachinePrecision] * N[(N[(h / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.6 \cdot 10^{-206}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D}{\ell} \cdot \left(\frac{h}{\frac{d}{M}} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right)}\\
\end{array}
\end{array}
if M < 1.59999999999999988e-206Initial program 81.3%
*-commutative81.3%
times-frac80.5%
Simplified80.5%
Taylor expanded in M around 0 79.1%
if 1.59999999999999988e-206 < M Initial program 81.5%
*-commutative81.5%
times-frac81.5%
Simplified81.5%
Taylor expanded in w0 around 0 55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
*-commutative55.9%
cancel-sign-sub-inv55.9%
distribute-lft-neg-in55.9%
distribute-rgt-neg-in55.9%
Simplified61.6%
frac-times64.5%
*-commutative64.5%
times-frac83.4%
Applied egg-rr83.4%
*-commutative83.4%
times-frac77.7%
associate-/l*75.9%
associate-*l/77.7%
associate-*l*79.8%
associate-*r/83.4%
*-commutative83.4%
times-frac89.0%
Simplified89.0%
associate-/r/89.0%
Applied egg-rr89.0%
Final simplification83.2%
NOTE: M should be positive before calling this function NOTE: D 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 (<= d 3.8e-8) (* w0 (fma (* (/ h (/ l D)) (/ D (* (/ d M) (/ d M)))) -0.125 1.0)) (* w0 (+ 1.0 (* -0.125 (* (/ D d) (* (/ D d) (/ (* M h) (/ l M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 3.8e-8) {
tmp = w0 * fma(((h / (l / D)) * (D / ((d / M) * (d / M)))), -0.125, 1.0);
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 3.8e-8) tmp = Float64(w0 * fma(Float64(Float64(h / Float64(l / D)) * Float64(D / Float64(Float64(d / M) * Float64(d / M)))), -0.125, 1.0)); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(Float64(M * h) / Float64(l / M))))))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D 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[d, 3.8e-8], N[(w0 * N[(N[(N[(h / N[(l / D), $MachinePrecision]), $MachinePrecision] * N[(D / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 3.8 \cdot 10^{-8}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(\frac{h}{\frac{\ell}{D}} \cdot \frac{D}{\frac{d}{M} \cdot \frac{d}{M}}, -0.125, 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \frac{M \cdot h}{\frac{\ell}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if d < 3.80000000000000028e-8Initial program 82.2%
*-commutative82.2%
times-frac81.6%
Simplified81.6%
Taylor expanded in M around 0 52.3%
+-commutative52.3%
associate-*r/52.3%
*-commutative52.3%
associate-*r/52.3%
*-commutative52.3%
fma-def52.3%
times-frac49.6%
unpow249.6%
associate-/l*50.7%
associate-/l*52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
frac-times57.8%
*-commutative57.8%
times-frac76.8%
Applied egg-rr72.7%
times-frac72.8%
Simplified72.8%
if 3.80000000000000028e-8 < d Initial program 79.2%
*-commutative79.2%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 69.3%
*-commutative69.3%
*-commutative69.3%
times-frac66.5%
*-commutative66.5%
unpow266.5%
unpow266.5%
*-commutative66.5%
unpow266.5%
Simplified66.5%
Taylor expanded in D around 0 69.3%
*-commutative69.3%
times-frac66.5%
unpow266.5%
associate-/l*63.5%
unpow263.5%
unpow263.5%
times-frac69.5%
associate-*l*69.7%
associate-/r/76.9%
*-commutative76.9%
associate-/l*80.9%
Simplified80.9%
associate-*r/76.9%
Applied egg-rr76.9%
Final simplification73.9%
NOTE: M should be positive before calling this function NOTE: D 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 (<= d 4e-18) (* w0 (fma (/ (* D (/ h (* (/ d M) (/ d M)))) (/ l D)) -0.125 1.0)) (* w0 (+ 1.0 (* -0.125 (* (/ D d) (* (/ D d) (/ (* M h) (/ l M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (d <= 4e-18) {
tmp = w0 * fma(((D * (h / ((d / M) * (d / M)))) / (l / D)), -0.125, 1.0);
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (d <= 4e-18) tmp = Float64(w0 * fma(Float64(Float64(D * Float64(h / Float64(Float64(d / M) * Float64(d / M)))) / Float64(l / D)), -0.125, 1.0)); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(Float64(M * h) / Float64(l / M))))))); end return tmp end
NOTE: M should be positive before calling this function NOTE: D 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[d, 4e-18], N[(w0 * N[(N[(N[(D * N[(h / N[(N[(d / M), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / D), $MachinePrecision]), $MachinePrecision] * -0.125 + 1.0), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4 \cdot 10^{-18}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(\frac{D \cdot \frac{h}{\frac{d}{M} \cdot \frac{d}{M}}}{\frac{\ell}{D}}, -0.125, 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \frac{M \cdot h}{\frac{\ell}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if d < 4.0000000000000003e-18Initial program 82.2%
*-commutative82.2%
times-frac81.6%
Simplified81.6%
Taylor expanded in M around 0 52.3%
+-commutative52.3%
associate-*r/52.3%
*-commutative52.3%
associate-*r/52.3%
*-commutative52.3%
fma-def52.3%
times-frac49.6%
unpow249.6%
associate-/l*50.7%
associate-/l*52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
associate-*l/58.0%
times-frac73.4%
Applied egg-rr73.4%
if 4.0000000000000003e-18 < d Initial program 79.2%
*-commutative79.2%
times-frac79.1%
Simplified79.1%
Taylor expanded in M around 0 69.3%
*-commutative69.3%
*-commutative69.3%
times-frac66.5%
*-commutative66.5%
unpow266.5%
unpow266.5%
*-commutative66.5%
unpow266.5%
Simplified66.5%
Taylor expanded in D around 0 69.3%
*-commutative69.3%
times-frac66.5%
unpow266.5%
associate-/l*63.5%
unpow263.5%
unpow263.5%
times-frac69.5%
associate-*l*69.7%
associate-/r/76.9%
*-commutative76.9%
associate-/l*80.9%
Simplified80.9%
associate-*r/76.9%
Applied egg-rr76.9%
Final simplification74.3%
NOTE: M should be positive before calling this function
NOTE: D 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 4.35e-156)
w0
(if (<= M 0.0001)
(* w0 (+ 1.0 (* -0.125 (* (/ D d) (/ (/ (* M (* M D)) (/ d h)) l)))))
(* w0 (+ 1.0 (* -0.125 (* (/ D d) (* (/ D d) (/ (* M h) (/ l M))))))))))M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4.35e-156) {
tmp = w0;
} else if (M <= 0.0001) {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * (((M * (M * D)) / (d / h)) / l))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 4.35d-156) then
tmp = w0
else if (m <= 0.0001d0) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / d_1) * (((m * (m * d)) / (d_1 / h)) / l))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / d_1) * ((d / d_1) * ((m * h) / (l / m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 4.35e-156) {
tmp = w0;
} else if (M <= 0.0001) {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * (((M * (M * D)) / (d / h)) / l))));
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4.35e-156: tmp = w0 elif M <= 0.0001: tmp = w0 * (1.0 + (-0.125 * ((D / d) * (((M * (M * D)) / (d / h)) / l)))) else: tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4.35e-156) tmp = w0; elseif (M <= 0.0001) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(Float64(M * Float64(M * D)) / Float64(d / h)) / l))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(Float64(M * h) / Float64(l / M))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 4.35e-156)
tmp = w0;
elseif (M <= 0.0001)
tmp = w0 * (1.0 + (-0.125 * ((D / d) * (((M * (M * D)) / (d / h)) / l))));
else
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (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: 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, 4.35e-156], w0, If[LessEqual[M, 0.0001], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.35 \cdot 10^{-156}:\\
\;\;\;\;w0\\
\mathbf{elif}\;M \leq 0.0001:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{\frac{d}{h}}}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \frac{M \cdot h}{\frac{\ell}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 4.35000000000000005e-156Initial program 80.7%
*-commutative80.7%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 78.6%
if 4.35000000000000005e-156 < M < 1.00000000000000005e-4Initial program 80.3%
*-commutative80.3%
times-frac80.3%
Simplified80.3%
Taylor expanded in M around 0 66.0%
*-commutative66.0%
*-commutative66.0%
times-frac68.7%
*-commutative68.7%
unpow268.7%
unpow268.7%
*-commutative68.7%
unpow268.7%
Simplified68.7%
Taylor expanded in D around 0 66.0%
*-commutative66.0%
times-frac68.7%
unpow268.7%
associate-/l*68.7%
unpow268.7%
unpow268.7%
times-frac80.2%
associate-*l*89.0%
associate-/r/91.8%
*-commutative91.8%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in D around 0 86.1%
times-frac89.0%
*-commutative89.0%
times-frac86.1%
associate-/l/92.0%
*-commutative92.0%
associate-*r*92.0%
associate-/l*94.7%
unpow294.7%
associate-*r*94.7%
Simplified94.7%
if 1.00000000000000005e-4 < M Initial program 83.7%
*-commutative83.7%
times-frac83.6%
Simplified83.6%
Taylor expanded in M around 0 52.1%
*-commutative52.1%
*-commutative52.1%
times-frac47.1%
*-commutative47.1%
unpow247.1%
unpow247.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in D around 0 52.1%
*-commutative52.1%
times-frac47.1%
unpow247.1%
associate-/l*52.1%
unpow252.1%
unpow252.1%
times-frac59.2%
associate-*l*61.2%
associate-/r/59.8%
*-commutative59.8%
associate-/l*67.8%
Simplified67.8%
associate-*r/66.3%
Applied egg-rr66.3%
Final simplification77.9%
NOTE: M should be positive before calling this function NOTE: D 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 4.35e-156) w0 (* w0 (+ 1.0 (* -0.125 (* (/ D d) (* (/ D d) (* h (/ M (/ l M))))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 4.35e-156) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * (h * (M / (l / M)))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 4.35d-156) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / d_1) * ((d / d_1) * (h * (m / (l / m)))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 4.35e-156) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * (h * (M / (l / M)))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 4.35e-156: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * (h * (M / (l / M))))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 4.35e-156) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(h * Float64(M / Float64(l / M)))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 4.35e-156)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * (h * (M / (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: 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, 4.35e-156], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(h * N[(M / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.35 \cdot 10^{-156}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \left(h \cdot \frac{M}{\frac{\ell}{M}}\right)\right)\right)\right)\\
\end{array}
\end{array}
if M < 4.35000000000000005e-156Initial program 80.7%
*-commutative80.7%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 78.6%
if 4.35000000000000005e-156 < M Initial program 82.4%
*-commutative82.4%
times-frac82.4%
Simplified82.4%
Taylor expanded in M around 0 57.2%
*-commutative57.2%
*-commutative57.2%
times-frac55.1%
*-commutative55.1%
unpow255.1%
unpow255.1%
*-commutative55.1%
unpow255.1%
Simplified55.1%
Taylor expanded in D around 0 57.2%
*-commutative57.2%
times-frac55.1%
unpow255.1%
associate-/l*58.2%
unpow258.2%
unpow258.2%
times-frac66.9%
associate-*l*71.4%
associate-/r/71.6%
*-commutative71.6%
associate-/l*76.6%
Simplified76.6%
Final simplification77.9%
NOTE: M should be positive before calling this function NOTE: D 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 5.8e-155) w0 (* w0 (+ 1.0 (* -0.125 (* (/ D d) (* (/ D d) (/ (* M h) (/ l M)))))))))
M = abs(M);
D = abs(D);
d = abs(d);
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 5.8e-155) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
NOTE: M should be positive before calling this function
NOTE: D 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 <= 5.8d-155) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d / d_1) * ((d / d_1) * ((m * h) / (l / m))))))
end if
code = tmp
end function
M = Math.abs(M);
D = Math.abs(D);
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 <= 5.8e-155) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M))))));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 5.8e-155: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (l / M)))))) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 5.8e-155) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D / d) * Float64(Float64(D / d) * Float64(Float64(M * h) / Float64(l / M))))))); end return tmp end
M = abs(M)
D = abs(D)
d = abs(d)
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 5.8e-155)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * ((D / d) * ((D / d) * ((M * h) / (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: 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, 5.8e-155], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D / d), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5.8 \cdot 10^{-155}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \frac{M \cdot h}{\frac{\ell}{M}}\right)\right)\right)\\
\end{array}
\end{array}
if M < 5.80000000000000021e-155Initial program 80.7%
*-commutative80.7%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 78.6%
if 5.80000000000000021e-155 < M Initial program 82.4%
*-commutative82.4%
times-frac82.4%
Simplified82.4%
Taylor expanded in M around 0 57.2%
*-commutative57.2%
*-commutative57.2%
times-frac55.1%
*-commutative55.1%
unpow255.1%
unpow255.1%
*-commutative55.1%
unpow255.1%
Simplified55.1%
Taylor expanded in D around 0 57.2%
*-commutative57.2%
times-frac55.1%
unpow255.1%
associate-/l*58.2%
unpow258.2%
unpow258.2%
times-frac66.9%
associate-*l*71.4%
associate-/r/71.6%
*-commutative71.6%
associate-/l*76.6%
Simplified76.6%
associate-*r/75.7%
Applied egg-rr75.7%
Final simplification77.5%
NOTE: M should be positive before calling this function NOTE: D 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.3e+56) w0 (* -0.125 (* (* (/ D d) (/ D d)) (/ (* w0 (* h (* M M))) l)))))
M = abs(M);
D = abs(D);
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.3e+56) {
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: 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.3d+56) 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);
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.3e+56) {
tmp = w0;
} else {
tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l));
}
return tmp;
}
M = abs(M) D = abs(D) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.3e+56: tmp = w0 else: tmp = -0.125 * (((D / d) * (D / d)) * ((w0 * (h * (M * M))) / l)) return tmp
M = abs(M) D = abs(D) d = abs(d) M, D = sort([M, D]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.3e+56) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / l))); end return tmp end
M = abs(M)
D = abs(D)
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.3e+56)
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: 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.3e+56], w0, N[(-0.125 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.3 \cdot 10^{+56}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell}\right)\\
\end{array}
\end{array}
if M < 2.30000000000000015e56Initial program 80.3%
*-commutative80.3%
times-frac79.7%
Simplified79.7%
Taylor expanded in M around 0 79.7%
if 2.30000000000000015e56 < M Initial program 86.0%
*-commutative86.0%
times-frac85.9%
Simplified85.9%
Taylor expanded in M around 0 49.3%
*-commutative49.3%
*-commutative49.3%
times-frac45.2%
*-commutative45.2%
unpow245.2%
unpow245.2%
*-commutative45.2%
unpow245.2%
Simplified45.2%
Taylor expanded in D around 0 49.3%
*-commutative49.3%
times-frac45.2%
unpow245.2%
associate-/l*49.3%
unpow249.3%
unpow249.3%
times-frac56.0%
associate-*l*58.3%
associate-/r/58.6%
*-commutative58.6%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in D around inf 43.4%
associate-*r/43.4%
*-commutative43.4%
*-commutative43.4%
associate-*r/43.4%
times-frac41.3%
unpow241.3%
unpow241.3%
*-commutative41.3%
unpow241.3%
Simplified41.3%
Taylor expanded in D around 0 41.3%
unpow241.3%
unpow241.3%
times-frac45.9%
Simplified45.9%
Final simplification73.2%
NOTE: M should be positive before calling this function NOTE: D 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);
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: 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);
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) d = abs(d) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0
M = abs(M) D = abs(D) 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)
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: 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|\\
d = |d|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Initial program 81.4%
*-commutative81.4%
times-frac80.9%
Simplified80.9%
Taylor expanded in M around 0 72.5%
Final simplification72.5%
herbie shell --seed 2023227
(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))))))