
(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 16 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}
(FPCore (w0 M D h l d)
:precision binary64
(*
w0
(sqrt
(fma
(/ (/ (* M D) (* d -2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ 1.0 h))
1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((((M * D) / (d * -2.0)) / l), (((M * D) / (d * 2.0)) / (1.0 / h)), 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / Float64(d * -2.0)) / l), Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(1.0 / h)), 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell}, \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}, 1\right)}
\end{array}
Initial program 79.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites91.8%
Final simplification91.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+172) (* (* M (* (* h (* D D)) (/ -0.125 d))) (* w0 (/ M (* d l)))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
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) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+172)) then
tmp = (m * ((h * (d * d)) * ((-0.125d0) / d_1))) * (w0 * (m / (d_1 * l)))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172: tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+172) tmp = Float64(Float64(M * Float64(Float64(h * Float64(D * D)) * Float64(-0.125 / d))) * Float64(w0 * Float64(M / Float64(d * l)))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+172) tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+172], N[(N[(M * N[(N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 * N[(M / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\
\;\;\;\;\left(M \cdot \left(\left(h \cdot \left(D \cdot D\right)\right) \cdot \frac{-0.125}{d}\right)\right) \cdot \left(w0 \cdot \frac{M}{d \cdot \ell}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -5.0000000000000001e172Initial program 55.2%
Taylor expanded in M around 0
Applied rewrites4.8%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.0%
Taylor expanded in D around inf
Applied rewrites36.6%
Applied rewrites44.4%
if -5.0000000000000001e172 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.4%
Taylor expanded in M around 0
Applied rewrites90.2%
Final simplification80.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+172) (* (* D D) (* (* w0 (/ M (* d l))) (* M (/ (* h -0.125) d)))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
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) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+172)) then
tmp = (d * d) * ((w0 * (m / (d_1 * l))) * (m * ((h * (-0.125d0)) / d_1)))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172: tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+172) tmp = Float64(Float64(D * D) * Float64(Float64(w0 * Float64(M / Float64(d * l))) * Float64(M * Float64(Float64(h * -0.125) / d)))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+172) tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+172], N[(N[(D * D), $MachinePrecision] * N[(N[(w0 * N[(M / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(h * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(\left(w0 \cdot \frac{M}{d \cdot \ell}\right) \cdot \left(M \cdot \frac{h \cdot -0.125}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -5.0000000000000001e172Initial program 55.2%
Taylor expanded in M around 0
Applied rewrites4.8%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.0%
Taylor expanded in D around inf
Applied rewrites36.6%
Applied rewrites44.2%
if -5.0000000000000001e172 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.4%
Taylor expanded in M around 0
Applied rewrites90.2%
Final simplification80.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+114) (fma (* D D) (/ (* -0.125 (* M (* h (* w0 M)))) (* d (* d l))) w0) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+114) {
tmp = fma((D * D), ((-0.125 * (M * (h * (w0 * M)))) / (d * (d * l))), w0);
} else {
tmp = w0 * 1.0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+114) tmp = fma(Float64(D * D), Float64(Float64(-0.125 * Float64(M * Float64(h * Float64(w0 * M)))) / Float64(d * Float64(d * l))), w0); else tmp = Float64(w0 * 1.0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+114], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * N[(h * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(M \cdot \left(h \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e114Initial program 56.7%
Taylor expanded in M around 0
Applied rewrites4.9%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites40.8%
Applied rewrites42.8%
if -2e114 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.2%
Taylor expanded in M around 0
Applied rewrites91.1%
Final simplification80.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+114) (fma (* D D) (/ (* -0.125 (* h (* M (* w0 M)))) (* d (* d l))) w0) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+114) {
tmp = fma((D * D), ((-0.125 * (h * (M * (w0 * M)))) / (d * (d * l))), w0);
} else {
tmp = w0 * 1.0;
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+114) tmp = fma(Float64(D * D), Float64(Float64(-0.125 * Float64(h * Float64(M * Float64(w0 * M)))) / Float64(d * Float64(d * l))), w0); else tmp = Float64(w0 * 1.0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+114], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -2e114Initial program 56.7%
Taylor expanded in M around 0
Applied rewrites4.9%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites40.8%
if -2e114 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.2%
Taylor expanded in M around 0
Applied rewrites91.1%
Final simplification79.5%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+210) (* (* D D) (* (* -0.125 (* M (* M h))) (/ w0 (* l (* d d))))) (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210) {
tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
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) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-2d+210)) then
tmp = (d * d) * (((-0.125d0) * (m * (m * h))) * (w0 / (l * (d_1 * d_1))))
else
tmp = w0 * 1.0d0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210) {
tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))));
} else {
tmp = w0 * 1.0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210: tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d)))) else: tmp = w0 * 1.0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+210) tmp = Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * Float64(M * h))) * Float64(w0 / Float64(l * Float64(d * d))))); else tmp = Float64(w0 * 1.0); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -2e+210) tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d)))); else tmp = w0 * 1.0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+210], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+210}:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(\left(-0.125 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \cdot \frac{w0}{\ell \cdot \left(d \cdot d\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot 1\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.99999999999999985e210Initial program 52.7%
Taylor expanded in M around 0
Applied rewrites4.7%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites42.5%
Taylor expanded in D around inf
Applied rewrites36.8%
Applied rewrites40.7%
if -1.99999999999999985e210 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 86.6%
Taylor expanded in M around 0
Applied rewrites89.0%
Final simplification78.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* M D) 2.5e-11) (* w0 (sqrt (fma (* (/ M d) (/ (* D (* M D)) (* -4.0 (* d l)))) h 1.0))) (* w0 (sqrt (fma (/ D d) (* (/ (* M (* M D)) (* d l)) (* h -0.25)) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 2.5e-11) {
tmp = w0 * sqrt(fma(((M / d) * ((D * (M * D)) / (-4.0 * (d * l)))), h, 1.0));
} else {
tmp = w0 * sqrt(fma((D / d), (((M * (M * D)) / (d * l)) * (h * -0.25)), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 2.5e-11) tmp = Float64(w0 * sqrt(fma(Float64(Float64(M / d) * Float64(Float64(D * Float64(M * D)) / Float64(-4.0 * Float64(d * l)))), h, 1.0))); else tmp = Float64(w0 * sqrt(fma(Float64(D / d), Float64(Float64(Float64(M * Float64(M * D)) / Float64(d * l)) * Float64(h * -0.25)), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 2.5e-11], N[(w0 * N[Sqrt[N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(D / d), $MachinePrecision] * N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 2.5 \cdot 10^{-11}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M}{d} \cdot \frac{D \cdot \left(M \cdot D\right)}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 2.50000000000000009e-11Initial program 78.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites93.7%
Applied rewrites74.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f6485.9
Applied rewrites85.9%
if 2.50000000000000009e-11 < (*.f64 M D) Initial program 83.5%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval76.9
Applied rewrites76.9%
Taylor expanded in h around inf
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
lft-mult-inverseN/A
lower-fma.f64N/A
Applied rewrites53.0%
Applied rewrites70.0%
Final simplification82.3%
(FPCore (w0 M D h l d) :precision binary64 (let* ((t_0 (/ (* M D) d))) (* w0 (sqrt (fma (* t_0 (/ t_0 (* l -4.0))) h 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / d;
return w0 * sqrt(fma((t_0 * (t_0 / (l * -4.0))), h, 1.0));
}
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / d) return Float64(w0 * sqrt(fma(Float64(t_0 * Float64(t_0 / Float64(l * -4.0))), h, 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(N[(t$95$0 * N[(t$95$0 / N[(l * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
w0 \cdot \sqrt{\mathsf{fma}\left(t\_0 \cdot \frac{t\_0}{\ell \cdot -4}, h, 1\right)}
\end{array}
\end{array}
Initial program 79.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites91.8%
Applied rewrites73.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites88.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f64N/A
lower-*.f6491.0
Applied rewrites91.0%
Final simplification91.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* M D) 1e-187) (* w0 1.0) (* w0 (sqrt (fma (* (* M D) (/ (* M D) (* d (* -4.0 (* d l))))) h 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-187) {
tmp = w0 * 1.0;
} else {
tmp = w0 * sqrt(fma(((M * D) * ((M * D) / (d * (-4.0 * (d * l))))), h, 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 1e-187) tmp = Float64(w0 * 1.0); else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) * Float64(Float64(M * D) / Float64(d * Float64(-4.0 * Float64(d * l))))), h, 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-187], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 10^{-187}:\\
\;\;\;\;w0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot \left(-4 \cdot \left(d \cdot \ell\right)\right)}, h, 1\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 1e-187Initial program 80.0%
Taylor expanded in M around 0
Applied rewrites76.5%
if 1e-187 < (*.f64 M D) Initial program 78.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites89.9%
Applied rewrites72.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6481.1
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
metadata-eval81.1
Applied rewrites81.1%
Final simplification78.1%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* M D) 2e-120) (* w0 1.0) (* w0 (sqrt (fma D (* (* h -0.25) (/ (* M (* M D)) (* d (* d l)))) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 2e-120) {
tmp = w0 * 1.0;
} else {
tmp = w0 * sqrt(fma(D, ((h * -0.25) * ((M * (M * D)) / (d * (d * l)))), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 2e-120) tmp = Float64(w0 * 1.0); else tmp = Float64(w0 * sqrt(fma(D, Float64(Float64(h * -0.25) * Float64(Float64(M * Float64(M * D)) / Float64(d * Float64(d * l)))), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 2e-120], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(D * N[(N[(h * -0.25), $MachinePrecision] * N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-120}:\\
\;\;\;\;w0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, \left(h \cdot -0.25\right) \cdot \frac{M \cdot \left(M \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 1.99999999999999996e-120Initial program 78.5%
Taylor expanded in M around 0
Applied rewrites76.4%
if 1.99999999999999996e-120 < (*.f64 M D) Initial program 81.8%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval76.6
Applied rewrites76.6%
Taylor expanded in h around inf
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
lft-mult-inverseN/A
lower-fma.f64N/A
Applied rewrites57.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.8
Applied rewrites70.8%
Final simplification74.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* M D) 1e-187) (* w0 1.0) (* w0 (sqrt (fma D (* M (* (* h -0.25) (/ (* M D) (* l (* d d))))) 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((M * D) <= 1e-187) {
tmp = w0 * 1.0;
} else {
tmp = w0 * sqrt(fma(D, (M * ((h * -0.25) * ((M * D) / (l * (d * d))))), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(M * D) <= 1e-187) tmp = Float64(w0 * 1.0); else tmp = Float64(w0 * sqrt(fma(D, Float64(M * Float64(Float64(h * -0.25) * Float64(Float64(M * D) / Float64(l * Float64(d * d))))), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-187], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(D * N[(M * N[(N[(h * -0.25), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot D \leq 10^{-187}:\\
\;\;\;\;w0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, M \cdot \left(\left(h \cdot -0.25\right) \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\right)}\right), 1\right)}\\
\end{array}
\end{array}
if (*.f64 M D) < 1e-187Initial program 80.0%
Taylor expanded in M around 0
Applied rewrites76.5%
if 1e-187 < (*.f64 M D) Initial program 78.3%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval73.8
Applied rewrites73.8%
Taylor expanded in h around inf
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
lft-mult-inverseN/A
lower-fma.f64N/A
Applied rewrites59.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.8
Applied rewrites71.2%
Applied rewrites78.1%
Final simplification77.1%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (fma (/ (* (* M D) 0.5) d) (* h (/ (* M D) (* (* d -2.0) l))) 1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((((M * D) * 0.5) / d), (h * ((M * D) / ((d * -2.0) * l))), 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) * 0.5) / d), Float64(h * Float64(Float64(M * D) / Float64(Float64(d * -2.0) * l))), 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(N[(d * -2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, h \cdot \frac{M \cdot D}{\left(d \cdot -2\right) \cdot \ell}, 1\right)}
\end{array}
Initial program 79.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites91.8%
lift-fma.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
remove-double-divN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites88.8%
Final simplification88.8%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (fma (* (/ (* M D) d) (/ (* M D) (* -4.0 (* d l)))) h 1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((((M * D) / d) * ((M * D) / (-4.0 * (d * l)))), h, 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / d) * Float64(Float64(M * D) / Float64(-4.0 * Float64(d * l)))), h, 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)}
\end{array}
Initial program 79.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites91.8%
Applied rewrites73.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites88.8%
Final simplification88.8%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (fma (* (/ (* M D) (* -4.0 (* d l))) (* D (/ M d))) h 1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((((M * D) / (-4.0 * (d * l))) * (D * (M / d))), h, 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / Float64(-4.0 * Float64(d * l))) * Float64(D * Float64(M / d))), h, 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{M}{d}\right), h, 1\right)}
\end{array}
Initial program 79.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
div-invN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites91.8%
Applied rewrites73.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites88.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
Final simplification87.7%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (fma (/ D d) (* (/ (* M (* M D)) (* d l)) (* h -0.25)) 1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(fma((D / d), (((M * (M * D)) / (d * l)) * (h * -0.25)), 1.0));
}
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(fma(Float64(D / d), Float64(Float64(Float64(M * Float64(M * D)) / Float64(d * l)) * Float64(h * -0.25)), 1.0))) end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(D / d), $MachinePrecision] * N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)}
\end{array}
Initial program 79.4%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
swap-sqrN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval71.3
Applied rewrites71.3%
Taylor expanded in h around inf
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
lft-mult-inverseN/A
lower-fma.f64N/A
Applied rewrites64.4%
Applied rewrites79.5%
(FPCore (w0 M D h l d) :precision binary64 (* w0 1.0))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * 1.0;
}
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 * 1.0d0
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * 1.0;
}
def code(w0, M, D, h, l, d): return w0 * 1.0
function code(w0, M, D, h, l, d) return Float64(w0 * 1.0) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * 1.0; end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * 1.0), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot 1
\end{array}
Initial program 79.4%
Taylor expanded in M around 0
Applied rewrites71.2%
herbie shell --seed 2024222
(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))))))