Average Error: 33.8 → 0.5
Time: 5.1s
Precision: 64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot {\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{2}}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot {\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{3}{2}}
double f(double x, double y, double z, double t) {
        double r593446 = x;
        double r593447 = r593446 * r593446;
        double r593448 = y;
        double r593449 = r593448 * r593448;
        double r593450 = r593447 / r593449;
        double r593451 = z;
        double r593452 = r593451 * r593451;
        double r593453 = t;
        double r593454 = r593453 * r593453;
        double r593455 = r593452 / r593454;
        double r593456 = r593450 + r593455;
        return r593456;
}

double f(double x, double y, double z, double t) {
        double r593457 = z;
        double r593458 = t;
        double r593459 = r593457 / r593458;
        double r593460 = x;
        double r593461 = y;
        double r593462 = r593460 / r593461;
        double r593463 = hypot(r593459, r593462);
        double r593464 = sqrt(r593463);
        double r593465 = 1.5;
        double r593466 = pow(r593463, r593465);
        double r593467 = r593464 * r593466;
        return r593467;
}

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

Derivation

  1. Initial program 33.8

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)} \cdot \mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\]
  9. Applied associate-*l*0.6

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

    \[\leadsto \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \color{blue}{{\left(\sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)}\right)}^{3}}\]
  11. Using strategy rm
  12. Applied pow1/20.8

    \[\leadsto \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot {\color{blue}{\left({\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\frac{1}{2}}\right)}}^{3}\]
  13. Applied pow-pow0.5

    \[\leadsto \sqrt{\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)} \cdot \color{blue}{{\left(\mathsf{hypot}\left(\frac{z}{t}, \frac{x}{y}\right)\right)}^{\left(\frac{1}{2} \cdot 3\right)}}\]
  14. Simplified0.5

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

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

Reproduce

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