Average Error: 33.5 → 0.7
Time: 22.5s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}} \cdot \sqrt{\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)\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}} \cdot \sqrt{\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)
double f(double x, double y, double z, double t) {
        double r370276 = x;
        double r370277 = r370276 * r370276;
        double r370278 = y;
        double r370279 = r370278 * r370278;
        double r370280 = r370277 / r370279;
        double r370281 = z;
        double r370282 = r370281 * r370281;
        double r370283 = t;
        double r370284 = r370283 * r370283;
        double r370285 = r370282 / r370284;
        double r370286 = r370280 + r370285;
        return r370286;
}

double f(double x, double y, double z, double t) {
        double r370287 = x;
        double r370288 = y;
        double r370289 = r370287 / r370288;
        double r370290 = z;
        double r370291 = t;
        double r370292 = r370290 / r370291;
        double r370293 = hypot(r370289, r370292);
        double r370294 = cbrt(r370293);
        double r370295 = fabs(r370294);
        double r370296 = sqrt(r370294);
        double r370297 = r370295 * r370296;
        double r370298 = sqrt(r370297);
        double r370299 = sqrt(r370293);
        double r370300 = sqrt(r370299);
        double r370301 = r370298 * r370300;
        double r370302 = r370301 * r370299;
        double r370303 = r370293 * r370302;
        return r370303;
}

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.5
Target0.4
Herbie0.7
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.5

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

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

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

    \[\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 \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \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)}\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt0.6

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

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\color{blue}{\left(\sqrt{\sqrt{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}} \cdot \sqrt{\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)\]
  12. Using strategy rm
  13. Applied add-cube-cbrt0.7

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\sqrt{\color{blue}{\left(\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right) \cdot \sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}}} \cdot \sqrt{\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)\]
  14. Applied sqrt-prod0.7

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\color{blue}{\sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}} \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}}} \cdot \sqrt{\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)\]
  15. Simplified0.7

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\color{blue}{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right|} \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}} \cdot \sqrt{\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)\]
  16. Final simplification0.7

    \[\leadsto \mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right) \cdot \left(\left(\sqrt{\left|\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{hypot}\left(\frac{x}{y}, \frac{z}{t}\right)}}} \cdot \sqrt{\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)\]

Reproduce

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