Average Error: 33.8 → 0.5
Time: 4.3s
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 r582510 = x;
        double r582511 = r582510 * r582510;
        double r582512 = y;
        double r582513 = r582512 * r582512;
        double r582514 = r582511 / r582513;
        double r582515 = z;
        double r582516 = r582515 * r582515;
        double r582517 = t;
        double r582518 = r582517 * r582517;
        double r582519 = r582516 / r582518;
        double r582520 = r582514 + r582519;
        return r582520;
}

double f(double x, double y, double z, double t) {
        double r582521 = z;
        double r582522 = t;
        double r582523 = r582521 / r582522;
        double r582524 = x;
        double r582525 = y;
        double r582526 = r582524 / r582525;
        double r582527 = hypot(r582523, r582526);
        double r582528 = sqrt(r582527);
        double r582529 = 1.5;
        double r582530 = pow(r582527, r582529);
        double r582531 = r582528 * r582530;
        return r582531;
}

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.8

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

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

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