Average Error: 0.1 → 0.1
Time: 19.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
Error21.1
Cost7256
\[\begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-220}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-259}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{-250}:\\ \;\;\;\;y + z\\ \mathbf{elif}\;x \leq 2.85 \cdot 10^{-216}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-141}:\\ \;\;\;\;y + z\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-116}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 2
Error17.5
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;x \leq -2.35 \cdot 10^{+20}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-221}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.48 \cdot 10^{-235}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 3
Error10.9
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;x \leq -5.4 \cdot 10^{-221}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-235}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error0.5
Cost6984
\[\begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -1.14 \cdot 10^{+14}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.1:\\ \;\;\;\;\left(x + \sin y\right) + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error20.4
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-113}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-154}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 6
Error21.5
Cost192
\[x + z \]
Alternative 7
Error47.1
Cost64
\[z \]

Error

Reproduce

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