?

Average Error: 0.1 → 0.1
Time: 7.8s
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
Error16.8
Cost7120
\[\begin{array}{l} t_0 := \cos y \cdot x\\ t_1 := z \cdot \sin y\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 330000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error9.1
Cost6984
\[\begin{array}{l} t_0 := \cos y \cdot x\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{+150}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+39}:\\ \;\;\;\;x + z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error16.8
Cost6856
\[\begin{array}{l} t_0 := z \cdot \sin y\\ \mathbf{if}\;y \leq -720000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 820000:\\ \;\;\;\;y \cdot z + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error38.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-245}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 5
Error31.3
Cost320
\[y \cdot z + x \]
Alternative 6
Error39.5
Cost64
\[x \]

Error

Reproduce?

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