Average Error: 11.7 → 2.3
Time: 3.7s
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}
double f(double x, double y, double z, double t) {
        double r578823 = x;
        double r578824 = y;
        double r578825 = 2.0;
        double r578826 = r578824 * r578825;
        double r578827 = z;
        double r578828 = r578826 * r578827;
        double r578829 = r578827 * r578825;
        double r578830 = r578829 * r578827;
        double r578831 = t;
        double r578832 = r578824 * r578831;
        double r578833 = r578830 - r578832;
        double r578834 = r578828 / r578833;
        double r578835 = r578823 - r578834;
        return r578835;
}

double f(double x, double y, double z, double t) {
        double r578836 = x;
        double r578837 = y;
        double r578838 = 2.0;
        double r578839 = r578837 * r578838;
        double r578840 = 1.0;
        double r578841 = z;
        double r578842 = r578838 * r578841;
        double r578843 = t;
        double r578844 = r578837 / r578841;
        double r578845 = r578843 * r578844;
        double r578846 = r578842 - r578845;
        double r578847 = r578840 * r578846;
        double r578848 = r578839 / r578847;
        double r578849 = r578836 - r578848;
        return r578849;
}

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

Original11.7
Target0.1
Herbie2.3
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.7

    \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
  2. Using strategy rm
  3. Applied associate-/l*6.7

    \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity6.7

    \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{\color{blue}{1 \cdot z}}}\]
  6. Applied *-un-lft-identity6.7

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

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{\frac{1}{1} \cdot \frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}}\]
  8. Simplified6.7

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \color{blue}{\left(2 \cdot z - \frac{t \cdot y}{z}\right)}}\]
  10. Using strategy rm
  11. Applied *-un-lft-identity2.9

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - \color{blue}{\frac{t}{1} \cdot \frac{y}{z}}\right)}\]
  13. Simplified2.3

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

    \[\leadsto x - \frac{y \cdot 2}{1 \cdot \left(2 \cdot z - t \cdot \frac{y}{z}\right)}\]

Reproduce

herbie shell --seed 2020001 
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

  :herbie-target
  (- x (/ 1 (- (/ z y) (/ (/ t 2) z))))

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