Average Error: 0.4 → 0.4
Time: 6.8s
Precision: binary64
Cost: 7360
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
\[\sqrt{x \cdot 9} \cdot \left(\left(\left(\frac{0.1111111111111111}{x} + \left(y + 1\right)\right) + -1\right) + -1\right) \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y)
 :precision binary64
 (* (sqrt (* x 9.0)) (+ (+ (+ (/ 0.1111111111111111 x) (+ y 1.0)) -1.0) -1.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 sqrt((x * 9.0)) * ((((0.1111111111111111 / x) + (y + 1.0)) + -1.0) + -1.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 = sqrt((x * 9.0d0)) * ((((0.1111111111111111d0 / x) + (y + 1.0d0)) + (-1.0d0)) + (-1.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 Math.sqrt((x * 9.0)) * ((((0.1111111111111111 / x) + (y + 1.0)) + -1.0) + -1.0);
}
def code(x, y):
	return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
def code(x, y):
	return math.sqrt((x * 9.0)) * ((((0.1111111111111111 / x) + (y + 1.0)) + -1.0) + -1.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(sqrt(Float64(x * 9.0)) * Float64(Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + 1.0)) + -1.0) + -1.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 = sqrt((x * 9.0)) * ((((0.1111111111111111 / x) + (y + 1.0)) + -1.0) + -1.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[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\sqrt{x \cdot 9} \cdot \left(\left(\left(\frac{0.1111111111111111}{x} + \left(y + 1\right)\right) + -1\right) + -1\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.4
Target0.4
Herbie0.4
\[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. Applied egg-rr0.4

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

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

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

Alternatives

Alternative 1
Error1.1
Cost7240
\[\begin{array}{l} t_0 := \sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + y \cdot 3\right)\\ \mathbf{if}\;y \leq -15275159.0048972:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.06335512579798619:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error9.8
Cost7112
\[\begin{array}{l} t_0 := \sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{if}\;y \leq -3.011359923061425 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.0154848721891453 \cdot 10^{+45}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error9.8
Cost7112
\[\begin{array}{l} \mathbf{if}\;y \leq -15275159.0048972:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot \left(y + -1\right)\\ \mathbf{elif}\;y \leq 1.0154848721891453 \cdot 10^{+45}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \end{array} \]
Alternative 4
Error22.0
Cost6984
\[\begin{array}{l} \mathbf{if}\;x \leq 1.2088796804753868 \cdot 10^{-14}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 3.031459683253695 \cdot 10^{+34}:\\ \;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 5
Error22.0
Cost6984
\[\begin{array}{l} \mathbf{if}\;x \leq 1.2088796804753868 \cdot 10^{-14}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{elif}\;x \leq 3.031459683253695 \cdot 10^{+34}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 6
Error22.0
Cost6984
\[\begin{array}{l} \mathbf{if}\;x \leq 9.060765594092199 \cdot 10^{-14}:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x} + -2}\\ \mathbf{elif}\;x \leq 3.031459683253695 \cdot 10^{+34}:\\ \;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 7
Error45.8
Cost6724
\[\begin{array}{l} \mathbf{if}\;x \leq 0.032864545335528544:\\ \;\;\;\;\sqrt{x \cdot 9}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 8
Error22.4
Cost6724
\[\begin{array}{l} \mathbf{if}\;x \leq 0.032864545335528544:\\ \;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 9
Error61.9
Cost6592
\[\sqrt{x \cdot 9} \]

Error

Reproduce

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