?

Average Accuracy: 99.9% → 99.9%
Time: 10.3s
Precision: binary64
Cost: 13248

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.9%

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Taylor expanded in x around 0 99.9%

    \[\leadsto \color{blue}{\left(\cos y + x\right) - z \cdot \sin y} \]
  3. Simplified99.9%

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

    [Start]99.9

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

    associate-+r- [<=]99.9

    \[ \color{blue}{\cos y + \left(x - z \cdot \sin y\right)} \]
  4. Final simplification99.9%

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

Alternatives

Alternative 1
Accuracy90.3%
Cost13385
\[\begin{array}{l} \mathbf{if}\;x \leq -0.0095 \lor \neg \left(x \leq 1.2 \cdot 10^{-15}\right):\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;\cos y - z \cdot \sin y\\ \end{array} \]
Alternative 2
Accuracy70.3%
Cost6992
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-9}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-218}:\\ \;\;\;\;\cos y\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-184}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-15}:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 3
Accuracy82.4%
Cost6921
\[\begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+109} \lor \neg \left(z \leq 3.3 \cdot 10^{+157}\right):\\ \;\;\;\;z \cdot \left(-\sin y\right)\\ \mathbf{else}:\\ \;\;\;\;\cos y + x\\ \end{array} \]
Alternative 4
Accuracy79.9%
Cost6857
\[\begin{array}{l} \mathbf{if}\;y \leq -2.35 \cdot 10^{-5} \lor \neg \left(y \leq 4.1 \cdot 10^{-25}\right):\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \end{array} \]
Alternative 5
Accuracy68.9%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+40}:\\ \;\;\;\;x + -1\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+83}:\\ \;\;\;\;x + \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 6
Accuracy65.9%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.16:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-18}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 7
Accuracy61.7%
Cost388
\[\begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+250}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 8
Accuracy60.4%
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{-8}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Accuracy61.2%
Cost192
\[x + 1 \]
Alternative 10
Accuracy21.3%
Cost64
\[1 \]

Error

Reproduce?

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