Average Error: 0.1 → 0.1
Time: 9.1s
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
Error18.5
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -3.206579003040929 \cdot 10^{+88}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.4165067524867927 \cdot 10^{-213}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 4.80973166203007 \cdot 10^{-148}:\\ \;\;\;\;\sin y + z\\ \mathbf{elif}\;z \leq 2.865448592767312 \cdot 10^{+35}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error3.1
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -1.5756044624791378 \cdot 10^{-42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 8.515828206713084 \cdot 10^{-26}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error0.4
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -29857039.367868867:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.0006243750596830401:\\ \;\;\;\;z + \left(x + \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error14.3
Cost6856
\[\begin{array}{l} \mathbf{if}\;x \leq -4.931190904755021 \cdot 10^{-66}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 3.793250411003257 \cdot 10^{-36}:\\ \;\;\;\;\sin y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 5
Error12.0
Cost6856
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.4522050599370842 \cdot 10^{-38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.865448592767312 \cdot 10^{+35}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error21.0
Cost6728
\[\begin{array}{l} \mathbf{if}\;y \leq -14618774516040.238:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 3.0024992967316267 \cdot 10^{+103}:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;\sin y\\ \end{array} \]
Alternative 7
Error19.2
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -14618774516040.238:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 27571.91642154239:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 8
Error26.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -3.157460698626907 \cdot 10^{+27}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 35029591254918944:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error20.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -7.656691963095304 \cdot 10^{-122}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 7.937809847709668 \cdot 10^{-90}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 10
Error29.0
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -3.157460698626907 \cdot 10^{+27}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 35029591254918944:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error37.2
Cost64
\[x \]

Error

Reproduce

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