?

Average Error: 0.1 → 0.1
Time: 16.2s
Precision: binary64
Cost: 13248

?

\[\left(x + \sin y\right) + z \cdot \cos y \]
\[\sin y + \left(x + z \cdot \cos y\right) \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
(FPCore (x y z) :precision binary64 (+ (sin y) (+ x (* 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 sin(y) + (x + (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 = sin(y) + (x + (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 Math.sin(y) + (x + (z * Math.cos(y)));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
def code(x, y, z):
	return math.sin(y) + (x + (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(sin(y) + Float64(x + 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 = sin(y) + (x + (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[Sin[y], $MachinePrecision] + N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + \sin y\right) + z \cdot \cos y
\sin y + \left(x + z \cdot \cos 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. Simplified0.1

    \[\leadsto \color{blue}{\sin y + \left(x + z \cdot \cos y\right)} \]
    Proof

    [Start]0.1

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

    rational.json-simplify-1 [=>]0.1

    \[ \color{blue}{z \cdot \cos y + \left(x + \sin y\right)} \]

    rational.json-simplify-1 [=>]0.1

    \[ z \cdot \cos y + \color{blue}{\left(\sin y + x\right)} \]

    rational.json-simplify-41 [=>]0.1

    \[ \color{blue}{\sin y + \left(x + z \cdot \cos y\right)} \]
  3. Final simplification0.1

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

Alternatives

Alternative 1
Error7.3
Cost13384
\[\begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-5}:\\ \;\;\;\;\sin y + \left(x + z\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+39}:\\ \;\;\;\;z \cdot \cos y + \sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 2
Error6.8
Cost7112
\[\begin{array}{l} t_0 := 0.5 \cdot \left(\cos y \cdot \left(z + z\right)\right)\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+102}:\\ \;\;\;\;\sin y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error21.1
Cost6860
\[\begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{-221}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 5.7 \cdot 10^{-145}:\\ \;\;\;\;y + \left(z + x\right)\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-68}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 4
Error14.1
Cost6856
\[\begin{array}{l} \mathbf{if}\;x \leq -0.00265:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-9}:\\ \;\;\;\;z + \sin y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 5
Error12.4
Cost6856
\[\begin{array}{l} t_0 := \sin y + x\\ \mathbf{if}\;y \leq -19000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-5}:\\ \;\;\;\;y + \left(z + x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error11.3
Cost6720
\[\sin y + \left(x + z\right) \]
Alternative 7
Error29.3
Cost592
\[\begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-109}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-69}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error19.1
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -265000000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 2700:\\ \;\;\;\;y + \left(z + x\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 9
Error20.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-221}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-99}:\\ \;\;\;\;z + y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
Alternative 10
Error29.0
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{+37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error21.8
Cost192
\[z + x \]
Alternative 12
Error36.7
Cost64
\[x \]

Error

Reproduce?

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