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

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

Alternatives

Alternative 1
Error9.7
Cost7508
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.2122258679160396 \cdot 10^{+192}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.5269390318249027 \cdot 10^{-111}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 1.0534743273697433 \cdot 10^{-42}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 1.5256828054520908 \cdot 10^{+98}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 3.3675823272914263 \cdot 10^{+184}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(x + y\right)\\ \end{array} \]
Alternative 2
Error17.4
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.2122258679160396 \cdot 10^{+192}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4.134652416664313 \cdot 10^{-170}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 6.951885837040458 \cdot 10^{-95}:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{elif}\;z \leq 1.5256828054520908 \cdot 10^{+98}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error9.8
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.2122258679160396 \cdot 10^{+192}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.5269390318249027 \cdot 10^{-111}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 1.0534743273697433 \cdot 10^{-42}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 1.5256828054520908 \cdot 10^{+98}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error19.6
Cost6728
\[\begin{array}{l} \mathbf{if}\;x \leq -1.0694109591234513 \cdot 10^{-21}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq -2.8741572151691164 \cdot 10^{-72}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 4.7882041375632194 \cdot 10^{-33}:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 5
Error18.6
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -5.6331254089158625 \cdot 10^{+56}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 1393467.4013561832:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 6
Error28.7
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -4.519040634168812 \cdot 10^{+124}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1189639.3908977848:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error20.1
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -2.3464185735336456 \cdot 10^{-218}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 1.0368026855248793 \cdot 10^{-84}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 8
Error30.9
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.3944564044018373 \cdot 10^{+125}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1189639.3908977848:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error36.7
Cost64
\[x \]

Error

Reproduce

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