
(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 10 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
(if (<= (pow (/ (* M D) (* 2.0 d)) 2.0) 5e+235)
(* w0 (sqrt (- 1.0 (/ (* (pow (* M (* 0.5 (/ D d))) 2.0) h) l))))
(*
w0
(sqrt
(-
1.0
(* (* D (/ D l)) (* (* h (* M (/ M d))) (/ (cbrt 0.015625) 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 (pow(((M * D) / (2.0 * d)), 2.0) <= 5e+235) {
tmp = w0 * sqrt((1.0 - ((pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
} else {
tmp = w0 * sqrt((1.0 - ((D * (D / l)) * ((h * (M * (M / d))) * (cbrt(0.015625) / d)))));
}
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 tmp;
if (Math.pow(((M * D) / (2.0 * d)), 2.0) <= 5e+235) {
tmp = w0 * Math.sqrt((1.0 - ((Math.pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((D * (D / l)) * ((h * (M * (M / d))) * (Math.cbrt(0.015625) / 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 ((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) <= 5e+235) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * h) / l)))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D * Float64(D / l)) * Float64(Float64(h * Float64(M * Float64(M / d))) * Float64(cbrt(0.015625) / d)))))); 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_] := If[LessEqual[N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 5e+235], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[0.015625, 1/3], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \leq 5 \cdot 10^{+235}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(D \cdot \frac{D}{\ell}\right) \cdot \left(\left(h \cdot \left(M \cdot \frac{M}{d}\right)\right) \cdot \frac{\sqrt[3]{0.015625}}{d}\right)}\\
\end{array}
\end{array}
if (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 5.00000000000000027e235Initial program 90.0%
*-commutative90.0%
times-frac89.6%
Simplified89.6%
unpow289.6%
associate-*l*90.2%
div-inv90.2%
associate-*l*89.6%
times-frac89.6%
*-un-lft-identity89.6%
*-commutative89.6%
clear-num89.6%
div-inv89.6%
div-inv89.6%
associate-*l*90.1%
times-frac90.1%
*-un-lft-identity90.1%
*-commutative90.1%
clear-num90.1%
div-inv90.1%
associate-*l*89.5%
Applied egg-rr96.9%
if 5.00000000000000027e235 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 46.7%
*-commutative46.7%
times-frac49.7%
Simplified49.7%
unpow249.7%
associate-*l*57.0%
div-inv57.0%
associate-*l*57.0%
times-frac57.1%
*-un-lft-identity57.1%
*-commutative57.1%
clear-num57.0%
div-inv57.0%
div-inv57.0%
associate-*l*59.9%
times-frac60.0%
*-un-lft-identity60.0%
*-commutative60.0%
clear-num59.9%
div-inv59.9%
associate-*l*52.6%
Applied egg-rr51.4%
add-cbrt-cube45.4%
Applied egg-rr45.4%
associate-*l*45.4%
cube-unmult45.4%
*-commutative45.4%
associate-*r*45.4%
Simplified45.4%
Taylor expanded in h around 0 39.7%
times-frac38.3%
unpow238.3%
associate-*r/42.1%
*-commutative42.1%
unpow242.1%
*-commutative42.1%
unpow242.1%
times-frac47.8%
associate-*l/49.3%
*-commutative49.3%
associate-/l*55.4%
associate-/r/55.4%
Simplified55.4%
Final simplification86.2%
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 (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) INFINITY) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ M d) (/ D 2.0)) 2.0))))) (fma -0.125 (* D (/ (* D (* (* h (/ M (/ d M))) (/ w0 d))) l)) w0)))
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 ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= ((double) INFINITY)) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow(((M / d) * (D / 2.0)), 2.0))));
} else {
tmp = fma(-0.125, (D * ((D * ((h * (M / (d / M))) * (w0 / d))) / l)), w0);
}
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 (Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) <= Inf) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(M / d) * Float64(D / 2.0)) ^ 2.0))))); else tmp = fma(-0.125, Float64(D * Float64(Float64(D * Float64(Float64(h * Float64(M / Float64(d / M))) * Float64(w0 / d))) / l)), w0); 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_] := If[LessEqual[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], Infinity], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / d), $MachinePrecision] * N[(D / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(D * N[(N[(D * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, D \cdot \frac{D \cdot \left(\left(h \cdot \frac{M}{\frac{d}{M}}\right) \cdot \frac{w0}{d}\right)}{\ell}, w0\right)\\
\end{array}
\end{array}
if (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 84.8%
*-commutative84.8%
times-frac84.9%
Simplified84.9%
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 0.0%
*-commutative0.0%
times-frac5.6%
Simplified5.6%
Taylor expanded in M around 0 33.3%
fma-def33.3%
times-frac38.9%
*-commutative38.9%
unpow238.9%
associate-/l*38.9%
*-commutative38.9%
*-commutative38.9%
unpow238.9%
times-frac56.0%
*-commutative56.0%
unpow256.0%
associate-*l*56.0%
Simplified56.0%
associate-*l/62.5%
frac-times44.4%
Applied egg-rr44.4%
associate-/r/44.4%
times-frac62.5%
associate-*r*62.5%
unpow262.5%
associate-/l*72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in M around 0 62.5%
unpow262.5%
associate-*l/78.2%
*-commutative78.2%
associate-/l*83.9%
Simplified83.9%
Final simplification84.8%
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 (sqrt (- 1.0 (/ (* (pow (* M (* 0.5 (/ D d))) 2.0) h) 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 * sqrt((1.0 - ((pow((M * (0.5 * (D / d))), 2.0) * h) / 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 * sqrt((1.0d0 - ((((m * (0.5d0 * (d / d_1))) ** 2.0d0) * h) / 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 * Math.sqrt((1.0 - ((Math.pow((M * (0.5 * (D / d))), 2.0) * h) / l)));
}
M = abs(M) D = abs(D) [M, D] = sort([M, D]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((math.pow((M * (0.5 * (D / d))), 2.0) * h) / l)))
M = abs(M) D = abs(D) M, D = sort([M, D]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64((Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0) * h) / 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 * sqrt((1.0 - ((((M * (0.5 * (D / d))) ^ 2.0) * h) / 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[Sqrt[N[(1.0 - N[(N[(N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
w0 \cdot \sqrt{1 - \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}
\end{array}
Initial program 78.9%
*-commutative78.9%
times-frac79.3%
Simplified79.3%
unpow279.3%
associate-*l*81.6%
div-inv81.6%
associate-*l*81.2%
times-frac81.2%
*-un-lft-identity81.2%
*-commutative81.2%
clear-num81.2%
div-inv81.2%
div-inv81.2%
associate-*l*82.3%
times-frac82.3%
*-un-lft-identity82.3%
*-commutative82.3%
clear-num82.3%
div-inv82.3%
associate-*l*80.0%
Applied egg-rr85.2%
Final simplification85.2%
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 (<= D 2.5e-26)
(* w0 (+ 1.0 (* -0.125 (* (* D (/ D l)) (* (/ M d) (/ (* M h) d))))))
(if (<= D 1.05e+150)
(* w0 (sqrt (- 1.0 (* 0.25 (/ (* D D) (/ (* d (* d l)) (* M (* M h))))))))
(fma -0.125 (* D (/ (* D (* (* h (/ M (/ d M))) (/ w0 d))) l)) w0))))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 (D <= 2.5e-26) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
} else if (D <= 1.05e+150) {
tmp = w0 * sqrt((1.0 - (0.25 * ((D * D) / ((d * (d * l)) / (M * (M * h)))))));
} else {
tmp = fma(-0.125, (D * ((D * ((h * (M / (d / M))) * (w0 / d))) / l)), w0);
}
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 (D <= 2.5e-26) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M / d) * Float64(Float64(M * h) / d)))))); elseif (D <= 1.05e+150) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * Float64(d * l)) / Float64(M * Float64(M * h)))))))); else tmp = fma(-0.125, Float64(D * Float64(Float64(D * Float64(Float64(h * Float64(M / Float64(d / M))) * Float64(w0 / d))) / l)), w0); 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_] := If[LessEqual[D, 2.5e-26], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 1.05e+150], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision] / N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(D * N[(N[(D * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 2.5 \cdot 10^{-26}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right)\right)\right)\\
\mathbf{elif}\;D \leq 1.05 \cdot 10^{+150}:\\
\;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot \left(d \cdot \ell\right)}{M \cdot \left(M \cdot h\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, D \cdot \frac{D \cdot \left(\left(h \cdot \frac{M}{\frac{d}{M}}\right) \cdot \frac{w0}{d}\right)}{\ell}, w0\right)\\
\end{array}
\end{array}
if D < 2.5000000000000001e-26Initial program 81.1%
*-commutative81.1%
times-frac81.1%
Simplified81.1%
Taylor expanded in M around 0 53.7%
associate-*r/53.7%
*-commutative53.7%
associate-*r/53.7%
*-commutative53.7%
associate-/l*52.8%
unpow252.8%
unpow252.8%
*-commutative52.8%
unpow252.8%
Simplified52.8%
Taylor expanded in D around 0 53.7%
*-commutative53.7%
times-frac56.7%
unpow256.7%
associate-*r/59.5%
unpow259.5%
associate-*r*62.0%
unpow262.0%
Simplified62.0%
times-frac74.7%
Applied egg-rr74.7%
if 2.5000000000000001e-26 < D < 1.04999999999999999e150Initial program 67.5%
*-commutative67.5%
times-frac70.5%
Simplified70.5%
Taylor expanded in M around 0 58.1%
associate-*r/58.1%
*-commutative58.1%
associate-*r/58.1%
associate-/l*67.4%
unpow267.4%
*-commutative67.4%
unpow267.4%
associate-*l*76.3%
*-commutative76.3%
unpow276.3%
associate-*l*76.3%
Simplified76.3%
if 1.04999999999999999e150 < D Initial program 75.5%
*-commutative75.5%
times-frac75.5%
Simplified75.5%
Taylor expanded in M around 0 27.0%
fma-def27.0%
times-frac27.2%
*-commutative27.2%
unpow227.2%
associate-/l*40.3%
*-commutative40.3%
*-commutative40.3%
unpow240.3%
times-frac45.0%
*-commutative45.0%
unpow245.0%
associate-*l*49.4%
Simplified49.4%
associate-*l/58.1%
frac-times57.7%
Applied egg-rr57.7%
associate-/r/64.7%
times-frac64.8%
associate-*r*60.6%
unpow260.6%
associate-/l*56.0%
unpow256.0%
Simplified56.0%
Taylor expanded in M around 0 60.6%
unpow260.6%
associate-*l/60.6%
*-commutative60.6%
associate-/l*69.2%
Simplified69.2%
Final simplification74.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 (<= d 4.1e-75) (* w0 (+ 1.0 (* -0.125 (* (* D (/ D l)) (* (/ M d) (/ (* M h) d)))))) (fma -0.125 (* D (/ (* D (* (* h (/ M (/ d M))) (/ w0 d))) l)) w0)))
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 (d <= 4.1e-75) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
} else {
tmp = fma(-0.125, (D * ((D * ((h * (M / (d / M))) * (w0 / d))) / l)), w0);
}
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 (d <= 4.1e-75) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M / d) * Float64(Float64(M * h) / d)))))); else tmp = fma(-0.125, Float64(D * Float64(Float64(D * Float64(Float64(h * Float64(M / Float64(d / M))) * Float64(w0 / d))) / l)), w0); 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_] := If[LessEqual[d, 4.1e-75], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(D * N[(N[(D * N[(N[(h * N[(M / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 4.1 \cdot 10^{-75}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, D \cdot \frac{D \cdot \left(\left(h \cdot \frac{M}{\frac{d}{M}}\right) \cdot \frac{w0}{d}\right)}{\ell}, w0\right)\\
\end{array}
\end{array}
if d < 4.10000000000000002e-75Initial program 76.1%
*-commutative76.1%
times-frac75.1%
Simplified75.1%
Taylor expanded in M around 0 42.7%
associate-*r/42.7%
*-commutative42.7%
associate-*r/42.7%
*-commutative42.7%
associate-/l*42.2%
unpow242.2%
unpow242.2%
*-commutative42.2%
unpow242.2%
Simplified42.2%
Taylor expanded in D around 0 42.7%
*-commutative42.7%
times-frac46.1%
unpow246.1%
associate-*r/49.1%
unpow249.1%
associate-*r*52.0%
unpow252.0%
Simplified52.0%
times-frac66.8%
Applied egg-rr66.8%
if 4.10000000000000002e-75 < d Initial program 85.0%
*-commutative85.0%
times-frac88.7%
Simplified88.7%
Taylor expanded in M around 0 67.6%
fma-def67.6%
times-frac68.7%
*-commutative68.7%
unpow268.7%
associate-/l*73.0%
*-commutative73.0%
*-commutative73.0%
unpow273.0%
times-frac75.9%
*-commutative75.9%
unpow275.9%
associate-*l*77.2%
Simplified77.2%
associate-*l/78.6%
frac-times77.0%
Applied egg-rr77.0%
associate-/r/78.9%
times-frac80.6%
associate-*r*79.3%
unpow279.3%
associate-/l*80.5%
unpow280.5%
Simplified80.5%
Taylor expanded in M around 0 79.3%
unpow279.3%
associate-*l/80.6%
*-commutative80.6%
associate-/l*86.8%
Simplified86.8%
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 (if (<= M 2.1e-185) w0 (* w0 (+ 1.0 (* -0.125 (* h (/ (* (/ D d) (/ D l)) (/ (/ d M) 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 tmp;
if (M <= 2.1e-185) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (h * (((D / d) * (D / l)) / ((d / M) / 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) :: tmp
if (m <= 2.1d-185) then
tmp = w0
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (h * (((d / d_1) * (d / l)) / ((d_1 / m) / 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 tmp;
if (M <= 2.1e-185) {
tmp = w0;
} else {
tmp = w0 * (1.0 + (-0.125 * (h * (((D / d) * (D / l)) / ((d / M) / M)))));
}
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-185: tmp = w0 else: tmp = w0 * (1.0 + (-0.125 * (h * (((D / d) * (D / l)) / ((d / M) / M))))) 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-185) tmp = w0; else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64(Float64(Float64(D / d) * Float64(D / l)) / Float64(Float64(d / M) / 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)
tmp = 0.0;
if (M <= 2.1e-185)
tmp = w0;
else
tmp = w0 * (1.0 + (-0.125 * (h * (((D / d) * (D / l)) / ((d / M) / 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_] := If[LessEqual[M, 2.1e-185], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[(N[(D / d), $MachinePrecision] * N[(D / l), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / M), $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 2.1 \cdot 10^{-185}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \frac{\frac{D}{d} \cdot \frac{D}{\ell}}{\frac{\frac{d}{M}}{M}}\right)\right)\\
\end{array}
\end{array}
if M < 2.1e-185Initial program 82.5%
*-commutative82.5%
times-frac82.1%
Simplified82.1%
Taylor expanded in M around 0 76.5%
if 2.1e-185 < M Initial program 71.4%
*-commutative71.4%
times-frac73.7%
Simplified73.7%
Taylor expanded in M around 0 46.3%
associate-*r/46.3%
*-commutative46.3%
associate-*r/46.3%
*-commutative46.3%
associate-/l*48.7%
unpow248.7%
unpow248.7%
*-commutative48.7%
unpow248.7%
Simplified48.7%
Taylor expanded in D around 0 46.3%
*-commutative46.3%
times-frac51.0%
unpow251.0%
associate-*r/55.3%
unpow255.3%
associate-*r*57.7%
unpow257.7%
Simplified57.7%
Taylor expanded in D around 0 46.3%
times-frac49.8%
unpow249.8%
times-frac46.3%
unpow246.3%
associate-*r*46.9%
*-commutative46.9%
times-frac54.6%
unpow254.6%
*-commutative54.6%
unpow254.6%
associate-/l*54.6%
unpow254.6%
Simplified54.6%
Taylor expanded in D around 0 46.3%
*-commutative46.3%
unpow246.3%
*-commutative46.3%
unpow246.3%
associate-*l*46.9%
times-frac54.6%
associate-/l*54.6%
associate-/l/56.0%
unpow256.0%
associate-*l/60.5%
associate-*r/60.5%
associate-*l/61.2%
*-commutative61.2%
associate-/r/63.7%
*-commutative63.7%
associate-/l*62.4%
*-commutative62.4%
associate-/r*67.2%
Simplified67.2%
Final simplification73.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 (<= d 1.05e-65) (* w0 (+ 1.0 (* -0.125 (* (* D (/ D l)) (* (/ M d) (/ (* M h) d)))))) (* w0 (+ 1.0 (* -0.125 (/ D (/ (* (/ l (* M M)) (/ (* d d) h)) 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 (d <= 1.05e-65) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
} else {
tmp = w0 * (1.0 + (-0.125 * (D / (((l / (M * M)) * ((d * d) / h)) / 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 (d_1 <= 1.05d-65) then
tmp = w0 * (1.0d0 + ((-0.125d0) * ((d * (d / l)) * ((m / d_1) * ((m * h) / d_1)))))
else
tmp = w0 * (1.0d0 + ((-0.125d0) * (d / (((l / (m * m)) * ((d_1 * d_1) / h)) / d))))
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 (d <= 1.05e-65) {
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
} else {
tmp = w0 * (1.0 + (-0.125 * (D / (((l / (M * M)) * ((d * d) / h)) / 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 d <= 1.05e-65: tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d))))) else: tmp = w0 * (1.0 + (-0.125 * (D / (((l / (M * M)) * ((d * d) / h)) / 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 (d <= 1.05e-65) tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(Float64(M / d) * Float64(Float64(M * h) / d)))))); else tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(D / Float64(Float64(Float64(l / Float64(M * M)) * Float64(Float64(d * d) / h)) / 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 (d <= 1.05e-65)
tmp = w0 * (1.0 + (-0.125 * ((D * (D / l)) * ((M / d) * ((M * h) / d)))));
else
tmp = w0 * (1.0 + (-0.125 * (D / (((l / (M * M)) * ((d * d) / h)) / 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[d, 1.05e-65], N[(w0 * N[(1.0 + N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * N[(1.0 + N[(-0.125 * N[(D / N[(N[(N[(l / N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M = |M|\\
D = |D|\\
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq 1.05 \cdot 10^{-65}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{M \cdot h}{d}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\frac{\ell}{M \cdot M} \cdot \frac{d \cdot d}{h}}{D}}\right)\\
\end{array}
\end{array}
if d < 1.05000000000000001e-65Initial program 76.4%
*-commutative76.4%
times-frac75.4%
Simplified75.4%
Taylor expanded in M around 0 42.8%
associate-*r/42.8%
*-commutative42.8%
associate-*r/42.8%
*-commutative42.8%
associate-/l*42.3%
unpow242.3%
unpow242.3%
*-commutative42.3%
unpow242.3%
Simplified42.3%
Taylor expanded in D around 0 42.8%
*-commutative42.8%
times-frac46.2%
unpow246.2%
associate-*r/49.2%
unpow249.2%
associate-*r*52.0%
unpow252.0%
Simplified52.0%
times-frac66.6%
Applied egg-rr66.6%
if 1.05000000000000001e-65 < d Initial program 84.6%
*-commutative84.6%
times-frac88.4%
Simplified88.4%
Taylor expanded in M around 0 69.2%
associate-*r/69.2%
*-commutative69.2%
associate-*r/69.2%
*-commutative69.2%
associate-/l*71.8%
unpow271.8%
unpow271.8%
*-commutative71.8%
unpow271.8%
Simplified71.8%
*-un-lft-identity71.8%
associate-/l*78.3%
times-frac78.4%
Applied egg-rr78.4%
Final simplification70.2%
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+147) w0 (* -0.125 (* (* D (* (/ D d) (* h (* M (/ M d))))) (/ 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 <= 2.1e+147) {
tmp = w0;
} else {
tmp = -0.125 * ((D * ((D / d) * (h * (M * (M / d))))) * (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 <= 2.1d+147) then
tmp = w0
else
tmp = (-0.125d0) * ((d * ((d / d_1) * (h * (m * (m / d_1))))) * (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 <= 2.1e+147) {
tmp = w0;
} else {
tmp = -0.125 * ((D * ((D / d) * (h * (M * (M / d))))) * (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 <= 2.1e+147: tmp = w0 else: tmp = -0.125 * ((D * ((D / d) * (h * (M * (M / d))))) * (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 <= 2.1e+147) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(Float64(D / d) * Float64(h * Float64(M * Float64(M / d))))) * Float64(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 <= 2.1e+147)
tmp = w0;
else
tmp = -0.125 * ((D * ((D / d) * (h * (M * (M / d))))) * (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, 2.1e+147], w0, N[(-0.125 * N[(N[(D * N[(N[(D / d), $MachinePrecision] * N[(h * N[(M * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / l), $MachinePrecision]), $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^{+147}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(M \cdot \frac{M}{d}\right)\right)\right)\right) \cdot \frac{w0}{\ell}\right)\\
\end{array}
\end{array}
if M < 2.10000000000000006e147Initial program 79.5%
*-commutative79.5%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 72.5%
if 2.10000000000000006e147 < M Initial program 72.8%
*-commutative72.8%
times-frac72.7%
Simplified72.7%
Taylor expanded in M around 0 32.8%
associate-*r/32.8%
*-commutative32.8%
associate-*r/32.8%
*-commutative32.8%
associate-/l*32.8%
unpow232.8%
unpow232.8%
*-commutative32.8%
unpow232.8%
Simplified32.8%
Taylor expanded in D around 0 32.8%
*-commutative32.8%
times-frac33.0%
unpow233.0%
associate-*r/37.0%
unpow237.0%
associate-*r*45.2%
unpow245.2%
Simplified45.2%
Taylor expanded in D around inf 32.8%
Simplified32.9%
Taylor expanded in D around 0 32.8%
associate-/l*32.8%
*-rgt-identity32.8%
*-commutative32.8%
times-frac32.4%
unpow232.4%
unpow232.4%
associate-*l*32.9%
*-commutative32.9%
times-frac37.6%
*-commutative37.6%
times-frac37.6%
Simplified41.6%
Final simplification69.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 (if (<= M 1.1e+137) w0 (* -0.125 (* (* D (/ D l)) (/ w0 (/ (* d d) (* h (* M 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 tmp;
if (M <= 1.1e+137) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d * d) / (h * (M * 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) :: tmp
if (m <= 1.1d+137) then
tmp = w0
else
tmp = (-0.125d0) * ((d * (d / l)) * (w0 / ((d_1 * d_1) / (h * (m * 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 tmp;
if (M <= 1.1e+137) {
tmp = w0;
} else {
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d * d) / (h * (M * M)))));
}
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 <= 1.1e+137: tmp = w0 else: tmp = -0.125 * ((D * (D / l)) * (w0 / ((d * d) / (h * (M * M))))) 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 <= 1.1e+137) tmp = w0; else tmp = Float64(-0.125 * Float64(Float64(D * Float64(D / l)) * Float64(w0 / Float64(Float64(d * d) / Float64(h * Float64(M * 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)
tmp = 0.0;
if (M <= 1.1e+137)
tmp = w0;
else
tmp = -0.125 * ((D * (D / l)) * (w0 / ((d * d) / (h * (M * 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_] := If[LessEqual[M, 1.1e+137], w0, N[(-0.125 * N[(N[(D * N[(D / l), $MachinePrecision]), $MachinePrecision] * N[(w0 / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $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 1.1 \cdot 10^{+137}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\left(D \cdot \frac{D}{\ell}\right) \cdot \frac{w0}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\right)\\
\end{array}
\end{array}
if M < 1.10000000000000008e137Initial program 79.5%
*-commutative79.5%
times-frac80.0%
Simplified80.0%
Taylor expanded in M around 0 72.5%
if 1.10000000000000008e137 < M Initial program 72.8%
*-commutative72.8%
times-frac72.7%
Simplified72.7%
Taylor expanded in M around 0 32.8%
associate-*r/32.8%
*-commutative32.8%
associate-*r/32.8%
*-commutative32.8%
associate-/l*32.8%
unpow232.8%
unpow232.8%
*-commutative32.8%
unpow232.8%
Simplified32.8%
Taylor expanded in D around 0 32.8%
*-commutative32.8%
times-frac33.0%
unpow233.0%
associate-*r/37.0%
unpow237.0%
associate-*r*45.2%
unpow245.2%
Simplified45.2%
Taylor expanded in D around inf 32.8%
Simplified32.9%
Taylor expanded in D around 0 32.8%
*-commutative32.8%
times-frac33.0%
unpow233.0%
associate-*r/37.0%
associate-/l*37.0%
unpow237.0%
unpow237.0%
*-commutative37.0%
Simplified37.0%
Final simplification69.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)
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 78.9%
*-commutative78.9%
times-frac79.3%
Simplified79.3%
Taylor expanded in M around 0 68.8%
Final simplification68.8%
herbie shell --seed 2023250
(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))))))