Average Error: 0.1 → 0.1
Time: 10.0s
Precision: binary64
Cost: 13248
\[x \cdot \sin y + z \cdot \cos y \]
\[z \cdot \cos y + x \cdot \sin y \]
(FPCore (x y z) :precision binary64 (+ (* x (sin y)) (* z (cos y))))
(FPCore (x y z) :precision binary64 (+ (* z (cos y)) (* x (sin y))))
double code(double x, double y, double z) {
	return (x * sin(y)) + (z * cos(y));
}
double code(double x, double y, double z) {
	return (z * cos(y)) + (x * sin(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 * sin(y)) + (z * cos(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 * cos(y)) + (x * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x * Math.sin(y)) + (z * Math.cos(y));
}
public static double code(double x, double y, double z) {
	return (z * Math.cos(y)) + (x * Math.sin(y));
}
def code(x, y, z):
	return (x * math.sin(y)) + (z * math.cos(y))
def code(x, y, z):
	return (z * math.cos(y)) + (x * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x * sin(y)) + Float64(z * cos(y)))
end
function code(x, y, z)
	return Float64(Float64(z * cos(y)) + Float64(x * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x * sin(y)) + (z * cos(y));
end
function tmp = code(x, y, z)
	tmp = (z * cos(y)) + (x * sin(y));
end
code[x_, y_, z_] := N[(N[(x * N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \sin y + z \cdot \cos y
z \cdot \cos y + x \cdot \sin y

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

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

Alternatives

Alternative 1
Error16.0
Cost7384
\[\begin{array}{l} t_0 := x \cdot \sin y\\ t_1 := z \cdot \cos y\\ \mathbf{if}\;y \leq -4.467235781468881 \cdot 10^{+269}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -7.73123433079739 \cdot 10^{+213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.6551753127859233 \cdot 10^{+187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -7.58325743152806 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -10604636.769083364:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.08839147709823608:\\ \;\;\;\;z + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error10.0
Cost7248
\[\begin{array}{l} t_0 := z \cdot \cos y\\ t_1 := z + x \cdot \sin y\\ \mathbf{if}\;z \leq -8.069696018579312 \cdot 10^{+196}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -6.1218348465704036 \cdot 10^{+41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9.071300668515432 \cdot 10^{-14}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6.1808399442153046 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error16.6
Cost6856
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;y \leq -6.22550385717427 \cdot 10^{+34}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 9.789299162384845 \cdot 10^{-16}:\\ \;\;\;\;z + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error36.9
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1660026554212445 \cdot 10^{+118}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 3.840291792634429 \cdot 10^{+77}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 5
Error29.6
Cost320
\[z + x \cdot y \]
Alternative 6
Error38.4
Cost64
\[z \]

Error

Reproduce

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