Average Error: 0.1 → 0.1
Time: 10.0s
Precision: binary64
Cost: 13248
\[\left(x + \cos y\right) - z \cdot \sin y \]
\[\left(x + \cos y\right) - z \cdot \sin y \]
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * sin(y));
}
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * sin(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 + cos(y)) - (z * sin(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 + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + \cos y\right) - z \cdot \sin y
\left(x + \cos y\right) - z \cdot \sin y

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

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

Alternatives

Alternative 1
Error0.5
Cost13384
\[\begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + 1\right) - t_0\\ \mathbf{if}\;x \leq -1.3885609764477047:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6874956885151152 \cdot 10^{-7}:\\ \;\;\;\;\cos y - t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error19.6
Cost7316
\[\begin{array}{l} t_0 := z \cdot \left(-\sin y\right)\\ \mathbf{if}\;y \leq -2.7391698505992075 \cdot 10^{+117}:\\ \;\;\;\;\left(x + 1\right) + -1\\ \mathbf{elif}\;y \leq -1087248.8732826526:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4.061146230053281:\\ \;\;\;\;\left(x + 1\right) - y \cdot z\\ \mathbf{elif}\;y \leq 1.832855962650182 \cdot 10^{+188}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0971381787016548 \cdot 10^{+246}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error4.8
Cost7112
\[\begin{array}{l} t_0 := \left(x + 1\right) - z \cdot \sin y\\ \mathbf{if}\;z \leq -1.1367381392988578 \cdot 10^{-35}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.3431943441470405 \cdot 10^{-118}:\\ \;\;\;\;\left(x + \cos y\right) - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error8.0
Cost6984
\[\begin{array}{l} t_0 := x - z \cdot \sin y\\ \mathbf{if}\;y \leq -2118.2177773064186:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 7.091364654997538 \cdot 10^{-12}:\\ \;\;\;\;\left(x + 1\right) - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error7.3
Cost6848
\[\left(x + 1\right) - z \cdot \sin y \]
Alternative 6
Error19.9
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -1.251112061876193 \cdot 10^{+113}:\\ \;\;\;\;\left(x + 1\right) + -1\\ \mathbf{elif}\;y \leq 1.0296201494859228 \cdot 10^{+55}:\\ \;\;\;\;\left(x + 1\right) - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error33.5
Cost584
\[\begin{array}{l} t_0 := \left(x + 1\right) + -1\\ \mathbf{if}\;x \leq -4.823321626499339 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9.094951084433948 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error31.9
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.251112061876193 \cdot 10^{+113}:\\ \;\;\;\;\left(x + 1\right) + -1\\ \mathbf{elif}\;y \leq 7.555858517037802 \cdot 10^{+25}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error33.3
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3885609764477047:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 9.094951084433948 \cdot 10^{-24}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error36.7
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, B"
  :precision binary64
  (- (+ x (cos y)) (* z (sin y))))