Average Error: 5.4 → 0.1
Time: 3.2s
Precision: binary64
\[x \cdot \left(1 + y \cdot y\right) \]
\[\mathsf{hypot}\left(1, y\right) \cdot \left(\mathsf{hypot}\left(1, y\right) \cdot x\right) \]
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* y y))))
(FPCore (x y) :precision binary64 (* (hypot 1.0 y) (* (hypot 1.0 y) x)))
double code(double x, double y) {
	return x * (1.0 + (y * y));
}
double code(double x, double y) {
	return hypot(1.0, y) * (hypot(1.0, y) * x);
}
public static double code(double x, double y) {
	return x * (1.0 + (y * y));
}
public static double code(double x, double y) {
	return Math.hypot(1.0, y) * (Math.hypot(1.0, y) * x);
}
def code(x, y):
	return x * (1.0 + (y * y))
def code(x, y):
	return math.hypot(1.0, y) * (math.hypot(1.0, y) * x)
function code(x, y)
	return Float64(x * Float64(1.0 + Float64(y * y)))
end
function code(x, y)
	return Float64(hypot(1.0, y) * Float64(hypot(1.0, y) * x))
end
function tmp = code(x, y)
	tmp = x * (1.0 + (y * y));
end
function tmp = code(x, y)
	tmp = hypot(1.0, y) * (hypot(1.0, y) * x);
end
code[x_, y_] := N[(x * N[(1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Sqrt[1.0 ^ 2 + y ^ 2], $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + y ^ 2], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
x \cdot \left(1 + y \cdot y\right)
\mathsf{hypot}\left(1, y\right) \cdot \left(\mathsf{hypot}\left(1, y\right) \cdot x\right)

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.4
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y \]

Derivation

  1. Initial program 5.4

    \[x \cdot \left(1 + y \cdot y\right) \]
  2. Simplified5.4

    \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(y, y, 1\right)} \]
  3. Applied egg-rr6.6

    \[\leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \mathsf{fma}\left(y, y, 1\right)}\right)}^{3}} \]
  4. Applied egg-rr0.1

    \[\leadsto \color{blue}{\mathsf{hypot}\left(1, y\right) \cdot \left(\mathsf{hypot}\left(1, y\right) \cdot x\right)} \]
  5. Final simplification0.1

    \[\leadsto \mathsf{hypot}\left(1, y\right) \cdot \left(\mathsf{hypot}\left(1, y\right) \cdot x\right) \]

Reproduce

herbie shell --seed 2022133 
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"
  :precision binary64

  :herbie-target
  (+ x (* (* x y) y))

  (* x (+ 1.0 (* y y))))