?

Average Error: 0.1 → 0.1
Time: 13.8s
Precision: binary64
Cost: 448

?

\[x + \frac{x - y}{2} \]
\[x + \frac{x - y}{2} \]
(FPCore (x y) :precision binary64 (+ x (/ (- x y) 2.0)))
(FPCore (x y) :precision binary64 (+ x (/ (- x y) 2.0)))
double code(double x, double y) {
	return x + ((x - y) / 2.0);
}
double code(double x, double y) {
	return x + ((x - y) / 2.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x + ((x - y) / 2.0d0)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x + ((x - y) / 2.0d0)
end function
public static double code(double x, double y) {
	return x + ((x - y) / 2.0);
}
public static double code(double x, double y) {
	return x + ((x - y) / 2.0);
}
def code(x, y):
	return x + ((x - y) / 2.0)
def code(x, y):
	return x + ((x - y) / 2.0)
function code(x, y)
	return Float64(x + Float64(Float64(x - y) / 2.0))
end
function code(x, y)
	return Float64(x + Float64(Float64(x - y) / 2.0))
end
function tmp = code(x, y)
	tmp = x + ((x - y) / 2.0);
end
function tmp = code(x, y)
	tmp = x + ((x - y) / 2.0);
end
code[x_, y_] := N[(x + N[(N[(x - y), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(x + N[(N[(x - y), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
x + \frac{x - y}{2}
x + \frac{x - y}{2}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[1.5 \cdot x - 0.5 \cdot y \]

Derivation?

  1. Initial program 0.1

    \[x + \frac{x - y}{2} \]
  2. Final simplification0.1

    \[\leadsto x + \frac{x - y}{2} \]

Alternatives

Alternative 1
Error16.5
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+20}:\\ \;\;\;\;-0.5 \cdot y\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-86}:\\ \;\;\;\;\left(-y\right) + x \cdot 1.5\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot y\\ \end{array} \]
Alternative 2
Error17.6
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+21}:\\ \;\;\;\;-0.5 \cdot y\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-95}:\\ \;\;\;\;1.5 \cdot x\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot y\\ \end{array} \]
Alternative 3
Error31.8
Cost192
\[-0.5 \cdot y \]
Alternative 4
Error56.9
Cost128
\[-y \]

Error

Reproduce?

herbie shell --seed 2023077 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Axis.Types:hBufferRect from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- (* 1.5 x) (* 0.5 y))

  (+ x (/ (- x y) 2.0)))