Average Error: 7.0 → 2.6
Time: 20.4s
Precision: 64
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
\[\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}} \cdot \sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}} \cdot \frac{\frac{\sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}}\]
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}} \cdot \sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}} \cdot \frac{\frac{\sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}}
double f(double x, double y, double z, double t) {
        double r377373 = x;
        double r377374 = 2.0;
        double r377375 = r377373 * r377374;
        double r377376 = y;
        double r377377 = z;
        double r377378 = r377376 * r377377;
        double r377379 = t;
        double r377380 = r377379 * r377377;
        double r377381 = r377378 - r377380;
        double r377382 = r377375 / r377381;
        return r377382;
}

double f(double x, double y, double z, double t) {
        double r377383 = x;
        double r377384 = cbrt(r377383);
        double r377385 = r377384 * r377384;
        double r377386 = z;
        double r377387 = cbrt(r377386);
        double r377388 = r377385 / r377387;
        double r377389 = y;
        double r377390 = t;
        double r377391 = r377389 - r377390;
        double r377392 = 2.0;
        double r377393 = r377392 / r377387;
        double r377394 = r377391 / r377393;
        double r377395 = cbrt(r377394);
        double r377396 = r377395 * r377395;
        double r377397 = r377388 / r377396;
        double r377398 = r377384 / r377387;
        double r377399 = r377398 / r377395;
        double r377400 = r377397 * r377399;
        return r377400;
}

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
Herbie2.6
\[\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.045027827330126029709547581125571222799 \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 \cdot 2}{z \cdot \left(y - t\right)}}\]
  3. Using strategy rm
  4. Applied associate-/r*6.0

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

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

    \[\leadsto \frac{\color{blue}{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{2}{\sqrt[3]{z}}}}{y - t}\]
  8. Applied associate-/l*5.4

    \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}}\]
  9. Using strategy rm
  10. Applied add-cube-cbrt5.6

    \[\leadsto \frac{\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}{\color{blue}{\left(\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}} \cdot \sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}\right) \cdot \sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}}}\]
  11. Applied add-cube-cbrt5.7

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}} \cdot \sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}} \cdot \frac{\frac{\sqrt[3]{x}}{\sqrt[3]{z}}}{\sqrt[3]{\frac{y - t}{\frac{2}{\sqrt[3]{z}}}}}}\]
  14. Final simplification2.6

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

Reproduce

herbie shell --seed 2019303 +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.045027827330126e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))

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