?

Average Accuracy: 99.8% → 99.8%
Time: 15.6s
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 99.8%

    \[x \cdot \cos y + z \cdot \sin y \]
  2. Final simplification99.8%

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

Alternatives

Alternative 1
Accuracy72.5%
Cost7384
\[\begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := x \cdot \cos y\\ t_2 := x + y \cdot z\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -160000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -850:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -5.3 \cdot 10^{-129}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.65 \cdot 10^{-117}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy72.4%
Cost7384
\[\begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := x \cdot \cos y\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1500000000:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;x \leq -860:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{-99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-124}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy75.1%
Cost6857
\[\begin{array}{l} \mathbf{if}\;y \leq -40 \lor \neg \left(y \leq 0.0039\right):\\ \;\;\;\;z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
Alternative 4
Accuracy41.5%
Cost324
\[\begin{array}{l} \mathbf{if}\;z \leq 3.2 \cdot 10^{+125}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
Alternative 5
Accuracy53.0%
Cost320
\[x + y \cdot z \]
Alternative 6
Accuracy39.9%
Cost64
\[x \]

Error

Reproduce?

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