Average Error: 5.6 → 0.1
Time: 4.3s
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 r712959 = x;
        double r712960 = 1.0;
        double r712961 = y;
        double r712962 = r712961 * r712961;
        double r712963 = r712960 + r712962;
        double r712964 = r712959 * r712963;
        return r712964;
}

double f(double x, double y) {
        double r712965 = 1.0;
        double r712966 = sqrt(r712965);
        double r712967 = y;
        double r712968 = hypot(r712966, r712967);
        double r712969 = x;
        double r712970 = r712969 * r712968;
        double r712971 = r712968 * r712970;
        return r712971;
}

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.6
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 5.6

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

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

    \[\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.6

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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.7

    \[\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 2019362 +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))))