Average Error: 7.0 → 1.8
Time: 8.0s
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 r604455 = x;
        double r604456 = 2.0;
        double r604457 = r604455 * r604456;
        double r604458 = y;
        double r604459 = z;
        double r604460 = r604458 * r604459;
        double r604461 = t;
        double r604462 = r604461 * r604459;
        double r604463 = r604460 - r604462;
        double r604464 = r604457 / r604463;
        return r604464;
}

double f(double x, double y, double z, double t) {
        double r604465 = x;
        double r604466 = cbrt(r604465);
        double r604467 = y;
        double r604468 = t;
        double r604469 = r604467 - r604468;
        double r604470 = cbrt(r604469);
        double r604471 = r604470 * r604470;
        double r604472 = r604471 / r604466;
        double r604473 = r604466 / r604472;
        double r604474 = 2.0;
        double r604475 = r604470 / r604474;
        double r604476 = r604466 / r604475;
        double r604477 = z;
        double r604478 = r604476 / r604477;
        double r604479 = r604473 * r604478;
        return r604479;
}

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 
(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))))