
(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 8 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}
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b)
:precision binary64
(if (<= t_m 2.25e-142)
(*
(cos (* (fma y 2.0 1.0) (* z (/ t_m 16.0))))
(* x (cos (pow (cbrt (* (* t_m (* b 0.0625)) (fma 2.0 a 1.0))) 3.0))))
(*
x
(cos
(* -0.125 (* a (expm1 (* b (+ t_m (* (* b -0.5) (pow t_m 2.0)))))))))))t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
double tmp;
if (t_m <= 2.25e-142) {
tmp = cos((fma(y, 2.0, 1.0) * (z * (t_m / 16.0)))) * (x * cos(pow(cbrt(((t_m * (b * 0.0625)) * fma(2.0, a, 1.0))), 3.0)));
} else {
tmp = x * cos((-0.125 * (a * expm1((b * (t_m + ((b * -0.5) * pow(t_m, 2.0))))))));
}
return tmp;
}
t_m = abs(t) function code(x, y, z, t_m, a, b) tmp = 0.0 if (t_m <= 2.25e-142) tmp = Float64(cos(Float64(fma(y, 2.0, 1.0) * Float64(z * Float64(t_m / 16.0)))) * Float64(x * cos((cbrt(Float64(Float64(t_m * Float64(b * 0.0625)) * fma(2.0, a, 1.0))) ^ 3.0)))); else tmp = Float64(x * cos(Float64(-0.125 * Float64(a * expm1(Float64(b * Float64(t_m + Float64(Float64(b * -0.5) * (t_m ^ 2.0))))))))); end return tmp end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := If[LessEqual[t$95$m, 2.25e-142], N[(N[Cos[N[(N[(y * 2.0 + 1.0), $MachinePrecision] * N[(z * N[(t$95$m / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x * N[Cos[N[Power[N[Power[N[(N[(t$95$m * N[(b * 0.0625), $MachinePrecision]), $MachinePrecision] * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Cos[N[(-0.125 * N[(a * N[(Exp[N[(b * N[(t$95$m + N[(N[(b * -0.5), $MachinePrecision] * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 2.25 \cdot 10^{-142}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(y, 2, 1\right) \cdot \left(z \cdot \frac{t\_m}{16}\right)\right) \cdot \left(x \cdot \cos \left({\left(\sqrt[3]{\left(t\_m \cdot \left(b \cdot 0.0625\right)\right) \cdot \mathsf{fma}\left(2, a, 1\right)}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos \left(-0.125 \cdot \left(a \cdot \mathsf{expm1}\left(b \cdot \left(t\_m + \left(b \cdot -0.5\right) \cdot {t\_m}^{2}\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 2.25000000000000009e-142Initial program 33.8%
Simplified34.6%
add-cube-cbrt34.6%
pow334.6%
*-commutative34.6%
div-inv34.6%
metadata-eval34.6%
Applied egg-rr34.6%
if 2.25000000000000009e-142 < t Initial program 15.8%
Simplified16.3%
Taylor expanded in a around inf 16.3%
associate-*r*16.3%
*-commutative16.3%
Simplified16.3%
Taylor expanded in z around 0 17.1%
expm1-log1p-u15.7%
expm1-undefine14.7%
Applied egg-rr14.7%
expm1-define15.7%
Simplified15.7%
Taylor expanded in b around 0 20.8%
associate-*r*20.8%
Simplified20.8%
Final simplification30.0%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (cos (* -0.125 (* a (expm1 (* t_m (+ b (* -0.5 (* t_m (pow b 2.0)))))))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * cos((-0.125 * (a * expm1((t_m * (b + (-0.5 * (t_m * pow(b, 2.0)))))))));
}
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * Math.cos((-0.125 * (a * Math.expm1((t_m * (b + (-0.5 * (t_m * Math.pow(b, 2.0)))))))));
}
t_m = math.fabs(t) def code(x, y, z, t_m, a, b): return x * math.cos((-0.125 * (a * math.expm1((t_m * (b + (-0.5 * (t_m * math.pow(b, 2.0)))))))))
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * cos(Float64(-0.125 * Float64(a * expm1(Float64(t_m * Float64(b + Float64(-0.5 * Float64(t_m * (b ^ 2.0)))))))))) end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[Cos[N[(-0.125 * N[(a * N[(Exp[N[(t$95$m * N[(b + N[(-0.5 * N[(t$95$m * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \cos \left(-0.125 \cdot \left(a \cdot \mathsf{expm1}\left(t\_m \cdot \left(b + -0.5 \cdot \left(t\_m \cdot {b}^{2}\right)\right)\right)\right)\right)
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in a around inf 28.3%
associate-*r*28.3%
*-commutative28.3%
Simplified28.3%
Taylor expanded in z around 0 28.8%
expm1-log1p-u27.2%
expm1-undefine26.5%
Applied egg-rr26.5%
expm1-define27.2%
Simplified27.2%
Taylor expanded in t around 0 30.6%
Final simplification30.6%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (cos (* -0.125 (* a (expm1 (* b (+ t_m (* (* b -0.5) (pow t_m 2.0))))))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * cos((-0.125 * (a * expm1((b * (t_m + ((b * -0.5) * pow(t_m, 2.0))))))));
}
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * Math.cos((-0.125 * (a * Math.expm1((b * (t_m + ((b * -0.5) * Math.pow(t_m, 2.0))))))));
}
t_m = math.fabs(t) def code(x, y, z, t_m, a, b): return x * math.cos((-0.125 * (a * math.expm1((b * (t_m + ((b * -0.5) * math.pow(t_m, 2.0))))))))
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * cos(Float64(-0.125 * Float64(a * expm1(Float64(b * Float64(t_m + Float64(Float64(b * -0.5) * (t_m ^ 2.0))))))))) end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[Cos[N[(-0.125 * N[(a * N[(Exp[N[(b * N[(t$95$m + N[(N[(b * -0.5), $MachinePrecision] * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \cos \left(-0.125 \cdot \left(a \cdot \mathsf{expm1}\left(b \cdot \left(t\_m + \left(b \cdot -0.5\right) \cdot {t\_m}^{2}\right)\right)\right)\right)
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in a around inf 28.3%
associate-*r*28.3%
*-commutative28.3%
Simplified28.3%
Taylor expanded in z around 0 28.8%
expm1-log1p-u27.2%
expm1-undefine26.5%
Applied egg-rr26.5%
expm1-define27.2%
Simplified27.2%
Taylor expanded in b around 0 30.8%
associate-*r*30.8%
Simplified30.8%
Final simplification30.8%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (+ (cbrt (pow (+ 1.0 (cos (* t_m (* b -0.0625)))) 3.0)) -1.0)))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * (cbrt(pow((1.0 + cos((t_m * (b * -0.0625)))), 3.0)) + -1.0);
}
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * (Math.cbrt(Math.pow((1.0 + Math.cos((t_m * (b * -0.0625)))), 3.0)) + -1.0);
}
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * Float64(cbrt((Float64(1.0 + cos(Float64(t_m * Float64(b * -0.0625)))) ^ 3.0)) + -1.0)) end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[(N[Power[N[Power[N[(1.0 + N[Cos[N[(t$95$m * N[(b * -0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \left(\sqrt[3]{{\left(1 + \cos \left(t\_m \cdot \left(b \cdot -0.0625\right)\right)\right)}^{3}} + -1\right)
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in z around 0 29.1%
Taylor expanded in a around 0 30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified30.2%
expm1-log1p-u30.2%
expm1-undefine30.2%
associate-*l*30.2%
Applied egg-rr30.2%
add-cbrt-cube30.2%
pow330.2%
log1p-undefine30.2%
rem-exp-log30.2%
associate-*r*30.2%
Applied egg-rr30.2%
Final simplification30.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (pow (cbrt (cos (* -0.0625 (* t_m b)))) 3.0)))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * pow(cbrt(cos((-0.0625 * (t_m * b)))), 3.0);
}
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * Math.pow(Math.cbrt(Math.cos((-0.0625 * (t_m * b)))), 3.0);
}
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * (cbrt(cos(Float64(-0.0625 * Float64(t_m * b)))) ^ 3.0)) end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[Power[N[Power[N[Cos[N[(-0.0625 * N[(t$95$m * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot {\left(\sqrt[3]{\cos \left(-0.0625 \cdot \left(t\_m \cdot b\right)\right)}\right)}^{3}
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in z around 0 29.1%
Taylor expanded in a around 0 30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified30.2%
add-cube-cbrt30.2%
pow330.2%
associate-*l*30.2%
Applied egg-rr30.2%
Final simplification30.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (+ (+ 1.0 (cos (* t_m (* b -0.0625)))) -1.0)))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * ((1.0 + cos((t_m * (b * -0.0625)))) + -1.0);
}
t_m = abs(t)
real(8) function code(x, y, z, t_m, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * ((1.0d0 + cos((t_m * (b * (-0.0625d0))))) + (-1.0d0))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * ((1.0 + Math.cos((t_m * (b * -0.0625)))) + -1.0);
}
t_m = math.fabs(t) def code(x, y, z, t_m, a, b): return x * ((1.0 + math.cos((t_m * (b * -0.0625)))) + -1.0)
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * Float64(Float64(1.0 + cos(Float64(t_m * Float64(b * -0.0625)))) + -1.0)) end
t_m = abs(t); function tmp = code(x, y, z, t_m, a, b) tmp = x * ((1.0 + cos((t_m * (b * -0.0625)))) + -1.0); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[(N[(1.0 + N[Cos[N[(t$95$m * N[(b * -0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \left(\left(1 + \cos \left(t\_m \cdot \left(b \cdot -0.0625\right)\right)\right) + -1\right)
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in z around 0 29.1%
Taylor expanded in a around 0 30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified30.2%
expm1-log1p-u30.2%
expm1-undefine30.2%
associate-*l*30.2%
Applied egg-rr30.2%
log1p-undefine30.2%
rem-exp-log30.2%
associate-*r*30.2%
Applied egg-rr30.2%
Final simplification30.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 (* x (cos (* t_m (* b -0.0625)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x * cos((t_m * (b * -0.0625)));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * cos((t_m * (b * (-0.0625d0))))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x * Math.cos((t_m * (b * -0.0625)));
}
t_m = math.fabs(t) def code(x, y, z, t_m, a, b): return x * math.cos((t_m * (b * -0.0625)))
t_m = abs(t) function code(x, y, z, t_m, a, b) return Float64(x * cos(Float64(t_m * Float64(b * -0.0625)))) end
t_m = abs(t); function tmp = code(x, y, z, t_m, a, b) tmp = x * cos((t_m * (b * -0.0625))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := N[(x * N[Cos[N[(t$95$m * N[(b * -0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \cos \left(t\_m \cdot \left(b \cdot -0.0625\right)\right)
\end{array}
Initial program 27.8%
Simplified28.4%
Taylor expanded in z around 0 29.1%
Taylor expanded in a around 0 30.2%
*-commutative30.2%
associate-*r*30.2%
Simplified30.2%
Final simplification30.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m a b) :precision binary64 x)
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
return x;
}
t_m = abs(t)
real(8) function code(x, y, z, t_m, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m, double a, double b) {
return x;
}
t_m = math.fabs(t) def code(x, y, z, t_m, a, b): return x
t_m = abs(t) function code(x, y, z, t_m, a, b) return x end
t_m = abs(t); function tmp = code(x, y, z, t_m, a, b) tmp = x; end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_, a_, b_] := x
\begin{array}{l}
t_m = \left|t\right|
\\
x
\end{array}
Initial program 27.8%
associate-*l*27.8%
*-commutative27.8%
*-commutative27.8%
associate-/l*27.8%
fma-define27.8%
associate-/l*27.8%
fma-define27.8%
Simplified27.8%
Taylor expanded in t around 0 29.6%
(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 2024128
(FPCore (x y z t a b)
:name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"
:precision binary64
:alt
(! :herbie-platform default (* x (cos (* (/ b 16) (/ t (+ (- 1 (* a 2)) (pow (* a 2) 2)))))))
(* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))