Average Error: 0.0 → 0.0
Time: 9.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.0

    \[\left(x + \sin y\right) + z \cdot \cos y \]
  2. Final simplification0.0

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

Alternatives

Alternative 1
Error6.6
Cost13385
\[\begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{-38} \lor \neg \left(x \leq 7 \cdot 10^{-59}\right):\\ \;\;\;\;\left(x + \sin y\right) + z\\ \mathbf{else}:\\ \;\;\;\;\sin y + z \cdot \cos y\\ \end{array} \]
Alternative 2
Error17.9
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;x \leq -5.8 \cdot 10^{-38}:\\ \;\;\;\;\left(x + z \cdot 2\right) - z\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-198}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-265}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-58}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 3
Error10.5
Cost6988
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -3300:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.7 \cdot 10^{-11}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+192}:\\ \;\;\;\;\left(x + z \cdot 2\right) - z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error7.1
Cost6985
\[\begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+97} \lor \neg \left(z \leq 5.6 \cdot 10^{+192}\right):\\ \;\;\;\;z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;\left(x + \sin y\right) + z\\ \end{array} \]
Alternative 5
Error20.1
Cost6860
\[\begin{array}{l} t_0 := z + \left(x + z \cdot -2\right)\\ \mathbf{if}\;y \leq -45000000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 42000000000000:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+120}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error19.2
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -45000000000000 \lor \neg \left(y \leq 3.6 \cdot 10^{+71}\right):\\ \;\;\;\;z + \left(x + z \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;z + \left(x + y\right)\\ \end{array} \]
Alternative 7
Error19.2
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -45000000000000:\\ \;\;\;\;x - z\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+71}:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]
Alternative 8
Error26.0
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-42}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-10}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error20.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{-62}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 5.3 \cdot 10^{-143}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 10
Error28.1
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -5.9 \cdot 10^{-55}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-8}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error36.4
Cost64
\[x \]

Error

Reproduce

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