Average Error: 6.1 → 6.1
Time: 8.3s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\frac{x}{\frac{z}{y}}\]
\frac{x \cdot y}{z}
\frac{x}{\frac{z}{y}}
double f(double x, double y, double z) {
        double r548458 = x;
        double r548459 = y;
        double r548460 = r548458 * r548459;
        double r548461 = z;
        double r548462 = r548460 / r548461;
        return r548462;
}

double f(double x, double y, double z) {
        double r548463 = x;
        double r548464 = z;
        double r548465 = y;
        double r548466 = r548464 / r548465;
        double r548467 = r548463 / r548466;
        return r548467;
}

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.1
Target5.6
Herbie6.1
\[\begin{array}{l} \mathbf{if}\;z \lt -4.262230790519428958560619200129306371776 \cdot 10^{-138}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \lt 1.704213066065047207696571404603247573308 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Derivation

  1. Initial program 6.1

    \[\frac{x \cdot y}{z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity6.1

    \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
  4. Applied times-frac6.0

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
  5. Simplified6.0

    \[\leadsto \color{blue}{x} \cdot \frac{y}{z}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt6.8

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

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

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

    \[\leadsto \color{blue}{\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt2.1

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

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

    \[\leadsto \frac{x}{\frac{z}{y}}\]

Reproduce

herbie shell --seed 2019298 
(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.70421306606504721e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))