
(FPCore (x y z t a b) :precision binary64 (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))
double code(double x, double y, double z, double t, double a, double b) {
return (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos((((((a * 2.0d0) + 1.0d0) * b) * t) / 16.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
def code(x, y, z, t, a, b): return (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))
function code(x, y, z, t, a, b) return Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0))) end
function tmp = code(x, y, z, t, a, b) tmp = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))
double code(double x, double y, double z, double t, double a, double b) {
return (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos((((((a * 2.0d0) + 1.0d0) * b) * t) / 16.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
def code(x, y, z, t, a, b): return (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))
function code(x, y, z, t, a, b) return Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0))) end
function tmp = code(x, y, z, t, a, b) tmp = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)
\end{array}
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 4.0 (sqrt t))))
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+142)
(*
x
(*
(cos (/ (/ (* z (fma y 2.0 1.0)) t_1) t_1))
(cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))))
x)))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 4.0 / sqrt(t);
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
tmp = x * (cos((((z * fma(y, 2.0, 1.0)) / t_1) / t_1)) * cos(((t / 16.0) * (b * fma(2.0, a, 1.0)))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) t_1 = Float64(4.0 / sqrt(t)) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+142) tmp = Float64(x * Float64(cos(Float64(Float64(Float64(z * fma(y, 2.0, 1.0)) / t_1) / t_1)) * cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0)))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(4.0 / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(z * N[(y * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{4}{\sqrt{t}}\\
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\frac{z \cdot \mathsf{fma}\left(y, 2, 1\right)}{t_1}}{t_1}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142Initial program 51.2%
Simplified51.4%
associate-*r*51.2%
associate-*l/51.2%
associate-/r/51.3%
add-sqr-sqrt25.2%
associate-/r*24.9%
sqrt-div24.8%
metadata-eval24.8%
sqrt-div24.8%
metadata-eval24.8%
Applied egg-rr24.8%
if 2.0000000000000001e142 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 4.7%
Simplified6.6%
Taylor expanded in z around 0 10.5%
Taylor expanded in t around 0 15.4%
Final simplification20.8%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+266)
(*
x
(*
(cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
(log (exp (cos (/ (fma 2.0 a 1.0) (/ (/ 16.0 t) b)))))))
x))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+266) {
tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * log(exp(cos((fma(2.0, a, 1.0) / ((16.0 / t) / b))))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+266) tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * log(exp(cos(Float64(fma(2.0, a, 1.0) / Float64(Float64(16.0 / t) / b))))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+266], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(N[(2.0 * a + 1.0), $MachinePrecision] / N[(N[(16.0 / t), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+266}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{\frac{16}{t}}{b}}\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e266Initial program 48.7%
Simplified49.0%
associate-*l/49.0%
associate-*r/49.0%
*-commutative49.0%
associate-*l/49.0%
add-log-exp49.0%
div-inv49.0%
metadata-eval49.0%
Applied egg-rr49.0%
*-commutative49.0%
associate-*l*49.0%
*-commutative49.0%
associate-*l*49.0%
metadata-eval49.0%
div-inv49.0%
*-commutative49.0%
associate-*r/49.0%
associate-/l*48.8%
associate-/l*49.3%
Applied egg-rr49.3%
if 2.0000000000000001e266 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 2.1%
Simplified4.1%
Taylor expanded in z around 0 8.7%
Taylor expanded in t around 0 14.2%
Final simplification36.3%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+142)
(*
x
(*
(cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
(cos (/ (* t b) (/ 16.0 (fma 2.0 a 1.0))))))
x))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos(((t * b) / (16.0 / fma(2.0, a, 1.0)))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+142) tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(Float64(t * b) / Float64(16.0 / fma(2.0, a, 1.0)))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t * b), $MachinePrecision] / N[(16.0 / N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\mathsf{fma}\left(2, a, 1\right)}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142Initial program 51.2%
Simplified51.4%
*-commutative51.4%
associate-*r/51.4%
fma-udef51.4%
*-commutative51.4%
fma-def51.4%
associate-*r*51.3%
*-commutative51.3%
associate-/l*51.5%
*-commutative51.5%
fma-def51.5%
*-commutative51.5%
fma-udef51.5%
Applied egg-rr51.5%
if 2.0000000000000001e142 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 4.7%
Simplified6.6%
Taylor expanded in z around 0 10.5%
Taylor expanded in t around 0 15.4%
Final simplification36.1%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+142)
(*
x
(*
(cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
(cos (/ (fma 2.0 a 1.0) (/ 16.0 (* t b))))))
x))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos((fma(2.0, a, 1.0) / (16.0 / (t * b)))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+142) tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(fma(2.0, a, 1.0) / Float64(16.0 / Float64(t * b)))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(2.0 * a + 1.0), $MachinePrecision] / N[(16.0 / N[(t * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t \cdot b}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142Initial program 51.2%
Simplified51.4%
*-commutative51.4%
associate-*r/51.4%
fma-udef51.4%
*-commutative51.4%
fma-def51.4%
associate-*r*51.3%
associate-/l*51.5%
fma-def51.5%
*-commutative51.5%
fma-udef51.5%
*-commutative51.5%
Applied egg-rr51.5%
if 2.0000000000000001e142 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 4.7%
Simplified6.6%
Taylor expanded in z around 0 10.5%
Taylor expanded in t around 0 15.4%
Final simplification36.2%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (/ 16.0 b))))
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+266)
(*
x
(*
(cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
(cos (+ t_1 (* t_1 (* 2.0 a))))))
x)))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (16.0 / b);
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+266) {
tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos((t_1 + (t_1 * (2.0 * a)))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(16.0 / b)) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+266) tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(t_1 + Float64(t_1 * Float64(2.0 * a)))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(16.0 / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+266], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 + N[(t$95$1 * N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{16}{b}}\\
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+266}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e266Initial program 48.7%
Simplified49.0%
associate-*l/48.2%
associate-*r/48.2%
*-commutative48.2%
associate-*l/48.2%
associate-*r*47.8%
fma-udef47.8%
*-commutative47.8%
+-commutative47.8%
distribute-rgt-in47.8%
*-un-lft-identity47.8%
clear-num47.9%
un-div-inv47.8%
*-commutative47.8%
clear-num48.0%
un-div-inv48.1%
Applied egg-rr48.9%
if 2.0000000000000001e266 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 2.1%
Simplified4.1%
Taylor expanded in z around 0 8.7%
Taylor expanded in t around 0 14.2%
Final simplification36.0%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
2e+142)
(*
x
(*
(cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))
(cos (+ t_1 (* (* y 2.0) t_1)))))
x)))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t * 0.0625);
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
tmp = x * (cos(((t / 16.0) * (b * fma(2.0, a, 1.0)))) * cos((t_1 + ((y * 2.0) * t_1))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 2e+142) tmp = Float64(x * Float64(cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0)))) * cos(Float64(t_1 + Float64(Float64(y * 2.0) * t_1))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+142], N[(x * N[(N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 + N[(N[(y * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right) \cdot \cos \left(t_1 + \left(y \cdot 2\right) \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142Initial program 51.2%
Simplified51.4%
associate-/r/50.9%
clear-num51.1%
associate-/r/51.5%
clear-num51.4%
associate-*r/51.4%
fma-def51.4%
distribute-rgt-in51.4%
div-inv51.4%
metadata-eval51.4%
*-un-lft-identity51.4%
div-inv51.4%
metadata-eval51.4%
Applied egg-rr51.4%
if 2.0000000000000001e142 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 4.7%
Simplified6.6%
Taylor expanded in z around 0 10.5%
Taylor expanded in t around 0 15.4%
Final simplification36.1%
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))))
(if (<= t_1 2e+142) t_1 x)))t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0));
double tmp;
if (t_1 <= 2e+142) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos(((t * ((1.0d0 + (2.0d0 * a)) * b)) / 16.0d0))
if (t_1 <= 2d+142) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0));
double tmp;
if (t_1 <= 2e+142) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
t = abs(t) def code(x, y, z, t, a, b): t_1 = (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0)) tmp = 0 if t_1 <= 2e+142: tmp = t_1 else: tmp = x return tmp
t = abs(t) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) tmp = 0.0 if (t_1 <= 2e+142) tmp = t_1; else tmp = x; end return tmp end
t = abs(t) function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0)); tmp = 0.0; if (t_1 <= 2e+142) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+142], t$95$1, x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142Initial program 51.2%
if 2.0000000000000001e142 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 4.7%
Simplified6.6%
Taylor expanded in z around 0 10.5%
Taylor expanded in t around 0 15.4%
Final simplification36.0%
NOTE: t should be positive before calling this function (FPCore (x y z t a b) :precision binary64 (if (<= b 1e+113) (* x (cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))) x))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1e+113) {
tmp = x * cos(((t / 16.0) * (b * fma(2.0, a, 1.0))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1e+113) tmp = Float64(x * cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0))))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1e+113], N[(x * N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 10^{+113}:\\
\;\;\;\;x \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < 1e113Initial program 33.4%
Simplified34.3%
Taylor expanded in z around 0 35.7%
if 1e113 < b Initial program 18.6%
Simplified19.3%
Taylor expanded in z around 0 19.1%
Taylor expanded in t around 0 26.1%
Final simplification34.5%
NOTE: t should be positive before calling this function (FPCore (x y z t a b) :precision binary64 (if (<= b 6.5e+52) (* x (cos (/ (* b (fma 2.0 a 1.0)) (/ 16.0 t)))) x))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 6.5e+52) {
tmp = x * cos(((b * fma(2.0, a, 1.0)) / (16.0 / t)));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 6.5e+52) tmp = Float64(x * cos(Float64(Float64(b * fma(2.0, a, 1.0)) / Float64(16.0 / t)))); else tmp = x; end return tmp end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 6.5e+52], N[(x * N[Cos[N[(N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision] / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \cos \left(\frac{b \cdot \mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < 6.49999999999999996e52Initial program 34.3%
Simplified35.2%
Taylor expanded in z around 0 36.5%
clear-num36.6%
associate-*l/36.5%
*-un-lft-identity36.5%
*-commutative36.5%
Applied egg-rr36.5%
if 6.49999999999999996e52 < b Initial program 17.0%
Simplified17.5%
Taylor expanded in z around 0 18.2%
Taylor expanded in t around 0 22.7%
Final simplification34.2%
NOTE: t should be positive before calling this function (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ t (/ 16.0 b)))) (if (<= b 4.8e+52) (* x (cos (+ t_1 (* t_1 (* 2.0 a))))) x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (16.0 / b);
double tmp;
if (b <= 4.8e+52) {
tmp = x * cos((t_1 + (t_1 * (2.0 * a))));
} else {
tmp = x;
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t / (16.0d0 / b)
if (b <= 4.8d+52) then
tmp = x * cos((t_1 + (t_1 * (2.0d0 * a))))
else
tmp = x
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (16.0 / b);
double tmp;
if (b <= 4.8e+52) {
tmp = x * Math.cos((t_1 + (t_1 * (2.0 * a))));
} else {
tmp = x;
}
return tmp;
}
t = abs(t) def code(x, y, z, t, a, b): t_1 = t / (16.0 / b) tmp = 0 if b <= 4.8e+52: tmp = x * math.cos((t_1 + (t_1 * (2.0 * a)))) else: tmp = x return tmp
t = abs(t) function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(16.0 / b)) tmp = 0.0 if (b <= 4.8e+52) tmp = Float64(x * cos(Float64(t_1 + Float64(t_1 * Float64(2.0 * a))))); else tmp = x; end return tmp end
t = abs(t) function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (16.0 / b); tmp = 0.0; if (b <= 4.8e+52) tmp = x * cos((t_1 + (t_1 * (2.0 * a)))); else tmp = x; end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(16.0 / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.8e+52], N[(x * N[Cos[N[(t$95$1 + N[(t$95$1 * N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{16}{b}}\\
\mathbf{if}\;b \leq 4.8 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < 4.8e52Initial program 34.3%
Simplified35.2%
Taylor expanded in z around 0 36.5%
associate-*l/36.5%
associate-*r/36.5%
*-commutative36.5%
associate-*l/36.5%
associate-*r*36.7%
fma-udef36.7%
*-commutative36.7%
+-commutative36.7%
distribute-rgt-in36.6%
*-un-lft-identity36.6%
clear-num36.7%
un-div-inv36.9%
*-commutative36.9%
clear-num37.0%
un-div-inv36.9%
Applied egg-rr36.9%
if 4.8e52 < b Initial program 17.0%
Simplified17.5%
Taylor expanded in z around 0 18.2%
Taylor expanded in t around 0 22.7%
Final simplification34.5%
NOTE: t should be positive before calling this function (FPCore (x y z t a b) :precision binary64 (* x (cos (* (* t b) 0.0625))))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
return x * cos(((t * b) * 0.0625));
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * cos(((t * b) * 0.0625d0))
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.cos(((t * b) * 0.0625));
}
t = abs(t) def code(x, y, z, t, a, b): return x * math.cos(((t * b) * 0.0625))
t = abs(t) function code(x, y, z, t, a, b) return Float64(x * cos(Float64(Float64(t * b) * 0.0625))) end
t = abs(t) function tmp = code(x, y, z, t, a, b) tmp = x * cos(((t * b) * 0.0625)); end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := N[(x * N[Cos[N[(N[(t * b), $MachinePrecision] * 0.0625), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
x \cdot \cos \left(\left(t \cdot b\right) \cdot 0.0625\right)
\end{array}
Initial program 31.4%
Simplified32.3%
Taylor expanded in z around 0 33.5%
Taylor expanded in a around 0 34.0%
Final simplification34.0%
NOTE: t should be positive before calling this function (FPCore (x y z t a b) :precision binary64 x)
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
NOTE: t should be positive before calling this function
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
t = abs(t) def code(x, y, z, t, a, b): return x
t = abs(t) function code(x, y, z, t, a, b) return x end
t = abs(t) function tmp = code(x, y, z, t, a, b) tmp = x; end
NOTE: t should be positive before calling this function code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
t = |t|\\
\\
x
\end{array}
Initial program 31.4%
Simplified32.3%
Taylor expanded in z around 0 33.5%
Taylor expanded in t around 0 34.0%
Final simplification34.0%
(FPCore (x y z t a b) :precision binary64 (* x (cos (* (/ b 16.0) (/ t (+ (- 1.0 (* a 2.0)) (pow (* a 2.0) 2.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + pow((a * 2.0), 2.0)))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * cos(((b / 16.0d0) * (t / ((1.0d0 - (a * 2.0d0)) + ((a * 2.0d0) ** 2.0d0)))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + Math.pow((a * 2.0), 2.0)))));
}
def code(x, y, z, t, a, b): return x * math.cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + math.pow((a * 2.0), 2.0)))))
function code(x, y, z, t, a, b) return Float64(x * cos(Float64(Float64(b / 16.0) * Float64(t / Float64(Float64(1.0 - Float64(a * 2.0)) + (Float64(a * 2.0) ^ 2.0)))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + ((a * 2.0) ^ 2.0))))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Cos[N[(N[(b / 16.0), $MachinePrecision] * N[(t / N[(N[(1.0 - N[(a * 2.0), $MachinePrecision]), $MachinePrecision] + N[Power[N[(a * 2.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \cos \left(\frac{b}{16} \cdot \frac{t}{\left(1 - a \cdot 2\right) + {\left(a \cdot 2\right)}^{2}}\right)
\end{array}
herbie shell --seed 2023301
(FPCore (x y z t a b)
:name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"
:precision binary64
:herbie-target
(* x (cos (* (/ b 16.0) (/ t (+ (- 1.0 (* a 2.0)) (pow (* a 2.0) 2.0))))))
(* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))