Average Error: 0.7 → 0.7
Time: 4.0s
Precision: binary64
\[\left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y\]
\[\left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y\]
\left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y
\left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y
double code(double x, double a, double z, double y) {
	return ((double) (((double) (((double) (x * ((double) pow(((double) cos(a)), 2.0)))) - ((double) (((double) (((double) (((double) sin(a)) * ((double) cos(a)))) * z)) * 2.0)))) + ((double) (((double) pow(((double) sin(a)), 2.0)) * y))));
}
double code(double x, double a, double z, double y) {
	return ((double) (((double) (((double) (x * ((double) pow(((double) cos(a)), 2.0)))) - ((double) (((double) (((double) (((double) sin(a)) * ((double) cos(a)))) * z)) * 2.0)))) + ((double) (((double) pow(((double) sin(a)), 2.0)) * y))));
}

Error

Bits error versus x

Bits error versus a

Bits error versus z

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.7

    \[\left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y\]
  2. Final simplification0.7

    \[\leadsto \left(x \cdot {\left(\cos a\right)}^{2} - \left(\left(\sin a \cdot \cos a\right) \cdot z\right) \cdot 2\right) + {\left(\sin a\right)}^{2} \cdot y\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x a z y)
  :name "(+ (- (* x (pow (cos a) 2)) (* (* (* (sin a) (cos a)) z) 2)) (* (pow (sin a) 2) y))"
  :precision binary64
  (+ (- (* x (pow (cos a) 2.0)) (* (* (* (sin a) (cos a)) z) 2.0)) (* (pow (sin a) 2.0) y)))