Average Error: 0.4 → 0.3
Time: 2.8s
Precision: binary64
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
\[\left(y \cdot \sqrt{x \cdot 9} + \sqrt{\frac{0.1111111111111111}{x}}\right) + \sqrt{x} \cdot -3 \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y)
 :precision binary64
 (+
  (+ (* y (sqrt (* x 9.0))) (sqrt (/ 0.1111111111111111 x)))
  (* (sqrt x) -3.0)))
double code(double x, double y) {
	return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
double code(double x, double y) {
	return ((y * sqrt((x * 9.0))) + sqrt((0.1111111111111111 / x))) + (sqrt(x) * -3.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((y * sqrt((x * 9.0d0))) + sqrt((0.1111111111111111d0 / x))) + (sqrt(x) * (-3.0d0))
end function
public static double code(double x, double y) {
	return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
public static double code(double x, double y) {
	return ((y * Math.sqrt((x * 9.0))) + Math.sqrt((0.1111111111111111 / x))) + (Math.sqrt(x) * -3.0);
}
def code(x, y):
	return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
def code(x, y):
	return ((y * math.sqrt((x * 9.0))) + math.sqrt((0.1111111111111111 / x))) + (math.sqrt(x) * -3.0)
function code(x, y)
	return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0))
end
function code(x, y)
	return Float64(Float64(Float64(y * sqrt(Float64(x * 9.0))) + sqrt(Float64(0.1111111111111111 / x))) + Float64(sqrt(x) * -3.0))
end
function tmp = code(x, y)
	tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
end
function tmp = code(x, y)
	tmp = ((y * sqrt((x * 9.0))) + sqrt((0.1111111111111111 / x))) + (sqrt(x) * -3.0);
end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\left(y \cdot \sqrt{x \cdot 9} + \sqrt{\frac{0.1111111111111111}{x}}\right) + \sqrt{x} \cdot -3

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.4
Target0.4
Herbie0.3
\[3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right) \]

Derivation

  1. Initial program 0.4

    \[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
  2. Simplified0.4

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + \mathsf{fma}\left(3, y, -3\right)\right)} \]
  3. Taylor expanded in y around 0 0.4

    \[\leadsto \color{blue}{\left(3 \cdot \left(y \cdot \sqrt{x}\right) + 0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right) - 3 \cdot \sqrt{x}} \]
  4. Applied egg-rr0.4

    \[\leadsto \left(3 \cdot \left(y \cdot \sqrt{x}\right) + \color{blue}{\frac{0.3333333333333333}{\sqrt{x}}}\right) - 3 \cdot \sqrt{x} \]
  5. Applied egg-rr0.4

    \[\leadsto \left(\color{blue}{{\left(y \cdot \sqrt{x \cdot 9}\right)}^{1}} + \frac{0.3333333333333333}{\sqrt{x}}\right) - 3 \cdot \sqrt{x} \]
  6. Applied egg-rr0.3

    \[\leadsto \left({\left(y \cdot \sqrt{x \cdot 9}\right)}^{1} + \color{blue}{\sqrt{\frac{0.1111111111111111}{x}}}\right) - 3 \cdot \sqrt{x} \]
  7. Final simplification0.3

    \[\leadsto \left(y \cdot \sqrt{x \cdot 9} + \sqrt{\frac{0.1111111111111111}{x}}\right) + \sqrt{x} \cdot -3 \]

Reproduce

herbie shell --seed 2022162 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))

  (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))