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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.2

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

    \[\leadsto \color{blue}{1 - \left(\frac{1}{x \cdot 9} + \frac{\frac{y}{3}}{\sqrt{x}}\right)} \]
    Proof
    (-.f64 1 (+.f64 (/.f64 1 (*.f64 x 9)) (/.f64 (/.f64 y 3) (sqrt.f64 x)))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (+.f64 (/.f64 1 (*.f64 x 9)) (Rewrite<= associate-/r*_binary64 (/.f64 y (*.f64 3 (sqrt.f64 x)))))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (+.f64 (/.f64 1 (*.f64 x 9)) (/.f64 y (*.f64 3 (sqrt.f64 x)))))))): 0 points increase in error, 13 points decrease in error
    (-.f64 1 (neg.f64 (Rewrite=> distribute-neg-in_binary64 (+.f64 (neg.f64 (/.f64 1 (*.f64 x 9))) (neg.f64 (/.f64 y (*.f64 3 (sqrt.f64 x)))))))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (Rewrite=> distribute-neg-in_binary64 (+.f64 (neg.f64 (neg.f64 (/.f64 1 (*.f64 x 9)))) (neg.f64 (neg.f64 (/.f64 y (*.f64 3 (sqrt.f64 x)))))))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (+.f64 (neg.f64 (neg.f64 (/.f64 1 (*.f64 x 9)))) (Rewrite=> remove-double-neg_binary64 (/.f64 y (*.f64 3 (sqrt.f64 x)))))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 y (*.f64 3 (sqrt.f64 x))) (neg.f64 (neg.f64 (/.f64 1 (*.f64 x 9))))))): 0 points increase in error, 0 points decrease in error
    (-.f64 1 (Rewrite<= sub-neg_binary64 (-.f64 (/.f64 y (*.f64 3 (sqrt.f64 x))) (neg.f64 (/.f64 1 (*.f64 x 9)))))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 1 (/.f64 y (*.f64 3 (sqrt.f64 x)))) (neg.f64 (/.f64 1 (*.f64 x 9))))): 1 points increase in error, 0 points decrease in error
    (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 (/.f64 1 (*.f64 x 9))) (-.f64 1 (/.f64 y (*.f64 3 (sqrt.f64 x)))))): 0 points increase in error, 1 points decrease in error
    (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (neg.f64 (/.f64 1 (*.f64 x 9))) 1) (/.f64 y (*.f64 3 (sqrt.f64 x))))): 0 points increase in error, 0 points decrease in error
    (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 1 (neg.f64 (/.f64 1 (*.f64 x 9))))) (/.f64 y (*.f64 3 (sqrt.f64 x)))): 0 points increase in error, 0 points decrease in error
    (-.f64 (Rewrite<= sub-neg_binary64 (-.f64 1 (/.f64 1 (*.f64 x 9)))) (/.f64 y (*.f64 3 (sqrt.f64 x)))): 0 points increase in error, 0 points decrease in error
  3. Applied egg-rr0.2

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

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

Alternatives

Alternative 1
Error3.9
Cost7241
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+66} \lor \neg \left(y \leq 5.8 \cdot 10^{+87}\right):\\ \;\;\;\;1 + \sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \end{array} \]
Alternative 2
Error4.0
Cost7240
\[\begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+67}:\\ \;\;\;\;1 + \frac{y \cdot 3}{\sqrt{x} \cdot -9}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+87}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;1 + \sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\ \end{array} \]
Alternative 3
Error0.2
Cost7104
\[1 + \left(\frac{-0.1111111111111111}{x} - \frac{\frac{y}{3}}{\sqrt{x}}\right) \]
Alternative 4
Error5.2
Cost6985
\[\begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+68} \lor \neg \left(y \leq 4.1 \cdot 10^{+93}\right):\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \end{array} \]
Alternative 5
Error5.3
Cost6984
\[\begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+68}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+93}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\ \end{array} \]
Alternative 6
Error5.2
Cost6984
\[\begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+67}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+93}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\ \end{array} \]
Alternative 7
Error5.3
Cost6984
\[\begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+67}:\\ \;\;\;\;-0.3333333333333333 \cdot \left(y \cdot {x}^{-0.5}\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+92}:\\ \;\;\;\;1 + \frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\ \end{array} \]
Alternative 8
Error22.2
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq 0.11:\\ \;\;\;\;\frac{-0.1111111111111111}{x}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 9
Error21.5
Cost320
\[1 + \frac{-0.1111111111111111}{x} \]
Alternative 10
Error42.5
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022343 
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
  :precision binary64

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

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