?

Average Error: 0.08% → 0.09%
Time: 11.7s
Precision: binary64
Cost: 13504

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.08

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Applied egg-rr50.5

    \[\leadsto \left(x + \cos y\right) - z \cdot \color{blue}{e^{\log \sin y}} \]
  3. Applied egg-rr0.09

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

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

Alternatives

Alternative 1
Error10.1%
Cost13384
\[\begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-10}:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+39}:\\ \;\;\;\;\cos y - \sin y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 2
Error0.08%
Cost13248
\[\left(x + \cos y\right) - \sin y \cdot z \]
Alternative 3
Error17.72%
Cost6921
\[\begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+177} \lor \neg \left(z \leq 5.2 \cdot 10^{+183}\right):\\ \;\;\;\;\sin y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
Alternative 4
Error18.44%
Cost6857
\[\begin{array}{l} \mathbf{if}\;y \leq -0.0056 \lor \neg \left(y \leq 2.4\right):\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x - y \cdot z\right)\\ \end{array} \]
Alternative 5
Error29.61%
Cost968
\[\begin{array}{l} \mathbf{if}\;y \leq -100000:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+49}:\\ \;\;\;\;\left(x + 1\right) + y \cdot \left(y \cdot -0.5 - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 6
Error29.39%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -16500:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+27}:\\ \;\;\;\;1 + \left(x - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 7
Error32.4%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{-13}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-13}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 8
Error37.87%
Cost388
\[\begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+262}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 9
Error38.7%
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -0.0033:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 0.245:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error37.95%
Cost192
\[x + 1 \]
Alternative 11
Error78.64%
Cost64
\[1 \]

Error

Reproduce?

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