Average Error: 7.0 → 1.8
Time: 8.1s
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 r597000 = x;
        double r597001 = 2.0;
        double r597002 = r597000 * r597001;
        double r597003 = y;
        double r597004 = z;
        double r597005 = r597003 * r597004;
        double r597006 = t;
        double r597007 = r597006 * r597004;
        double r597008 = r597005 - r597007;
        double r597009 = r597002 / r597008;
        return r597009;
}

double f(double x, double y, double z, double t) {
        double r597010 = x;
        double r597011 = cbrt(r597010);
        double r597012 = y;
        double r597013 = t;
        double r597014 = r597012 - r597013;
        double r597015 = cbrt(r597014);
        double r597016 = r597015 * r597015;
        double r597017 = r597016 / r597011;
        double r597018 = r597011 / r597017;
        double r597019 = 2.0;
        double r597020 = r597015 / r597019;
        double r597021 = r597011 / r597020;
        double r597022 = z;
        double r597023 = r597021 / r597022;
        double r597024 = r597018 * r597023;
        return r597024;
}

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 *-un-lft-identity5.6

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

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

    \[\leadsto \color{blue}{\left(\frac{1}{1} \cdot \frac{1}{z}\right)} \cdot \frac{x}{\frac{y - t}{2}}\]
  13. Applied associate-*l*5.6

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \left(\frac{1}{z} \cdot \frac{x}{\frac{y - t}{2}}\right)}\]
  14. Simplified5.6

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

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

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

    \[\leadsto \frac{1}{1} \cdot \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}\]
  19. Applied times-frac6.3

    \[\leadsto \frac{1}{1} \cdot \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}\]
  20. Applied add-cube-cbrt6.5

    \[\leadsto \frac{1}{1} \cdot \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}\]
  21. Applied times-frac6.5

    \[\leadsto \frac{1}{1} \cdot \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}\]
  22. Applied times-frac1.8

    \[\leadsto \frac{1}{1} \cdot \color{blue}{\left(\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}\right)}\]
  23. Simplified1.8

    \[\leadsto \frac{1}{1} \cdot \left(\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}\right)\]
  24. 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))))