Average Error: 0.1 → 0.1
Time: 8.6s
Precision: binary64
Cost: 13248
\[\left(x + \sin y\right) + z \cdot \cos y \]
\[\left(x + \sin y\right) + z \cdot \cos y \]
(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(Float64(x + 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[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + \sin y\right) + z \cdot \cos y
\left(x + \sin y\right) + z \cdot \cos y

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. Final simplification0.1

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

Alternatives

Alternative 1
Error7.7
Cost13384
\[\begin{array}{l} \mathbf{if}\;x \leq -1643.3843386003534:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 1.6206041624353432 \cdot 10^{-78}:\\ \;\;\;\;\sin y + z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 2
Error19.6
Cost7384
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;y \leq -3.420068738493491 \cdot 10^{+221}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -1.6275688451121112 \cdot 10^{+173}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.985108571228618 \cdot 10^{+20}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 3.780696794184903 \cdot 10^{+22}:\\ \;\;\;\;-0.5 \cdot \left(y \cdot \left(y \cdot z\right)\right) + \left(y + \left(x + z\right)\right)\\ \mathbf{elif}\;y \leq 1.3229708556094939 \cdot 10^{+112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8.690863944150391 \cdot 10^{+133}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error21.6
Cost6992
\[\begin{array}{l} \mathbf{if}\;x \leq -2.5497568435116082 \cdot 10^{-133}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq -7.959676606271964 \cdot 10^{-193}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 3.4646469100282713 \cdot 10^{-292}:\\ \;\;\;\;y + z\\ \mathbf{elif}\;x \leq 2.4613647766953367 \cdot 10^{-236}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 4
Error11.3
Cost6988
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -4.657122237507487 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.6866049671398948 \cdot 10^{-97}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 5.704206522078882 \cdot 10^{+53}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error19.2
Cost1096
\[\begin{array}{l} \mathbf{if}\;y \leq -3.985108571228618 \cdot 10^{+20}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 5.934166182699957 \cdot 10^{+20}:\\ \;\;\;\;-0.5 \cdot \left(y \cdot \left(y \cdot z\right)\right) + \left(y + \left(x + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 6
Error26.9
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1643.3843386003534:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2673526177531569 \cdot 10^{-64}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error20.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2322853851439496 \cdot 10^{-168}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 5.2977996020236805 \cdot 10^{-143}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 8
Error28.9
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -1643.3843386003534:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2673526177531569 \cdot 10^{-64}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error37.3
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022228 
(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))))