Average Error: 7.0 → 2.6
Time: 20.6s
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 r436067 = x;
        double r436068 = 2.0;
        double r436069 = r436067 * r436068;
        double r436070 = y;
        double r436071 = z;
        double r436072 = r436070 * r436071;
        double r436073 = t;
        double r436074 = r436073 * r436071;
        double r436075 = r436072 - r436074;
        double r436076 = r436069 / r436075;
        return r436076;
}

double f(double x, double y, double z, double t) {
        double r436077 = x;
        double r436078 = cbrt(r436077);
        double r436079 = r436078 * r436078;
        double r436080 = z;
        double r436081 = cbrt(r436080);
        double r436082 = r436079 / r436081;
        double r436083 = y;
        double r436084 = t;
        double r436085 = r436083 - r436084;
        double r436086 = 2.0;
        double r436087 = r436086 / r436081;
        double r436088 = r436085 / r436087;
        double r436089 = cbrt(r436088);
        double r436090 = r436089 * r436089;
        double r436091 = r436082 / r436090;
        double r436092 = r436078 / r436081;
        double r436093 = r436092 / r436089;
        double r436094 = r436091 * r436093;
        return r436094;
}

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