Average Error: 5.3 → 0.1
Time: 3.8s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot x\right)\]
x \cdot \left(1 + y \cdot y\right)
\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot \left(\mathsf{hypot}\left(\sqrt{1}, y\right) \cdot x\right)
double f(double x, double y) {
        double r560064 = x;
        double r560065 = 1.0;
        double r560066 = y;
        double r560067 = r560066 * r560066;
        double r560068 = r560065 + r560067;
        double r560069 = r560064 * r560068;
        return r560069;
}

double f(double x, double y) {
        double r560070 = 1.0;
        double r560071 = sqrt(r560070);
        double r560072 = y;
        double r560073 = hypot(r560071, r560072);
        double r560074 = x;
        double r560075 = r560073 * r560074;
        double r560076 = r560073 * r560075;
        return r560076;
}

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

Derivation

  1. Initial program 5.3

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

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

    \[\leadsto \color{blue}{\left(x \cdot \sqrt{1 + y \cdot y}\right) \cdot \sqrt{1 + y \cdot y}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity5.3

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020035 +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))))