Average Error: 33.3 → 0.8
Time: 6.8s
Precision: binary64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\frac{x}{y} \cdot \frac{x}{y} + \frac{z}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\frac{x}{y} \cdot \frac{x}{y} + \frac{z}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}
(FPCore (x y z t)
 :precision binary64
 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t)
 :precision binary64
 (+ (* (/ x y) (/ x y)) (* (/ z (* (cbrt t) (cbrt t))) (/ (/ z (cbrt t)) t))))
double code(double x, double y, double z, double t) {
	return ((double) ((((double) (x * x)) / ((double) (y * y))) + (((double) (z * z)) / ((double) (t * t)))));
}
double code(double x, double y, double z, double t) {
	return ((double) (((double) ((x / y) * (x / y))) + ((double) ((z / ((double) (((double) cbrt(t)) * ((double) cbrt(t))))) * ((z / ((double) cbrt(t))) / t)))));
}

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

Derivation

  1. Initial program Error: 33.3 bits

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
  2. SimplifiedError: 24.2 bits

    \[\leadsto \color{blue}{x \cdot \frac{x}{y \cdot y} + z \cdot \frac{z}{t \cdot t}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrtError: 44.2 bits

    \[\leadsto x \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y \cdot y} + z \cdot \frac{z}{t \cdot t}\]
  5. Applied times-fracError: 40.1 bits

    \[\leadsto x \cdot \color{blue}{\left(\frac{\sqrt{x}}{y} \cdot \frac{\sqrt{x}}{y}\right)} + z \cdot \frac{z}{t \cdot t}\]
  6. Applied add-sqr-sqrtError: 40.1 bits

    \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(\frac{\sqrt{x}}{y} \cdot \frac{\sqrt{x}}{y}\right) + z \cdot \frac{z}{t \cdot t}\]
  7. Applied unswap-sqrError: 38.6 bits

    \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \frac{\sqrt{x}}{y}\right) \cdot \left(\sqrt{x} \cdot \frac{\sqrt{x}}{y}\right)} + z \cdot \frac{z}{t \cdot t}\]
  8. SimplifiedError: 38.5 bits

    \[\leadsto \color{blue}{\frac{x}{y}} \cdot \left(\sqrt{x} \cdot \frac{\sqrt{x}}{y}\right) + z \cdot \frac{z}{t \cdot t}\]
  9. SimplifiedError: 13.0 bits

    \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{x}{y}} + z \cdot \frac{z}{t \cdot t}\]
  10. Using strategy rm
  11. Applied associate-/r*Error: 4.4 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \color{blue}{\frac{\frac{z}{t}}{t}}\]
  12. Using strategy rm
  13. Applied *-un-lft-identityError: 4.4 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{\frac{z}{t}}{\color{blue}{1 \cdot t}}\]
  14. Applied add-cube-cbrtError: 4.7 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{\frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}}{1 \cdot t}\]
  15. Applied *-un-lft-identityError: 4.7 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{\frac{\color{blue}{1 \cdot z}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}{1 \cdot t}\]
  16. Applied times-fracError: 4.7 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{\color{blue}{\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}}}{1 \cdot t}\]
  17. Applied times-fracError: 4.7 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + z \cdot \color{blue}{\left(\frac{\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{1} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}\right)}\]
  18. Applied associate-*r*Error: 0.8 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\left(z \cdot \frac{\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}{1}\right) \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}}\]
  19. SimplifiedError: 0.8 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}\]
  20. Final simplificationError: 0.8 bits

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{t}\]

Reproduce

herbie shell --seed 2020203 
(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.0) (pow (/ z t) 2.0))

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