Average Error: 33.4 → 0.9
Time: 6.4s
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 \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{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 \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{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 t) (cbrt t))))
   (/ (cbrt z) (cbrt 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(t) * cbrt(t)))) * (cbrt(z) / cbrt(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.4
Target0.4
Herbie0.9
\[{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}\]

Derivation

  1. Initial program 33.4

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

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

    \[\leadsto \frac{x}{y} \cdot \frac{x}{y} + \frac{z}{t} \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
  8. Applied add-cube-cbrt_binary640.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}}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\]
  9. Applied times-frac_binary640.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[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{t}}\right)}\]
  10. Applied associate-*r*_binary640.9

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

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

Reproduce

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