?

Average Error: 0.4 → 0.4
Time: 14.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 \left(3 \cdot \left(\left(\frac{1}{x \cdot 9} - \left(-1 - y\right)\right) - 2\right)\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) (* 3.0 (- (- (/ 1.0 (* x 9.0)) (- -1.0 y)) 2.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) * (3.0 * (((1.0 / (x * 9.0)) - (-1.0 - y)) - 2.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) * (3.0d0 * (((1.0d0 / (x * 9.0d0)) - ((-1.0d0) - y)) - 2.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) * (3.0 * (((1.0 / (x * 9.0)) - (-1.0 - y)) - 2.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) * (3.0 * (((1.0 / (x * 9.0)) - (-1.0 - y)) - 2.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(x) * Float64(3.0 * Float64(Float64(Float64(1.0 / Float64(x * 9.0)) - Float64(-1.0 - y)) - 2.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) * (3.0 * (((1.0 / (x * 9.0)) - (-1.0 - y)) - 2.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[x], $MachinePrecision] * N[(3.0 * N[(N[(N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\sqrt{x} \cdot \left(3 \cdot \left(\left(\frac{1}{x \cdot 9} - \left(-1 - y\right)\right) - 2\right)\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}{\left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right) + 0} \]
  3. Simplified0.4

    \[\leadsto \color{blue}{\sqrt{x} \cdot \left(3 \cdot \left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right)\right)} \]
    Proof

    [Start]0.4

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

    rational.json-simplify-4 [=>]0.4

    \[ \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right)} \]

    rational.json-simplify-2 [=>]0.4

    \[ \color{blue}{\left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right) \cdot \left(3 \cdot \sqrt{x}\right)} \]

    rational.json-simplify-2 [=>]0.4

    \[ \left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right) \cdot \color{blue}{\left(\sqrt{x} \cdot 3\right)} \]

    rational.json-simplify-43 [=>]0.4

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

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

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

Alternatives

Alternative 1
Error11.9
Cost7376
\[\begin{array}{l} t_0 := \sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} - 3\right)\\ \mathbf{if}\;y \leq -6.8 \cdot 10^{+144}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+23}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -0.0039:\\ \;\;\;\;\sqrt{x} \cdot \left(-3 + 3 \cdot y\right)\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{+107}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot 3\right)\\ \end{array} \]
Alternative 2
Error11.9
Cost7376
\[\begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+144}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{+24}:\\ \;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 3\right)\\ \mathbf{elif}\;y \leq -0.0036:\\ \;\;\;\;\sqrt{x} \cdot \left(-3 + 3 \cdot y\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+107}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} - 3\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot 3\right)\\ \end{array} \]
Alternative 3
Error0.4
Cost7232
\[\sqrt{x} \cdot \left(3 \cdot \left(\frac{1}{x \cdot 9} + \left(y + -1\right)\right)\right) \]
Alternative 4
Error0.4
Cost7104
\[3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right) \]
Alternative 5
Error0.4
Cost7104
\[\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right) \]
Alternative 6
Error0.4
Cost7104
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{0.1111111111111111}{x}\right) - 1\right) \]
Alternative 7
Error27.2
Cost6984
\[\begin{array}{l} t_0 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-5}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error27.2
Cost6984
\[\begin{array}{l} t_0 := y \cdot \left(\sqrt{x} \cdot 3\right)\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-5}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error27.2
Cost6984
\[\begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-5}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot 3\right)\\ \end{array} \]
Alternative 10
Error21.3
Cost6984
\[\begin{array}{l} \mathbf{if}\;x \leq 7.7 \cdot 10^{-16}:\\ \;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ \mathbf{elif}\;x \leq 1650:\\ \;\;\;\;y \cdot \left(\sqrt{x} \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 11
Error8.9
Cost6980
\[\begin{array}{l} \mathbf{if}\;x \leq 1.85 \cdot 10^{-15}:\\ \;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot \left(-3 + 3 \cdot y\right)\\ \end{array} \]
Alternative 12
Error46.8
Cost6592
\[\sqrt{x} \cdot -3 \]

Error

Reproduce?

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