Average Error: 0.4 → 0.4
Time: 3.3s
Precision: binary64
\[\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)\]
\[\sqrt{x} \cdot \left(3 \cdot y\right) + 3 \cdot \left(\frac{\frac{1}{9}}{\sqrt{x}} + \sqrt{x} \cdot \left(-1\right)\right)\]

Error

Bits error versus x

Bits error versus y

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. Simplified0.4

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

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

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

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

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

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

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

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

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

    \[\leadsto 3 \cdot \left(\color{blue}{{\left(\sqrt{x}\right)}^{1}} \cdot {y}^{1}\right) + 3 \cdot \left(\frac{\frac{1}{9}}{\sqrt{x}} + 1 \cdot \left(-\sqrt{x}\right)\right)\]
  16. Applied pow-prod-down0.4

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

    \[\leadsto \color{blue}{{3}^{1}} \cdot {\left(\sqrt{x} \cdot y\right)}^{1} + 3 \cdot \left(\frac{\frac{1}{9}}{\sqrt{x}} + 1 \cdot \left(-\sqrt{x}\right)\right)\]
  18. Applied pow-prod-down0.4

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

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

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

Reproduce

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