?

Average Error: 0.1 → 0.1
Time: 13.5s
Precision: binary64
Cost: 13248

?

\[\left(x + \sin y\right) + z \cdot \cos y \]
\[x + \left(\sin y + z \cdot \cos y\right) \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
(FPCore (x y z) :precision binary64 (+ x (+ (sin y) (* z (cos 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 x + (sin(y) + (z * 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 + 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 = x + (sin(y) + (z * cos(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 x + (Math.sin(y) + (z * Math.cos(y)));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
def code(x, y, z):
	return x + (math.sin(y) + (z * math.cos(y)))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function code(x, y, z)
	return Float64(x + Float64(sin(y) + Float64(z * cos(y))))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
function tmp = code(x, y, z)
	tmp = x + (sin(y) + (z * cos(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[(x + N[(N[Sin[y], $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + \sin y\right) + z \cdot \cos y
x + \left(\sin y + z \cdot \cos y\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.1

    \[\left(x + \sin y\right) + z \cdot \cos y \]
  2. Simplified0.1

    \[\leadsto \color{blue}{x + \left(\sin y + z \cdot \cos y\right)} \]
    Proof

    [Start]0.1

    \[ \left(x + \sin y\right) + z \cdot \cos y \]

    rational.json-simplify-1 [=>]0.1

    \[ \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]

    rational.json-simplify-41 [=>]0.1

    \[ \color{blue}{x + \left(\sin y + z \cdot \cos y\right)} \]
  3. Final simplification0.1

    \[\leadsto x + \left(\sin y + z \cdot \cos y\right) \]

Alternatives

Alternative 1
Error3.7
Cost13384
\[\begin{array}{l} t_0 := x + \cos y \cdot z\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-120}:\\ \;\;\;\;z \cdot \cos y + \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error18.8
Cost7384
\[\begin{array}{l} t_0 := \cos y \cdot z\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-157}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -9.4 \cdot 10^{-238}:\\ \;\;\;\;x + \left(y + z\right)\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-149}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-123}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+61}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 3
Error10.9
Cost7120
\[\begin{array}{l} t_0 := \cos y \cdot z\\ \mathbf{if}\;z \leq -1.22 \cdot 10^{+33}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-94}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-92}:\\ \;\;\;\;\sin y + x\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+89}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error4.0
Cost6984
\[\begin{array}{l} t_0 := x + \cos y \cdot z\\ \mathbf{if}\;z \leq -3 \cdot 10^{-108}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-92}:\\ \;\;\;\;\sin y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error20.0
Cost6860
\[\begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-51}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-180}:\\ \;\;\;\;x + \left(y + z\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-116}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 6
Error29.1
Cost592
\[\begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-171}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-193}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+21}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error19.0
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+55}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 1000:\\ \;\;\;\;x + \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 8
Error26.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+21}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error20.1
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{-169}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-123}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 10
Error35.6
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-171}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.96 \cdot 10^{-107}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error28.7
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{+21}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error37.1
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023074 
(FPCore (x y z)
  :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
  :precision binary64
  (+ (+ x (sin y)) (* z (cos y))))