Average Error: 0.1 → 0.1
Time: 12.3s
Precision: binary64
Cost: 13248
\[x \cdot \cos y - z \cdot \sin y \]
\[x \cdot \cos y - z \cdot \sin y \]
(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (- (* x (cos y)) (* z (sin 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 (x * cos(y)) - (z * 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 * 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 = (x * cos(y)) - (z * sin(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 (x * Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x * math.cos(y)) - (z * math.sin(y))
def code(x, y, z):
	return (x * math.cos(y)) - (z * math.sin(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(x * cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x * cos(y)) - (z * sin(y));
end
function tmp = code(x, y, z)
	tmp = (x * cos(y)) - (z * sin(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[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \cos y - z \cdot \sin y
x \cdot \cos y - z \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 \cos y - z \cdot \sin y \]
  2. Final simplification0.1

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

Alternatives

Alternative 1
Error15.9
Cost7448
\[\begin{array}{l} t_0 := z \cdot \left(-\sin y\right)\\ t_1 := x \cdot \cos y\\ \mathbf{if}\;y \leq -1.9948804824620966 \cdot 10^{+185}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3586941395517.6997:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.761974989807316 \cdot 10^{-5}:\\ \;\;\;\;x + y \cdot \left(x \cdot \left(y \cdot -0.5\right) - z\right)\\ \mathbf{elif}\;y \leq 2.1029162195330391 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.730321874199684 \cdot 10^{+105}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 6.937114074321918 \cdot 10^{+167}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error9.4
Cost6984
\[\begin{array}{l} t_0 := x \cdot \cos y\\ \mathbf{if}\;x \leq -7.076806874571052 \cdot 10^{-34}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.364069274705737 \cdot 10^{+109}:\\ \;\;\;\;x - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error17.0
Cost6856
\[\begin{array}{l} t_0 := x \cdot \cos y\\ \mathbf{if}\;y \leq -3586941395517.6997:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 9.761974989807316 \cdot 10^{-5}:\\ \;\;\;\;x + y \cdot \left(x \cdot \left(y \cdot -0.5\right) - z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error37.6
Cost520
\[\begin{array}{l} t_0 := y \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -6.035101181330591 \cdot 10^{+173}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6.348856230144987 \cdot 10^{+130}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error30.8
Cost320
\[x - y \cdot z \]
Alternative 6
Error39.3
Cost64
\[x \]

Error

Reproduce

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