Average Error: 0.1 → 0.1
Time: 10.3s
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
Error17.6
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.0534156578752266 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.2074896383650917 \cdot 10^{-154}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 3.300257962750949 \cdot 10^{-115}:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;z \leq 1.4244920644270548 \cdot 10^{+91}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error17.5
Cost7120
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.0534156578752266 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.304744146654871 \cdot 10^{-163}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 3.300257962750949 \cdot 10^{-115}:\\ \;\;\;\;\sin y + z\\ \mathbf{elif}\;z \leq 1.4244920644270548 \cdot 10^{+91}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error20.9
Cost6992
\[\begin{array}{l} \mathbf{if}\;y \leq -2.7391698505992075 \cdot 10^{+117}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -51842453278644180:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;y \leq 2.4789776165847412 \cdot 10^{+47}:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{elif}\;y \leq 2.7968149682654336 \cdot 10^{+193}:\\ \;\;\;\;\sin y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 4
Error6.7
Cost6984
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.0534156578752266 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.4244920644270548 \cdot 10^{+91}:\\ \;\;\;\;\left(x + \sin y\right) + z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error11.5
Cost6856
\[\begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.0534156578752266 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.302465312052749:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error18.8
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.157284451639278 \cdot 10^{+30}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 5.35943775166028 \cdot 10^{+26}:\\ \;\;\;\;z + \left(x + y\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 7
Error26.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -5.191194434202434 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 9.094951084433948 \cdot 10^{-24}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error20.3
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -8.873331023590138 \cdot 10^{-184}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 8.334243119741936 \cdot 10^{-170}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 9
Error31.2
Cost328
\[\begin{array}{l} \mathbf{if}\;z \leq -4.5602082127160673 \cdot 10^{+86}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 4.302465312052749:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 10
Error36.8
Cost64
\[x \]

Error

Reproduce

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