
(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 15 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
(let* ((t_0 (/ (* M D) (* 2.0 d))))
(if (<= (- 1.0 (* (pow t_0 2.0) (/ h l))) 5e+245)
(* w0 (sqrt (- 1.0 (* (/ h l) (* (/ (* M D) d) (/ (* M D) (* d 4.0)))))))
(* w0 (sqrt (fma t_0 (/ (/ (* (* M D) h) (* 2.0 d)) (- l)) 1.0))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if ((1.0 - (pow(t_0, 2.0) * (h / l))) <= 5e+245) {
tmp = w0 * sqrt((1.0 - ((h / l) * (((M * D) / d) * ((M * D) / (d * 4.0))))));
} else {
tmp = w0 * sqrt(fma(t_0, ((((M * D) * h) / (2.0 * d)) / -l), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (Float64(1.0 - Float64((t_0 ^ 2.0) * Float64(h / l))) <= 5e+245) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(Float64(M * D) / d) * Float64(Float64(M * D) / Float64(d * 4.0))))))); else tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(Float64(Float64(M * D) * h) / Float64(2.0 * d)) / Float64(-l)), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 - N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+245], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;1 - {t\_0}^{2} \cdot \frac{h}{\ell} \leq 5 \cdot 10^{+245}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{d \cdot 4}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{\frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 5.00000000000000034e245Initial program 99.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.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-eval82.9
Applied egg-rr82.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6499.4
Applied egg-rr99.4%
if 5.00000000000000034e245 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 47.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr71.0%
Final simplification90.4%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ (* M D) (* 2.0 d))))
(if (<= (- 1.0 (* (pow t_0 2.0) (/ h l))) 5e+245)
(* w0 (sqrt (- 1.0 (* (/ h l) (* (/ (* M D) d) (/ (* M D) (* d 4.0)))))))
(* w0 (sqrt (fma t_0 (/ (* -0.5 (* (* M D) h)) (* d l)) 1.0))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if ((1.0 - (pow(t_0, 2.0) * (h / l))) <= 5e+245) {
tmp = w0 * sqrt((1.0 - ((h / l) * (((M * D) / d) * ((M * D) / (d * 4.0))))));
} else {
tmp = w0 * sqrt(fma(t_0, ((-0.5 * ((M * D) * h)) / (d * l)), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (Float64(1.0 - Float64((t_0 ^ 2.0) * Float64(h / l))) <= 5e+245) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(Float64(M * D) / d) * Float64(Float64(M * D) / Float64(d * 4.0))))))); else tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(-0.5 * Float64(Float64(M * D) * h)) / Float64(d * l)), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 - N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+245], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(-0.5 * N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;1 - {t\_0}^{2} \cdot \frac{h}{\ell} \leq 5 \cdot 10^{+245}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{d \cdot 4}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{-0.5 \cdot \left(\left(M \cdot D\right) \cdot h\right)}{d \cdot \ell}, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 5.00000000000000034e245Initial program 99.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.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-eval82.9
Applied egg-rr82.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6499.4
Applied egg-rr99.4%
if 5.00000000000000034e245 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 47.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr71.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6468.4
Simplified68.4%
Final simplification89.6%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ (* M D) (* 2.0 d))))
(if (<= (- 1.0 (* (pow t_0 2.0) (/ h l))) 5e+245)
(* w0 (sqrt (fma (* (/ M d) (* (* D (/ M d)) (/ (* h -0.25) l))) D 1.0)))
(* w0 (sqrt (fma t_0 (/ (* -0.5 (* (* M D) h)) (* d l)) 1.0))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if ((1.0 - (pow(t_0, 2.0) * (h / l))) <= 5e+245) {
tmp = w0 * sqrt(fma(((M / d) * ((D * (M / d)) * ((h * -0.25) / l))), D, 1.0));
} else {
tmp = w0 * sqrt(fma(t_0, ((-0.5 * ((M * D) * h)) / (d * l)), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (Float64(1.0 - Float64((t_0 ^ 2.0) * Float64(h / l))) <= 5e+245) tmp = Float64(w0 * sqrt(fma(Float64(Float64(M / d) * Float64(Float64(D * Float64(M / d)) * Float64(Float64(h * -0.25) / l))), D, 1.0))); else tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(-0.5 * Float64(Float64(M * D) * h)) / Float64(d * l)), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 - N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+245], N[(w0 * N[Sqrt[N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * -0.25), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(-0.5 * N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;1 - {t\_0}^{2} \cdot \frac{h}{\ell} \leq 5 \cdot 10^{+245}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M}{d} \cdot \left(\left(D \cdot \frac{M}{d}\right) \cdot \frac{h \cdot -0.25}{\ell}\right), D, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{-0.5 \cdot \left(\left(M \cdot D\right) \cdot h\right)}{d \cdot \ell}, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 5.00000000000000034e245Initial program 99.4%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified55.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr74.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied egg-rr89.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6498.9
Applied egg-rr98.9%
if 5.00000000000000034e245 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 47.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr71.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6468.4
Simplified68.4%
Final simplification89.2%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ (* M D) (* 2.0 d))))
(if (<= (- 1.0 (* (pow t_0 2.0) (/ h l))) 1.0)
w0
(* w0 (sqrt (fma t_0 (/ (* -0.5 (* (* M D) h)) (* d l)) 1.0))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if ((1.0 - (pow(t_0, 2.0) * (h / l))) <= 1.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(t_0, ((-0.5 * ((M * D) * h)) / (d * l)), 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (Float64(1.0 - Float64((t_0 ^ 2.0) * Float64(h / l))) <= 1.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(-0.5 * Float64(Float64(M * D) * h)) / Float64(d * l)), 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 - N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], w0, N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(-0.5 * N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;1 - {t\_0}^{2} \cdot \frac{h}{\ell} \leq 1:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{-0.5 \cdot \left(\left(M \cdot D\right) \cdot h\right)}{d \cdot \ell}, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 1Initial program 99.4%
Taylor expanded in M around 0
Simplified99.8%
*-rgt-identity99.8
Applied egg-rr99.8%
if 1 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 56.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr69.9%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6467.4
Simplified67.4%
Final simplification87.5%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1.0) w0 (* w0 (sqrt (fma (/ (* M (/ (* (* M D) (* h -0.25)) (* d l))) d) D 1.0)))))
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))) <= 1.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(((M * (((M * D) * (h * -0.25)) / (d * l))) / d), D, 1.0));
}
return tmp;
}
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))) <= 1.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * Float64(Float64(Float64(M * D) * Float64(h * -0.25)) / Float64(d * l))) / d), D, 1.0))); end return tmp end
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], 1.0], w0, N[(w0 * N[Sqrt[N[(N[(N[(M * N[(N[(N[(M * D), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 1:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot \frac{\left(M \cdot D\right) \cdot \left(h \cdot -0.25\right)}{d \cdot \ell}}{d}, D, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 1Initial program 99.4%
Taylor expanded in M around 0
Simplified99.8%
*-rgt-identity99.8
Applied egg-rr99.8%
if 1 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 56.4%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified40.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr51.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied egg-rr61.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied egg-rr65.4%
Final simplification86.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1.0) w0 (* w0 (sqrt (fma (/ (* M (* (* M D) (* h -0.25))) (* d (* d l))) D 1.0)))))
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))) <= 1.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(((M * ((M * D) * (h * -0.25))) / (d * (d * l))), D, 1.0));
}
return tmp;
}
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))) <= 1.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * Float64(Float64(M * D) * Float64(h * -0.25))) / Float64(d * Float64(d * l))), D, 1.0))); end return tmp end
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], 1.0], w0, N[(w0 * N[Sqrt[N[(N[(N[(M * N[(N[(M * D), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 1:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot \left(\left(M \cdot D\right) \cdot \left(h \cdot -0.25\right)\right)}{d \cdot \left(d \cdot \ell\right)}, D, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 1Initial program 99.4%
Taylor expanded in M around 0
Simplified99.8%
*-rgt-identity99.8
Applied egg-rr99.8%
if 1 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 56.4%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified40.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr51.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied egg-rr61.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-/.f64N/A
Applied egg-rr60.3%
Final simplification84.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1.0) w0 (* w0 (sqrt (fma (* (* M D) (/ (* M (* h -0.25)) (* d (* d l)))) D 1.0)))))
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))) <= 1.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(((M * D) * ((M * (h * -0.25)) / (d * (d * l)))), D, 1.0));
}
return tmp;
}
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))) <= 1.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) * Float64(Float64(M * Float64(h * -0.25)) / Float64(d * Float64(d * l)))), D, 1.0))); end return tmp end
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], 1.0], w0, N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 1:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(M \cdot D\right) \cdot \frac{M \cdot \left(h \cdot -0.25\right)}{d \cdot \left(d \cdot \ell\right)}, D, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 1Initial program 99.4%
Taylor expanded in M around 0
Simplified99.8%
*-rgt-identity99.8
Applied egg-rr99.8%
if 1 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 56.4%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified40.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr51.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lower-/.f6461.9
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6461.9
Applied egg-rr61.9%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) 1.0) w0 (* w0 (sqrt (fma (* D (/ (* M (* -0.25 (* M h))) (* d (* d l)))) D 1.0)))))
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))) <= 1.0) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma((D * ((M * (-0.25 * (M * h))) / (d * (d * l)))), D, 1.0));
}
return tmp;
}
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))) <= 1.0) tmp = w0; else tmp = Float64(w0 * sqrt(fma(Float64(D * Float64(Float64(M * Float64(-0.25 * Float64(M * h))) / Float64(d * Float64(d * l)))), D, 1.0))); end return tmp end
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], 1.0], w0, N[(w0 * N[Sqrt[N[(N[(D * N[(N[(M * N[(-0.25 * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 1:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D \cdot \frac{M \cdot \left(-0.25 \cdot \left(M \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}, D, 1\right)}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) < 1Initial program 99.4%
Taylor expanded in M around 0
Simplified99.8%
*-rgt-identity99.8
Applied egg-rr99.8%
if 1 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))) Initial program 56.4%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified40.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr51.2%
Final simplification81.4%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+283) (* (* D (/ (* M (* w0 (* M h))) (* d (* d l)))) (* D -0.125)) w0))
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)) <= -5e+283) {
tmp = (D * ((M * (w0 * (M * h))) / (d * (d * l)))) * (D * -0.125);
} else {
tmp = w0;
}
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) / (2.0d0 * d_1)) ** 2.0d0) * (h / l)) <= (-5d+283)) then
tmp = (d * ((m * (w0 * (m * h))) / (d_1 * (d_1 * l)))) * (d * (-0.125d0))
else
tmp = w0
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) / (2.0 * d)), 2.0) * (h / l)) <= -5e+283) {
tmp = (D * ((M * (w0 * (M * h))) / (d * (d * l)))) * (D * -0.125);
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+283: tmp = (D * ((M * (w0 * (M * h))) / (d * (d * l)))) * (D * -0.125) else: tmp = w0 return tmp
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)) <= -5e+283) tmp = Float64(Float64(D * Float64(Float64(M * Float64(w0 * Float64(M * h))) / Float64(d * Float64(d * l)))) * Float64(D * -0.125)); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)) <= -5e+283) tmp = (D * ((M * (w0 * (M * h))) / (d * (d * l)))) * (D * -0.125); else tmp = w0; end tmp_2 = tmp; end
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], -5e+283], N[(N[(D * N[(N[(M * N[(w0 * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * -0.125), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+283}:\\
\;\;\;\;\left(D \cdot \frac{M \cdot \left(w0 \cdot \left(M \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \left(D \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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.0000000000000004e283Initial program 57.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
Simplified45.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
Applied egg-rr51.5%
Taylor expanded in D around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6445.3
Simplified45.3%
Applied egg-rr54.6%
if -5.0000000000000004e283 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 92.0%
Taylor expanded in M around 0
Simplified90.3%
*-rgt-identity90.3
Applied egg-rr90.3%
Final simplification81.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 2e+171) w0 (fma (* (* D D) -0.125) (/ (* h (/ (* M (* M w0)) (* d l))) d) w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 2e+171) {
tmp = w0;
} else {
tmp = fma(((D * D) * -0.125), ((h * ((M * (M * w0)) / (d * l))) / d), w0);
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 2e+171) tmp = w0; else tmp = fma(Float64(Float64(D * D) * -0.125), Float64(Float64(h * Float64(Float64(M * Float64(M * w0)) / Float64(d * l))) / d), w0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2e+171], w0, N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(h * N[(N[(M * N[(M * w0), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 2 \cdot 10^{+171}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(D \cdot D\right) \cdot -0.125, \frac{h \cdot \frac{M \cdot \left(M \cdot w0\right)}{d \cdot \ell}}{d}, w0\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 1.99999999999999991e171Initial program 84.1%
Taylor expanded in M around 0
Simplified74.7%
*-rgt-identity74.7
Applied egg-rr74.7%
if 1.99999999999999991e171 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 73.5%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Simplified61.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
Applied egg-rr69.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6469.8
Applied egg-rr69.8%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 2e+171) w0 (fma (* D D) (* (/ (* M (* M w0)) (* d l)) (/ (* h -0.125) d)) w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 2e+171) {
tmp = w0;
} else {
tmp = fma((D * D), (((M * (M * w0)) / (d * l)) * ((h * -0.125) / d)), w0);
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 2e+171) tmp = w0; else tmp = fma(Float64(D * D), Float64(Float64(Float64(M * Float64(M * w0)) / Float64(d * l)) * Float64(Float64(h * -0.125) / d)), w0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2e+171], w0, N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * N[(M * w0), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(N[(h * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 2 \cdot 10^{+171}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{M \cdot \left(M \cdot w0\right)}{d \cdot \ell} \cdot \frac{h \cdot -0.125}{d}, w0\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 1.99999999999999991e171Initial program 84.1%
Taylor expanded in M around 0
Simplified74.7%
*-rgt-identity74.7
Applied egg-rr74.7%
if 1.99999999999999991e171 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 73.5%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Simplified61.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6469.8
Applied egg-rr69.8%
Final simplification74.2%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 1e+173) w0 (fma (* D D) (* (* h -0.125) (/ (* M (* M w0)) (* d (* d l)))) w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 1e+173) {
tmp = w0;
} else {
tmp = fma((D * D), ((h * -0.125) * ((M * (M * w0)) / (d * (d * l)))), w0);
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 1e+173) tmp = w0; else tmp = fma(Float64(D * D), Float64(Float64(h * -0.125) * Float64(Float64(M * Float64(M * w0)) / Float64(d * Float64(d * l)))), w0); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 1e+173], w0, N[(N[(D * D), $MachinePrecision] * N[(N[(h * -0.125), $MachinePrecision] * N[(N[(M * N[(M * w0), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{+173}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \left(h \cdot -0.125\right) \cdot \frac{M \cdot \left(M \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 1e173Initial program 83.8%
Taylor expanded in M around 0
Simplified74.4%
*-rgt-identity74.4
Applied egg-rr74.4%
if 1e173 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 76.3%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Simplified63.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.7
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6472.0
Applied egg-rr72.0%
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ (* M D) (* 2.0 d)) 5e+190) w0 (* (* (* D D) -0.125) (/ (* w0 (* h (* M M))) (* l (* d d))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (((M * D) / (2.0 * d)) <= 5e+190) {
tmp = w0;
} else {
tmp = ((D * D) * -0.125) * ((w0 * (h * (M * M))) / (l * (d * d)));
}
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) / (2.0d0 * d_1)) <= 5d+190) then
tmp = w0
else
tmp = ((d * d) * (-0.125d0)) * ((w0 * (h * (m * m))) / (l * (d_1 * d_1)))
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 (((M * D) / (2.0 * d)) <= 5e+190) {
tmp = w0;
} else {
tmp = ((D * D) * -0.125) * ((w0 * (h * (M * M))) / (l * (d * d)));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if ((M * D) / (2.0 * d)) <= 5e+190: tmp = w0 else: tmp = ((D * D) * -0.125) * ((w0 * (h * (M * M))) / (l * (d * d))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(Float64(M * D) / Float64(2.0 * d)) <= 5e+190) tmp = w0; else tmp = Float64(Float64(Float64(D * D) * -0.125) * Float64(Float64(w0 * Float64(h * Float64(M * M))) / Float64(l * Float64(d * d)))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (((M * D) / (2.0 * d)) <= 5e+190) tmp = w0; else tmp = ((D * D) * -0.125) * ((w0 * (h * (M * M))) / (l * (d * d))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 5e+190], w0, N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 5 \cdot 10^{+190}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \frac{w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 5.00000000000000036e190Initial program 83.5%
Taylor expanded in M around 0
Simplified73.8%
*-rgt-identity73.8
Applied egg-rr73.8%
if 5.00000000000000036e190 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) Initial program 78.6%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Simplified69.2%
Taylor expanded in D around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.2
Simplified69.2%
Final simplification73.4%
(FPCore (w0 M D h l d) :precision binary64 (if (<= D 4.9e-54) w0 (* w0 (sqrt (fma (* (/ M d) (* D (/ (* M (* h -0.25)) (* d l)))) D 1.0)))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (D <= 4.9e-54) {
tmp = w0;
} else {
tmp = w0 * sqrt(fma(((M / d) * (D * ((M * (h * -0.25)) / (d * l)))), D, 1.0));
}
return tmp;
}
function code(w0, M, D, h, l, d) tmp = 0.0 if (D <= 4.9e-54) tmp = w0; else tmp = Float64(w0 * sqrt(fma(Float64(Float64(M / d) * Float64(D * Float64(Float64(M * Float64(h * -0.25)) / Float64(d * l)))), D, 1.0))); end return tmp end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[D, 4.9e-54], w0, N[(w0 * N[Sqrt[N[(N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[(M * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 4.9 \cdot 10^{-54}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M}{d} \cdot \left(D \cdot \frac{M \cdot \left(h \cdot -0.25\right)}{d \cdot \ell}\right), D, 1\right)}\\
\end{array}
\end{array}
if D < 4.90000000000000021e-54Initial program 85.5%
Taylor expanded in M around 0
Simplified74.2%
*-rgt-identity74.2
Applied egg-rr74.2%
if 4.90000000000000021e-54 < D Initial program 76.7%
Taylor expanded in w0 around 0
lower-*.f64N/A
lower-sqrt.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
Simplified53.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr70.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied egg-rr77.8%
Final simplification75.2%
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
def code(w0, M, D, h, l, d): return w0
function code(w0, M, D, h, l, d) return w0 end
function tmp = code(w0, M, D, h, l, d) tmp = w0; end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
\\
w0
\end{array}
Initial program 83.1%
Taylor expanded in M around 0
Simplified67.8%
*-rgt-identity67.8
Applied egg-rr67.8%
herbie shell --seed 2024208
(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))))))