Average Error: 6.4 → 2.1
Time: 2.8s
Precision: binary64
\[[x, y]=\mathsf{sort}([x, y])\]
\[\frac{x \cdot y}{z} \]
\[\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}} \]
\frac{x \cdot y}{z}
\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}
(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
 :precision binary64
 (*
  (* y (/ (* (cbrt x) (cbrt x)) (* (cbrt z) (cbrt z))))
  (/ (cbrt x) (cbrt z))))
double code(double x, double y, double z) {
	return (x * y) / z;
}
double code(double x, double y, double z) {
	return (y * ((cbrt(x) * cbrt(x)) / (cbrt(z) * cbrt(z)))) * (cbrt(x) / cbrt(z));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.4
Target6.4
Herbie2.1
\[\begin{array}{l} \mathbf{if}\;z < -4.262230790519429 \cdot 10^{-138}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z < 1.7042130660650472 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array} \]

Derivation

  1. Initial program 6.4

    \[\frac{x \cdot y}{z} \]
  2. Using strategy rm
  3. Applied add-cube-cbrt_binary647.2

    \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \]
  4. Applied associate-/r*_binary647.2

    \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\sqrt[3]{z}}} \]
  5. Simplified5.5

    \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}}{\sqrt[3]{z}} \]
  6. Using strategy rm
  7. Applied *-un-lft-identity_binary645.5

    \[\leadsto \frac{y \cdot \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\sqrt[3]{\color{blue}{1 \cdot z}}} \]
  8. Applied cbrt-prod_binary645.5

    \[\leadsto \frac{y \cdot \frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\color{blue}{\sqrt[3]{1} \cdot \sqrt[3]{z}}} \]
  9. Applied times-frac_binary647.1

    \[\leadsto \color{blue}{\frac{y}{\sqrt[3]{1}} \cdot \frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\sqrt[3]{z}}} \]
  10. Simplified7.1

    \[\leadsto \color{blue}{y} \cdot \frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\sqrt[3]{z}} \]
  11. Simplified6.3

    \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
  12. Using strategy rm
  13. Applied add-cube-cbrt_binary647.1

    \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}} \]
  14. Applied add-cube-cbrt_binary647.3

    \[\leadsto y \cdot \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}} \]
  15. Applied times-frac_binary647.2

    \[\leadsto y \cdot \color{blue}{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}\right)} \]
  16. Applied associate-*r*_binary642.1

    \[\leadsto \color{blue}{\left(y \cdot \frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}} \]
  17. Final simplification2.1

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

Reproduce

herbie shell --seed 2021190 
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))