Average Error: 5.5 → 0.1
Time: 3.7s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)\]
x \cdot \left(1 + y \cdot y\right)
\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)
double f(double x, double y) {
        double r562328 = x;
        double r562329 = 1.0;
        double r562330 = y;
        double r562331 = r562330 * r562330;
        double r562332 = r562329 + r562331;
        double r562333 = r562328 * r562332;
        return r562333;
}

double f(double x, double y) {
        double r562334 = 1.0;
        double r562335 = sqrt(r562334);
        double r562336 = y;
        double r562337 = hypot(r562335, r562336);
        double r562338 = x;
        double r562339 = r562338 * r562337;
        double r562340 = r562337 * r562339;
        return r562340;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.5
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 5.5

    \[x \cdot \left(1 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt5.5

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

    \[\leadsto \color{blue}{\left(x \cdot \sqrt{1 + y \cdot y}\right) \cdot \sqrt{1 + y \cdot y}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt5.5

    \[\leadsto \left(x \cdot \sqrt{1 + y \cdot y}\right) \cdot \sqrt{\color{blue}{\sqrt{1 + y \cdot y} \cdot \sqrt{1 + y \cdot y}}}\]
  7. Applied sqrt-prod5.6

    \[\leadsto \left(x \cdot \sqrt{1 + y \cdot y}\right) \cdot \color{blue}{\left(\sqrt{\sqrt{1 + y \cdot y}} \cdot \sqrt{\sqrt{1 + y \cdot y}}\right)}\]
  8. Applied associate-*r*5.6

    \[\leadsto \color{blue}{\left(\left(x \cdot \sqrt{1 + y \cdot y}\right) \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \sqrt{\sqrt{1 + y \cdot y}}}\]
  9. Simplified5.6

    \[\leadsto \color{blue}{\left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)} \cdot \sqrt{\sqrt{1 + y \cdot y}}\]
  10. Using strategy rm
  11. Applied pow15.6

    \[\leadsto \left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \color{blue}{{\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}}\]
  12. Applied pow15.6

    \[\leadsto \left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \color{blue}{{\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  13. Applied pow15.6

    \[\leadsto \left(\left(x \cdot \color{blue}{{\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}}\right) \cdot {\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  14. Applied pow15.6

    \[\leadsto \left(\left(\color{blue}{{x}^{1}} \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\right) \cdot {\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  15. Applied pow-prod-down5.6

    \[\leadsto \left(\color{blue}{{\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}} \cdot {\left(\mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}\right) \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  16. Applied pow-prod-down5.6

    \[\leadsto \color{blue}{{\left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)}^{1}} \cdot {\left(\sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}\]
  17. Applied pow-prod-down5.6

    \[\leadsto \color{blue}{{\left(\left(\left(x \cdot \sqrt{\sqrt{1 + y \cdot y}}\right) \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right) \cdot \sqrt{\sqrt{1 + y \cdot y}}\right)}^{1}}\]
  18. Simplified0.1

    \[\leadsto {\color{blue}{\left(\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)\right)}}^{1}\]
  19. Final simplification0.1

    \[\leadsto \mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(x \cdot \mathsf{hypot}\left(\sqrt{1}, y\right)\right)\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"
  :precision binary64

  :herbie-target
  (+ x (* (* x y) y))

  (* x (+ 1 (* y y))))