Average Error: 6.9 → 1.8
Time: 6.3s
Precision: 64
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
\[\frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}}}{z} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}\]
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\frac{\frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}{\sqrt[3]{x}}}}{z} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y - t}}{2}}
double f(double x, double y, double z, double t) {
        double r729114 = x;
        double r729115 = 2.0;
        double r729116 = r729114 * r729115;
        double r729117 = y;
        double r729118 = z;
        double r729119 = r729117 * r729118;
        double r729120 = t;
        double r729121 = r729120 * r729118;
        double r729122 = r729119 - r729121;
        double r729123 = r729116 / r729122;
        return r729123;
}

double f(double x, double y, double z, double t) {
        double r729124 = x;
        double r729125 = cbrt(r729124);
        double r729126 = y;
        double r729127 = t;
        double r729128 = r729126 - r729127;
        double r729129 = cbrt(r729128);
        double r729130 = r729129 * r729129;
        double r729131 = r729130 / r729125;
        double r729132 = r729125 / r729131;
        double r729133 = z;
        double r729134 = r729132 / r729133;
        double r729135 = 2.0;
        double r729136 = r729129 / r729135;
        double r729137 = r729125 / r729136;
        double r729138 = r729134 * r729137;
        return r729138;
}

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

Original6.9
Target2.3
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \lt -2.559141628295061 \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.04502782733012586 \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 6.9

    \[\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}{z} \cdot \frac{x}{\frac{y - t}{\color{blue}{1 \cdot 2}}}\]
  11. Applied add-cube-cbrt6.2

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

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

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

    \[\leadsto \frac{1}{z} \cdot \color{blue}{\left(\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}}\right)}\]
  15. Applied associate-*r*1.8

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

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

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

Reproduce

herbie shell --seed 2020056 
(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))))