Average Error: 5.1 → 0.1
Time: 3.8s
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 r396128 = x;
        double r396129 = 1.0;
        double r396130 = y;
        double r396131 = r396130 * r396130;
        double r396132 = r396129 + r396131;
        double r396133 = r396128 * r396132;
        return r396133;
}

double f(double x, double y) {
        double r396134 = 1.0;
        double r396135 = sqrt(r396134);
        double r396136 = y;
        double r396137 = hypot(r396135, r396136);
        double r396138 = x;
        double r396139 = r396138 * r396137;
        double r396140 = r396137 * r396139;
        return r396140;
}

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

Derivation

  1. Initial program 5.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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