Average Error: 33.6 → 0.7
Time: 21.1s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)}^{3}}\right) \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)}^{3}}\right) \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)
double f(double x, double y, double z, double t) {
        double r443671 = x;
        double r443672 = r443671 * r443671;
        double r443673 = y;
        double r443674 = r443673 * r443673;
        double r443675 = r443672 / r443674;
        double r443676 = z;
        double r443677 = r443676 * r443676;
        double r443678 = t;
        double r443679 = r443678 * r443678;
        double r443680 = r443677 / r443679;
        double r443681 = r443675 + r443680;
        return r443681;
}

double f(double x, double y, double z, double t) {
        double r443682 = x;
        double r443683 = y;
        double r443684 = r443682 / r443683;
        double r443685 = z;
        double r443686 = t;
        double r443687 = r443685 / r443686;
        double r443688 = hypot(r443684, r443687);
        double r443689 = sqrt(r443688);
        double r443690 = 3.0;
        double r443691 = pow(r443689, r443690);
        double r443692 = cbrt(r443691);
        double r443693 = r443689 * r443692;
        double r443694 = r443693 * r443688;
        return r443694;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original33.6
Target0.4
Herbie0.7
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.6

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
  2. Simplified19.6

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z \cdot z}{t \cdot t}\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt19.6

    \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z \cdot z}{t \cdot t}\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z \cdot z}{t \cdot t}\right)}}\]
  5. Simplified19.6

    \[\leadsto \color{blue}{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{x}{y}, \frac{x}{y}, \frac{z \cdot z}{t \cdot t}\right)}\]
  6. Simplified0.4

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \color{blue}{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.6

    \[\leadsto \color{blue}{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)} \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)\]
  9. Using strategy rm
  10. Applied add-cbrt-cube0.7

    \[\leadsto \left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right) \cdot \sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}}\right) \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)\]
  11. Simplified0.7

    \[\leadsto \left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{\color{blue}{{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)}^{3}}}\right) \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)\]
  12. Final simplification0.7

    \[\leadsto \left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{{\left(\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right)}^{3}}\right) \cdot \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)\]

Reproduce

herbie shell --seed 2019322 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
  :precision binary64

  :herbie-target
  (+ (pow (/ x y) 2) (pow (/ z t) 2))

  (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))