Average Error: 0.4 → 0.4
Time: 2.6s
Precision: 64
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\]
\[\frac{3}{x \cdot -1} \cdot \frac{\sqrt{x} \cdot \left(-1\right)}{9} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\frac{3}{x \cdot -1} \cdot \frac{\sqrt{x} \cdot \left(-1\right)}{9} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)
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 / (x * -1.0)) * ((sqrt(x) * -1.0) / 9.0)) + ((3.0 * sqrt(x)) * (y - 1.0)));
}

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.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. Using strategy rm
  3. Applied *-commutative0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{\color{blue}{9 \cdot x}}\right) - 1\right)\]
  4. Applied associate-/r*0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \color{blue}{\frac{\frac{1}{9}}{x}}\right) - 1\right)\]
  5. Using strategy rm
  6. Applied +-commutative0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \left(\color{blue}{\left(\frac{\frac{1}{9}}{x} + y\right)} - 1\right)\]
  7. Applied associate--l+0.4

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

    \[\leadsto \color{blue}{\left(3 \cdot \sqrt{x}\right) \cdot \frac{\frac{1}{9}}{x} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)}\]
  9. Using strategy rm
  10. Applied frac-2neg0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \frac{\color{blue}{\frac{-1}{-9}}}{x} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
  11. Applied associate-/l/0.4

    \[\leadsto \left(3 \cdot \sqrt{x}\right) \cdot \color{blue}{\frac{-1}{x \cdot \left(-9\right)}} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
  12. Applied associate-*r/0.4

    \[\leadsto \color{blue}{\frac{\left(3 \cdot \sqrt{x}\right) \cdot \left(-1\right)}{x \cdot \left(-9\right)}} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
  13. Using strategy rm
  14. Applied neg-mul-10.4

    \[\leadsto \frac{\left(3 \cdot \sqrt{x}\right) \cdot \left(-1\right)}{x \cdot \color{blue}{\left(-1 \cdot 9\right)}} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
  15. Applied associate-*r*0.4

    \[\leadsto \frac{\left(3 \cdot \sqrt{x}\right) \cdot \left(-1\right)}{\color{blue}{\left(x \cdot -1\right) \cdot 9}} + \left(3 \cdot \sqrt{x}\right) \cdot \left(y - 1\right)\]
  16. Applied associate-*l*0.4

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

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

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

Reproduce

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

  :herbie-target
  (* 3 (+ (* y (sqrt x)) (* (- (/ 1 (* x 9)) 1) (sqrt x))))

  (* (* 3 (sqrt x)) (- (+ y (/ 1 (* x 9))) 1)))