Average Error: 33.8 → 0.8
Time: 4.6s
Precision: binary64
\[\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}\]
\[\left(\frac{x}{y} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y} + {\left(\frac{z}{t}\right)}^{2}\]
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\left(\frac{x}{y} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{y} + {\left(\frac{z}{t}\right)}^{2}
(FPCore (x y z t)
 :precision binary64
 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
(FPCore (x y z t)
 :precision binary64
 (+ (* (* (/ x y) (cbrt x)) (/ (* (cbrt x) (cbrt x)) y)) (pow (/ z t) 2.0)))
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) * cbrt(x)) * ((cbrt(x) * cbrt(x)) / y)) + pow((z / t), 2.0);
}

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.8
\[{\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. Taylor expanded around 0 33.8

    \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{\frac{{z}^{2}}{{t}^{2}}}\]
  3. Simplified19.2

    \[\leadsto \frac{x \cdot x}{y \cdot y} + \color{blue}{{\left(\frac{z}{t}\right)}^{2}}\]
  4. Using strategy rm
  5. Applied times-frac_binary64_203030.4

    \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{x}{y}} + {\left(\frac{z}{t}\right)}^{2}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt_binary64_2031832.3

    \[\leadsto \frac{x}{y} \cdot \frac{x}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} + {\left(\frac{z}{t}\right)}^{2}\]
  8. Applied add-cube-cbrt_binary64_2032932.5

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt{y}} \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt{y}}\right) \cdot \left(\frac{\sqrt[3]{x}}{\sqrt{y}} \cdot \frac{\sqrt[3]{x}}{\sqrt{y}}\right)} + {\left(\frac{z}{t}\right)}^{2}\]
  14. Simplified32.5

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

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

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

Reproduce

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