Average Error: 0.0 → 0.0
Time: 2.4s
Precision: binary64
Cost: 448
\[0.5 \cdot \left(x \cdot x - y\right) \]
\[0.5 \cdot \left(x \cdot x - y\right) \]
(FPCore (x y) :precision binary64 (* 0.5 (- (* x x) y)))
(FPCore (x y) :precision binary64 (* 0.5 (- (* x x) y)))
double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}
double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 0.5d0 * ((x * x) - y)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 0.5d0 * ((x * x) - y)
end function
public static double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}
public static double code(double x, double y) {
	return 0.5 * ((x * x) - y);
}
def code(x, y):
	return 0.5 * ((x * x) - y)
def code(x, y):
	return 0.5 * ((x * x) - y)
function code(x, y)
	return Float64(0.5 * Float64(Float64(x * x) - y))
end
function code(x, y)
	return Float64(0.5 * Float64(Float64(x * x) - y))
end
function tmp = code(x, y)
	tmp = 0.5 * ((x * x) - y);
end
function tmp = code(x, y)
	tmp = 0.5 * ((x * x) - y);
end
code[x_, y_] := N[(0.5 * N[(N[(x * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(0.5 * N[(N[(x * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
0.5 \cdot \left(x \cdot x - y\right)
0.5 \cdot \left(x \cdot x - y\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[0.5 \cdot \left(x \cdot x - y\right) \]
  2. Final simplification0.0

    \[\leadsto 0.5 \cdot \left(x \cdot x - y\right) \]

Alternatives

Alternative 1
Error10.6
Cost584
\[\begin{array}{l} t_0 := x \cdot \left(0.5 \cdot x\right)\\ \mathbf{if}\;x \leq -431912211370920500:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.969774585051767 \cdot 10^{-30}:\\ \;\;\;\;y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error20.8
Cost192
\[y \cdot -0.5 \]

Error

Reproduce

herbie shell --seed 2022317 
(FPCore (x y)
  :name "System.Random.MWC.Distributions:standard from mwc-random-0.13.3.2"
  :precision binary64
  (* 0.5 (- (* x x) y)))