?

Average Error: 0.64% → 0.65%
Time: 12.2s
Precision: binary64
Cost: 7232

?

\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right) \]
\[3 \cdot \left(\sqrt{x} \cdot \left(y + \left(\frac{\frac{1}{x}}{9} + -1\right)\right)\right) \]
(FPCore (x y)
 :precision binary64
 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y)
 :precision binary64
 (* 3.0 (* (sqrt x) (+ y (+ (/ (/ 1.0 x) 9.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 3.0 * (sqrt(x) * (y + (((1.0 / x) / 9.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 = 3.0d0 * (sqrt(x) * (y + (((1.0d0 / x) / 9.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 3.0 * (Math.sqrt(x) * (y + (((1.0 / x) / 9.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 3.0 * (math.sqrt(x) * (y + (((1.0 / x) / 9.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(3.0 * Float64(sqrt(x) * Float64(y + Float64(Float64(Float64(1.0 / x) / 9.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 = 3.0 * (sqrt(x) * (y + (((1.0 / x) / 9.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[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + N[(N[(N[(1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
3 \cdot \left(\sqrt{x} \cdot \left(y + \left(\frac{\frac{1}{x}}{9} + -1\right)\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 0.64

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

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

    [Start]0.64

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

    associate-*l* [=>]0.62

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

    *-rgt-identity [<=]0.62

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

    associate-*l* [=>]0.62

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

    associate-*l* [<=]0.62

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

    *-rgt-identity [=>]0.62

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

    associate--l+ [=>]0.62

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

    +-commutative [=>]0.62

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

    remove-double-neg [<=]0.62

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

    sub-neg [<=]0.62

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

    sub-neg [=>]0.62

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

    remove-double-neg [=>]0.62

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

    +-commutative [<=]0.62

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

    sub-neg [=>]0.62

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

    sub-neg [<=]0.62

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

    associate-/r* [=>]0.65

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

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

Alternatives

Alternative 1
Error37.03%
Cost7513
\[\begin{array}{l} t_0 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ t_1 := y \cdot \left(3 \cdot \sqrt{x}\right)\\ \mathbf{if}\;x \leq 7.3 \cdot 10^{-180}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-72}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+51}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+198} \lor \neg \left(x \leq 7.4 \cdot 10^{+220}\right):\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error37.03%
Cost7513
\[\begin{array}{l} t_0 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\ \mathbf{if}\;x \leq 7.3 \cdot 10^{-180}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-167}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-71}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+50}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+198} \lor \neg \left(x \leq 2.9 \cdot 10^{+220}\right):\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\ \end{array} \]
Alternative 3
Error37.07%
Cost7513
\[\begin{array}{l} t_0 := 3 \cdot \frac{\sqrt{x}}{x \cdot 9}\\ \mathbf{if}\;x \leq 7.3 \cdot 10^{-180}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-167}:\\ \;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\ \mathbf{elif}\;x \leq 1.16 \cdot 10^{-71}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{+50}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+198} \lor \neg \left(x \leq 2.9 \cdot 10^{+220}\right):\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\ \end{array} \]
Alternative 4
Error15.12%
Cost7112
\[\begin{array}{l} \mathbf{if}\;y \leq -8.8 \cdot 10^{+45}:\\ \;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+46}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \end{array} \]
Alternative 5
Error15.11%
Cost7112
\[\begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+43}:\\ \;\;\;\;\sqrt{x \cdot 9} \cdot \left(y - 1\right)\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+47}:\\ \;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\ \mathbf{else}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \end{array} \]
Alternative 6
Error0.63%
Cost7104
\[3 \cdot \left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right) \]
Alternative 7
Error42.69%
Cost6985
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+24} \lor \neg \left(y \leq 3.7 \cdot 10^{-18}\right):\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \end{array} \]
Alternative 8
Error42.69%
Cost6984
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+24}:\\ \;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-18}:\\ \;\;\;\;\sqrt{x} \cdot -3\\ \mathbf{else}:\\ \;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\ \end{array} \]
Alternative 9
Error96.65%
Cost6592
\[\sqrt{x \cdot 9} \]
Alternative 10
Error72.81%
Cost6592
\[\sqrt{x} \cdot -3 \]

Error

Reproduce?

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