Average Error: 34.0 → 0.8
Time: 4.0s
Precision: binary64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\frac{x}{y} \cdot \frac{x}{y} + \left(\frac{z}{t} \cdot \sqrt[3]{z}\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{t}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\frac{x}{y} \cdot \frac{x}{y} + \left(\frac{z}{t} \cdot \sqrt[3]{z}\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{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 t) (cbrt z)) (/ (* (cbrt z) (cbrt z)) t))))
double code(double x, double y, double z, double t) {
	return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
double code(double x, double y, double z, double t) {
	return ((x / y) * (x / y)) + (((z / t) * cbrt(z)) * ((cbrt(z) * cbrt(z)) / 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

Original34.0
Target0.4
Herbie0.8
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 34.0

    \[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
  2. Using strategy rm
  3. Applied times-frac_binary6419.3

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + \frac{z \cdot z}{t \cdot t}\]
  4. Using strategy rm
  5. Applied times-frac_binary640.4

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\frac{z}{t} \cdot \frac{z}{t}}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt_binary6431.7

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{t} \cdot \frac{z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}\]
  8. Applied add-cube-cbrt_binary6431.9

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{t} \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\sqrt{t} \cdot \sqrt{t}}\]
  9. Applied times-frac_binary6431.9

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{t} \cdot \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)}\]
  10. Applied add-sqr-sqrt_binary6431.9

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \cdot \left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)\]
  11. Applied add-cube-cbrt_binary6432.0

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\sqrt{t} \cdot \sqrt{t}} \cdot \left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)\]
  12. Applied times-frac_binary6432.0

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)} \cdot \left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)\]
  13. Applied swap-sqr_binary6432.0

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{t}}\right) \cdot \left(\frac{\sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)}\]
  14. Simplified31.9

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \color{blue}{\left(\frac{z}{t} \cdot \sqrt[3]{z}\right)} \cdot \left(\frac{\sqrt[3]{z}}{\sqrt{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt{t}}\right)\]
  15. Simplified0.8

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \left(\frac{z}{t} \cdot \sqrt[3]{z}\right) \cdot \color{blue}{\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{t}}\]
  16. Final simplification0.8

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \left(\frac{z}{t} \cdot \sqrt[3]{z}\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{t}\]

Reproduce

herbie shell --seed 2020253 
(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))))