Average Error: 0.1 → 0.1
Time: 9.5s
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
Cost13385
\[\begin{array}{l} t_0 := z \cdot \sin y\\ \mathbf{if}\;x \leq -3.5 \cdot 10^{-10} \lor \neg \left(x \leq 5.2 \cdot 10^{-14}\right):\\ \;\;\;\;\left(x + 1\right) - t_0\\ \mathbf{else}:\\ \;\;\;\;\cos y - t_0\\ \end{array} \]
Alternative 2
Error20.9
Cost7256
\[\begin{array}{l} t_0 := 1 + \left(x - y \cdot z\right)\\ t_1 := z \cdot \left(-\sin y\right)\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+176}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7 \cdot 10^{+41}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -36000000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+120}:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 3
Error15.1
Cost7248
\[\begin{array}{l} t_0 := 1 - z \cdot \sin y\\ \mathbf{if}\;x \leq -29:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq -6.1 \cdot 10^{-158}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-296}:\\ \;\;\;\;\cos y\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 4
Error9.1
Cost7248
\[\begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := x - t_0\\ t_2 := 1 - t_0\\ \mathbf{if}\;x \leq -29:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-167}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-298}:\\ \;\;\;\;\cos y\\ \mathbf{elif}\;x \leq 1.05:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error8.6
Cost7113
\[\begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{-168} \lor \neg \left(x \leq -2.1 \cdot 10^{-296}\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\cos y\\ \end{array} \]
Alternative 6
Error5.1
Cost7113
\[\begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-143} \lor \neg \left(z \leq 3.8 \cdot 10^{-135}\right):\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;\left(x + \cos y\right) - y \cdot z\\ \end{array} \]
Alternative 7
Error19.2
Cost6992
\[\begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-9}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-292}:\\ \;\;\;\;\cos y\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-52}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-12}:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 8
Error19.4
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+38}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 3.15:\\ \;\;\;\;1 + \left(x - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 9
Error21.5
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-9}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-43}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
Alternative 10
Error24.2
Cost388
\[\begin{array}{l} \mathbf{if}\;z \leq 9.2 \cdot 10^{+192}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-z\right)\\ \end{array} \]
Alternative 11
Error25.1
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -0.98:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error24.6
Cost192
\[x + 1 \]
Alternative 13
Error50.4
Cost64
\[1 \]

Error

Reproduce

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