Average Error: 7.0 → 1.8
Time: 7.7s
Precision: 64
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
\[\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}} \cdot \frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}{z}\]
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}} \cdot \frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}{z}
double f(double x, double y, double z, double t) {
        double r528719 = x;
        double r528720 = 2.0;
        double r528721 = r528719 * r528720;
        double r528722 = y;
        double r528723 = z;
        double r528724 = r528722 * r528723;
        double r528725 = t;
        double r528726 = r528725 * r528723;
        double r528727 = r528724 - r528726;
        double r528728 = r528721 / r528727;
        return r528728;
}

double f(double x, double y, double z, double t) {
        double r528729 = x;
        double r528730 = cbrt(r528729);
        double r528731 = y;
        double r528732 = t;
        double r528733 = r528731 - r528732;
        double r528734 = cbrt(r528733);
        double r528735 = r528734 * r528734;
        double r528736 = r528735 / r528730;
        double r528737 = r528730 / r528736;
        double r528738 = 2.0;
        double r528739 = r528734 / r528738;
        double r528740 = r528730 / r528739;
        double r528741 = z;
        double r528742 = r528740 / r528741;
        double r528743 = r528737 * r528742;
        return r528743;
}

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

Original7.0
Target2.2
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \lt -2.559141628295061113708240820439530037456 \cdot 10^{-13}:\\ \;\;\;\;\frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ \mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \lt 1.045027827330125861587720199944080049996 \cdot 10^{-269}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ \end{array}\]

Derivation

  1. Initial program 7.0

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
  2. Simplified5.8

    \[\leadsto \color{blue}{\frac{x}{\frac{z \cdot \left(y - t\right)}{2}}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity5.8

    \[\leadsto \frac{x}{\frac{z \cdot \left(y - t\right)}{\color{blue}{1 \cdot 2}}}\]
  5. Applied times-frac5.8

    \[\leadsto \frac{x}{\color{blue}{\frac{z}{1} \cdot \frac{y - t}{2}}}\]
  6. Applied *-un-lft-identity5.8

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{\frac{z}{1} \cdot \frac{y - t}{2}}\]
  7. Applied times-frac5.6

    \[\leadsto \color{blue}{\frac{1}{\frac{z}{1}} \cdot \frac{x}{\frac{y - t}{2}}}\]
  8. Simplified5.6

    \[\leadsto \color{blue}{\frac{1}{z}} \cdot \frac{x}{\frac{y - t}{2}}\]
  9. Using strategy rm
  10. Applied associate-*l/5.6

    \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{\frac{y - t}{2}}}{z}}\]
  11. Simplified5.6

    \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y - t}{2}}}}{z}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity5.6

    \[\leadsto \frac{\frac{x}{\frac{y - t}{2}}}{\color{blue}{1 \cdot z}}\]
  14. Applied *-un-lft-identity5.6

    \[\leadsto \frac{\frac{x}{\frac{y - t}{\color{blue}{1 \cdot 2}}}}{1 \cdot z}\]
  15. Applied add-cube-cbrt6.3

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

    \[\leadsto \frac{\frac{x}{\color{blue}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{1} \cdot \frac{\sqrt[3]{y - t}}{2}}}}{1 \cdot z}\]
  17. Applied add-cube-cbrt6.5

    \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{1} \cdot \frac{\sqrt[3]{y - t}}{2}}}{1 \cdot z}\]
  18. Applied times-frac6.5

    \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{1}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}}{1 \cdot z}\]
  19. Applied times-frac1.8

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{1}}}{1} \cdot \frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}{z}}\]
  20. Simplified1.8

    \[\leadsto \color{blue}{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}}} \cdot \frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}{z}\]
  21. Final simplification1.8

    \[\leadsto \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}} \cdot \frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}}{z}\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (if (< (/ (* x 2) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))

  (/ (* x 2) (- (* y z) (* t z))))