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
Error20.3
Cost7252
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;y \leq -2.380352982134691 \cdot 10^{+160}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.427922393040104 \cdot 10^{+87}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -0.08996209833038692:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3659287558771437:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{elif}\;y \leq 8.238487680462956 \cdot 10^{+172}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 2
Error9.8
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -4.415234112267413 \cdot 10^{+78}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.8470280334412355 \cdot 10^{-53}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 350413565150.9004:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 1.2865172192115594 \cdot 10^{+152}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error3.3
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -1.8470280334412355 \cdot 10^{-53}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 8.255363010356919 \cdot 10^{-46}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error1.0
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -764.4658699606699:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 8.255363010356919 \cdot 10^{-46}:\\ \;\;\;\;z + \left(x + \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error19.7
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -6.769775456934134 \cdot 10^{+50}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.0426390121999264 \cdot 10^{-34}:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 6
Error27.0
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -128085349078244210:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.955737922670193 \cdot 10^{-36}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error20.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -3.711949721195061 \cdot 10^{-102}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 4.815017388032583 \cdot 10^{-136}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 8
Error29.1
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -128085349078244210:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.955737922670193 \cdot 10^{-36}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error47.6
Cost64
\[z \]

Error

Reproduce

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