Average Error: 0.1 → 0.1
Time: 8.3s
Precision: binary64
Cost: 13248
\[x \cdot \cos y + z \cdot \sin y \]
\[z \cdot \sin y + x \cdot \cos y \]
(FPCore (x y z) :precision binary64 (+ (* x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (+ (* z (sin y)) (* x (cos y))))
double code(double x, double y, double z) {
	return (x * cos(y)) + (z * sin(y));
}
double code(double x, double y, double z) {
	return (z * sin(y)) + (x * cos(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * cos(y)) + (z * sin(y))
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (z * sin(y)) + (x * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x * Math.cos(y)) + (z * Math.sin(y));
}
public static double code(double x, double y, double z) {
	return (z * Math.sin(y)) + (x * Math.cos(y));
}
def code(x, y, z):
	return (x * math.cos(y)) + (z * math.sin(y))
def code(x, y, z):
	return (z * math.sin(y)) + (x * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x * cos(y)) + Float64(z * sin(y)))
end
function code(x, y, z)
	return Float64(Float64(z * sin(y)) + Float64(x * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x * cos(y)) + (z * sin(y));
end
function tmp = code(x, y, z)
	tmp = (z * sin(y)) + (x * cos(y));
end
code[x_, y_, z_] := N[(N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \cos y + z \cdot \sin y
z \cdot \sin y + x \cdot \cos y

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[x \cdot \cos y + z \cdot \sin y \]
  2. Final simplification0.1

    \[\leadsto z \cdot \sin y + x \cdot \cos y \]

Alternatives

Alternative 1
Error17.4
Cost7648
\[\begin{array}{l} t_0 := x \cdot \cos y\\ t_1 := z \cdot \sin y\\ \mathbf{if}\;z \leq -2.2721934532230194 \cdot 10^{+217}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.784487020553269 \cdot 10^{+191}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -3.0844967116570647 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.3343980466546453 \cdot 10^{+111}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.2367901634640969 \cdot 10^{+122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.044793878156357 \cdot 10^{+126}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 7.266274041986495 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.0320190436123988 \cdot 10^{+189}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error16.8
Cost6856
\[\begin{array}{l} t_0 := z \cdot \sin y\\ \mathbf{if}\;y \leq -901.760773367421:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.011147630301063862:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error37.9
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -3.0050395976929094 \cdot 10^{+221}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 1.7624802837630254 \cdot 10^{+193}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
Alternative 4
Error31.4
Cost320
\[x + y \cdot z \]
Alternative 5
Error39.5
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022325 
(FPCore (x y z)
  :name "Diagrams.ThreeD.Transform:aboutY from diagrams-lib-1.3.0.3"
  :precision binary64
  (+ (* x (cos y)) (* z (sin y))))